bloom-lang/c4

"Failed to find variable" error that's dependent on ordering of negated body predicates

JoshRosen opened this issue · 0 comments

The following program produces the error

ERROR: Failed to find variable NRESERVED, at /Users/joshrosen/Documents/boom/c4/src/libc4/planner/plan_expr.c:166

when run with c4i:

define(prepared, {string, int});
define(good, {string, int});
define(begin, {string});
define(clock, {int});

good(X, NRESERVED) :-
    begin(X),
    notin prepared(X, NRESERVED),
    clock(NRESERVED);

However, everything works fine if I rewrite the rule body such that the negated predicate appear at the end of the rule:

good(X, NRESERVED) :-
    begin(X),
    clock(NRESERVED),
    notin prepared(X, NRESERVED);