I need to create a rule that will search for the facts that matches my_rule. These facts will be use to change the knowledge base. (my_rule (Conclusion, Premise)
).
I have this knowledge base to start with :
:- dynamic( is/2 ).
is( m1, house ).
is( m1, thing ).
is( m2, house ).
is( m2, thing ).
is( m3, niche ).
is( m3, house ).
is( m3, thing ).
is( m4, car ).
is( m4, mobile ).
is( m4, house ).
is( m4, thing ).
my_rule( is( X, thing ), is( X, house ) ).
my_rule( is( X, house ), is( X, niche ) ).
When a rule is found, the code will search if a Conclusion and its Premise exist in the database.
I have no idea how to achieve this, and yes this is for a homework. I just want someone to point out where to start.
Thanks.