Background: is_evidence is used to check if a fact is evidence for a target. If two objects have the same object/property but different values, then this is called "counter-evidence" for example consider:
target: (fact (mk.val h position 5))
evidence: (fact (mk.val h position 10))
If the target position is 5 but the evidence is that the position is 10, then this is counter-evidence. In this case, is_evidence returns MATCH_SUCCESS_NEGATIVE. (This is different than MATCH_FAILURE which means that the two facts are unrelated.)
But now consider if the target is an anti-fact:
target: (|fact (mk.val h position 5))
evidence: (fact (mk.val h position 10))
The target was to not have position 5, and the evidence is that the position is 10, which is not 5. The target was achieved! The problem is that is_evidence doesn't take into account if the target is an anti-fact and still returns MATCH_SUCCESS_NEGATIVE in this case. This pull request changes it to return MATCH_SUCCESS_POSITIVE in this case.
Background:
is_evidence
is used to check if a fact is evidence for a target. If two objects have the same object/property but different values, then this is called "counter-evidence" for example consider:If the target position is 5 but the evidence is that the position is 10, then this is counter-evidence. In this case,
is_evidence
returnsMATCH_SUCCESS_NEGATIVE
. (This is different thanMATCH_FAILURE
which means that the two facts are unrelated.)But now consider if the target is an anti-fact:
The target was to not have position 5, and the evidence is that the position is 10, which is not 5. The target was achieved! The problem is that
is_evidence
doesn't take into account if the target is an anti-fact and still returnsMATCH_SUCCESS_NEGATIVE
in this case. This pull request changes it to returnMATCH_SUCCESS_POSITIVE
in this case.