Skip to content

Commit

Permalink
VFTable Belongs check. Fix groundTruth bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-eschwartz committed Nov 17, 2022
1 parent a8ca88f commit be4002c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion share/prolog/oorules/insanity.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
% ============================================================================================

:- table haveGround/0 as opaque.
:- multifile groundTruth/9.
haveGround :- groundTruth(_, _, _, _, _, _, _, _, _), !.

% If we have ground truth, did we merge two different classes together?
Expand All @@ -24,6 +25,18 @@
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])
).

% If we have ground truth, is VFTableBelongsToClass correct?
:- table insanityVFTableDoesntBelong/1 as incremental.
insanityVFTableDoesntBelong(Out) :-
reasonVFTableBelongsToClass(VFTable, Offset, Class, Rule, VFTableWrite),
groundTruth(VFTable, GVFTableClass, 'vftable', table, vftable, _, _, _, _),
groundTruth(Class, GClass, _Method, _, _, _, _, _, _),
iso_dif(GVFTableClass, GClass),

Out = (
logwarnln('Consistency checks failed.~n~Q but ground truth says VFTable ~Q is on ~Q and ~Q is on ~Q.', [reasonVFTableBelongsToClass(VFTable, Offset, Class, Rule, VFTableWrite), VFTable, GVFTableClass, Class, GClass])
).


% If we say we have no base classes, we have no base classes :-)
:- table insanityNoBaseConsistency/1 as incremental.
Expand Down Expand Up @@ -374,7 +387,8 @@
groundSanityChecks(Out) :-
haveGround,

insanityGroundBadMerge(Out).
(insanityVFTableDoesntBelong(Out);
insanityGroundBadMerge(Out)).

sanityChecks :-
sanityChecks(Out)
Expand Down

0 comments on commit be4002c

Please sign in to comment.