logic-and-learning-lab/Popper

Poor redundant literal check

Closed this issue · 1 comments

Suppose Popper generates this rule:

f(A):-
    has_car(A,B),
    has_car(A,C),
    long(B),
    long(C).

Then Popper's subsumption check will detect that two of the body literals are logically redundant.

Popper will then generate a generalisation constraint to eliminate any generalisations of this rule. However, Popper will then happily generate this rule:

f(A):-
    has_car(A,B),
    has_car(A,C),
    has_car(A,D),
    long(B),
    long(C),
    long(D).

And then this rule:

f(A):-
    has_car(A,B),
    has_car(A,C),
    has_car(A,D),
    has_car(A,E),
    long(B),
    long(C),
    long(D),
    long(E).

In fact, Popper will happily generate rules with more body literals without enforcing that the larger rule is sufficiently specialised as to not contain redundancy.

We need to fix this issue.

The fix is something along the lines of a constraint that identifies the redundant part and then asserts that it needs to be specialised to be useful in a rule.

We have dropped this 'redundant_literal' check from the latest version, but it could still be useful to add it again if we can correctly eliminate such pointless rules.