Simple fast algorithms for the editing distance between trees and related problems
SIAM Journal on Computing
Identifying syntactic differences between two programs
Software—Practice & Experience
Change detection in hierarchically structured information
SIGMOD '96 Proceedings of the 1996 ACM SIGMOD international conference on Management of data
Meaningful change detection in structured data
SIGMOD '97 Proceedings of the 1997 ACM SIGMOD international conference on Management of data
PolyP—a polytypic programming language extension
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Template meta-programming for Haskell
ACM SIGPLAN Notices
A Survey of Longest Common Subsequence Algorithms
SPIRE '00 Proceedings of the Seventh International Symposium on String Processing Information Retrieval (SPIRE'00)
The longest common subsequence problem.
The longest common subsequence problem.
Universes for generic programs and proofs in dependent type theory
Nordic Journal of Computing
A survey on tree edit distance and related problems
Theoretical Computer Science
Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
SSDGP'06 Proceedings of the 2006 international conference on Datatype-generic programming
Dependently typed programming in Agda
AFP'08 Proceedings of the 6th international conference on Advanced functional programming
MPC'06 Proceedings of the 8th international conference on Mathematics of Program Construction
Functional modelling of musical harmony: an experience report
Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
Generic representations of tree transformations
Proceedings of the 9th ACM SIGPLAN workshop on Generic programming
Hi-index | 0.00 |
The UNIX diff program finds the difference between two text files using a classic algorithm for determining the longest common subsequence; however, when working with structured input (e.g. program code), we often want to find the difference between tree-like data (e.g. the abstract syntax tree). In a functional programming language such as Haskell, we can represent this data with a family of (mutually recursive) datatypes. In this paper, we describe a functional, datatype-generic implementation of diff (and the associated program patch). Our approach requires advanced type system features to preserve type safety; therefore, we present the code in Agda, a dependently-typed language well-suited to datatype-generic programming. In order to establish the usefulness of our work, we show that its efficiency can be improved with memoization and that it can also be defined in Haskell.