Skip to content

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

@JoshRosen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions