Is there a simple way using backtracking to find a match between a set of variables and a database of facts where the match may not be perfect?
Code: Select all
myDomain : good; bad ; ok.
myFactDB : (myDomain VarA, myDomain VarB, myDomain VarC, myDomain VarD).
%assume I have a database of myFactDB with different combinations of the variables, but not all possible combinations
findMatch(myDomain VarA, myDomain VarB,myDomain VarC,myDomain VarD).
Assuming I got my syntax right, this should find the database entry that matches VarA,VarB,VarC,VarD. But how can I approach writing a clause that will find a match of 3 of the 4 variables, if there isn't a perfect match? I can think of how to do it with separate clauses with all combinations of one or more of the variable set as anonymous, but is there any other way? Should I try something other than a fact database, such as lists?