Skip to content

Commit d6df61d

Browse files
committed
Add a sanity check for delay negation
1 parent 6276128 commit d6df61d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

share/prolog/oorules/insanity.pl

+14-1
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,18 @@
328328
factEmbeddedObject(A, B, C))
329329
).
330330

331+
% We committed to a condition being true (or false). Make sure that it stays
332+
% that way.
333+
:- table insanityNegation/1 as incremental.
334+
insanityNegation(Out) :-
335+
negation_commit(G),
336+
337+
not(G),
338+
339+
Out = (
340+
logwarnln('Consistency checks failed.~nThe condition "~Q" was committed to, but has become false.~n', [G])
341+
).
342+
331343
:- table sanityChecks/1 as incremental.
332344
sanityChecks(Out) :-
333345
insanityNoBaseConsistency(Out);
@@ -346,7 +358,8 @@
346358
insanityInheritanceLoop(Out);
347359
insanityContradictoryMerges(Out);
348360
insanityContradictoryNOTConstructor(Out);
349-
insanityTwoRealDestructorsOnClass(Out).
361+
insanityTwoRealDestructorsOnClass(Out);
362+
insanityNegation(Out).
350363

351364
sanityChecks :-
352365
sanityChecks(Out)

0 commit comments

Comments
 (0)