CoCalc Shared Filesprolog.ipynbOpen in CoCalc with one click!
Author: Harald Schilly
Views : 7
Description: Jupyter notebook prolog.ipynb
In [6]:
child(stephanie). child(thad). mother_child(trude, sally). father_child(tom, sally). father_child(tom, erica). father_child(mike, tom). sibling(X, Y) :- parent_child(Z, X), parent_child(Z, Y). parent_child(X, Y) :- father_child(X, Y). parent_child(X, Y) :- mother_child(X, Y).
Rule added to database. Rule added to database. Rule added to database. Rule added to database. Rule added to database. Rule added to database. Rule added to database. Rule added to database. Rule added to database.
In [7]:
father_child(tom, sally)?
Use '%continue' for more results.
True
In [9]:
has(jack,apples). has(ann,plums). has(dan,money). fruit(apples). fruit(plums).
Rule added to database. Rule added to database. Rule added to database. Rule added to database. Rule added to database.
In [14]:
has(jack,_)? has(dan, money)?
Use '%continue' for more results. Use '%continue' for more results.
True
In [15]:
%continue
Use '%continue' for more results.
True
In [12]:
has(ann, money)?
No more results.
In [ ]: