Skip to content

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

Description

@JoshRosen

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions