Variable in where of rewrite rule returns empty list instead of nonempty list
evaluate(|rulls*): ([Rule(head, body) | remainingrules*], goal, store*) -> (<Fst><evaluate(|rulls*)> (rulls*, subgoal, ), free-store*) where ... (local-store*, free-store*) := <unify> (head, goal, , store*); ... <debug>free-store*; // Prints [non-empty list] ... // Same as right hand side of rule; Prints ("true", [non-empty list]) <debug>(<Fst><evaluate(|rulls*)> (rulls*, subgoal, ), free-store*) ... // <debug> Prints ("true", ) evaluate-full: (rulls*, Query(goal)) -> <evaluate(|desugared-rules*);debug> (desugared-rules*, <desugar-all> goal, ) where ...
The problem is the output ofSubmitted on 31 May 2016 at 11:16
evaluateis supposed to be
("true", [non-empty list]), as is confirmed by its final
("true", )when calling
Be careful with the * suffix for variables. It is actually an operator that will unroll the list in some cases and not in others.
I don't understand this code and I cannot reproduce it this way. Can you create a minimal example that reproduces the problem?
Log in to post comments