abau / co4

COmplexity COncerned COnstraint COmpiler
GNU General Public License v3.0
2 stars 3 forks source link

orelse (andthen p q) r : should not backtrack #85

Closed jwaldmann closed 10 years ago

jwaldmann commented 10 years ago

this creates too much backtracking:

orelse_andthen p q r = orelse (andthen p q) r

the actual semantics we want is: if p succeeds, then enter q (but never return to r) this is similar to Parsec's behaviour (if consume one letter, then must succeed)

I don't see how to do this, after several hours of experiments.

should read up on http://www-ps.informatik.uni-kiel.de/~sebf/data/pub/atps09.pdf

actually, https://hackage.haskell.org/package/logict-0.6.0.2/docs/Control-Monad-Logic.html

jwaldmann commented 10 years ago

clarification about "bug" status: it is rather an inefficiency (search wastes time, but any results that are found, are still correct)

jwaldmann commented 10 years ago

should be fixed by commit 0bb55e2cbee80d3feb86b0c00052914e541e43e1