A general logic program is safe for negation if every top-down-positive
derivation has the property that any variable in a negative subgoal is also in
some positive subgoal of the same derived clause or in the top-level
clause. •
The essential property of programs that are safe for negation is that when-
ever the top-level clause of a positive-complete derivation is variable free
(ground), then so is the last clause, which contains only negative subgoals (or
is empty). We see that this is not the case in P
2
above because there is a
positive-complete derivation that begins with p{\) and ends with
—\s(l,Y).
However
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.