Skip to content

Commit 3fb256d

Browse files
committed
VFTable Belongs check. Fix groundTruth bug.
1 parent a8ca88f commit 3fb256d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

share/prolog/oorules/insanity.pl

+14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
% ============================================================================================
55

66
:- table haveGround/0 as opaque.
7+
:- multifile groundTruth/9.
78
haveGround :- groundTruth(_, _, _, _, _, _, _, _, _), !.
89

910
% If we have ground truth, did we merge two different classes together?
@@ -24,6 +25,18 @@
2425
logwarnln('Consistency checks failed.~n~Q (~Q::~Q) and ~Q (~Q::~Q) are on the same class, but ground truth says they are on ~Q and ~Q.', [M1, C1, Mname1, M2, C2, Mname2, C1, C2])
2526
).
2627

28+
% If we have ground truth, is VFTableBelongsToClass correct?
29+
:- table insanityVFTableDoesntBelong/1 as incremental.
30+
insanityVFTableDoesntBelong(Out) :-
31+
reasonVFTableBelongsToClass(VFTable, Offset, Class, Rule, VFTableWrite),
32+
groundTruth(VFTable, GVFTableClass, 'vftable', table, vftable, _, _, _, _),
33+
groundTruth(Class, GClass, Method, _, _, _, _, _, _),
34+
iso_dif(GVFTableClass, GClass),
35+
36+
Out = (
37+
logwarnln('Consistency checks failed.~n~Q but ground truth says ~Q is on ~Q and ~Q is on ~Q.', [reasonVFTableBelongsToClass(VFTable, Offset, Class, Rule, VFTableWrite), VFTable, GVFTableClass, Class, GClass])
38+
).
39+
2740

2841
% If we say we have no base classes, we have no base classes :-)
2942
:- table insanityNoBaseConsistency/1 as incremental.
@@ -374,6 +387,7 @@
374387
groundSanityChecks(Out) :-
375388
haveGround,
376389

390+
insanityVFTableDoesntBelong(Out),
377391
insanityGroundBadMerge(Out).
378392

379393
sanityChecks :-

0 commit comments

Comments
 (0)