CS470/570  Artificial Intelligence

Program #3:  Dynamic testing of your Logic!

Testing Peano: 

Run the following test queries, in exactly this order:

natnum(0).

natnum(100).

natnum(12.34).

natnum(-9).

 

successor(20,X).

successor(X,15).

successor(0,X).

successor(X,0).

successor(X,-9).

 

plus(4,5,OUT).

plus(4.3,5,Out).

mult(4,5,OUT).

mult(2.2, 5.5, Out).

exp(3,5,OUT).

 

%now turn tracing on and show follow through the following computation

trace.

plus(1,2,Out).

 

Simply print the output window when you are done, label it clearly, and include in your packet.

 

 

Testing Family Relationships:

Encode the following family tree as facts in your family tree prover.

Family tree: There are all kinds of families!

 

Then run the following queries, in exactly this order. For queries with multiple solutions, hit ';' repeatedly to show all solutions found.

grandchild(john-jr, emily).

grandchild(johnny-b, X).

ancester(X,maybelle).

sibling(X,mary).

son(X,johnny).

ancestor(X,hank).

uncle(X,frank).

aunt(X, frank).

grandchild(X,cindy)

child(cindy,X).

 

Print out your interaction window when you are done, label clearly, and include in your packet.