From 4012c9de0d68bdd34831b24188a1a9b729b56763 Mon Sep 17 00:00:00 2001 From: "Edward J. Schwartz" Date: Wed, 16 Nov 2022 10:07:35 -0500 Subject: [PATCH] Handle negation_failure --- share/prolog/oorules/util.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/prolog/oorules/util.pl b/share/prolog/oorules/util.pl index 61cac9d3..37e7bf0b 100644 --- a/share/prolog/oorules/util.pl +++ b/share/prolog/oorules/util.pl @@ -6,7 +6,7 @@ :- use_module(library(lists), [append/3, nth1/4, list_to_set/2]). :- dynamic negation_queue/1. -:- dynamic negation_fail/1 as incremental. +:- dynamic negation_fail/1. :- dynamic negation_commit/1 as incremental. :- table negation_helper/1 as opaque. @@ -20,6 +20,10 @@ logtraceln('Already committed ~Q', G), !. +% G results in a sanit yfailure +negation_helper(G) :- + negation_fail(G), !, fail. + % G isn't true right now. negation_helper(G) :- not(G), !, fail.