Skip to content

Implementation of "Pattern Matching in Trees", in OCaml.

Notifications You must be signed in to change notification settings

contificate/algorithm-d-ocaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithm D

An implementation of Algorithm D as described in Pattern Matching in Trees by Hoffmann and O'Donnell. This implementation is in OCaml, as it powers the demo on my blog article about this algorithm. A Java version of the same can be found here.

screenshot

The algorithm works by constructing an Aho-Corasick automaton for a set of root-to-leaf "path strings" from the pattern tree(s). Then, the subject tree is traversed using a traversal stack. At each output, the match length can be used to index the traversal stack to find the relevant subtree (where a match is rooted). If, by the end, the number of path string matches equals the number of path strings, then there's a match.

About

Implementation of "Pattern Matching in Trees", in OCaml.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages