VictorCMiraldo / hdiff

Hash-based Diffing for AST's
MIT License
75 stars 3 forks source link

Tree Edit Distance #25

Open VictorCMiraldo opened 5 years ago

VictorCMiraldo commented 5 years ago

We have already implemented tree edit distance; We already seen how a HDiff.Patch translated to a GDiff.ES is worse, in terms of higher edit-script-cost, than a computed GDiff.ES.

Another thing we should do is count how many constructors we actually delete and insert with a HDiff, and compare that with a gdiff. For that to be accurate, though, we must not count the spine:

hdiffCost :: Patch -> Int
hdiffCost p = sum . holesGetHolesWith (uncurry' go) . holesLCP (cCtxDel (distr p)) (cCtxIns (distr p))
  where
    go p q = size p + size q