I'm writing an assignment for a prolog class and I'm stuck on something simple. I've written a bunch of logic in a file called question1.pl
I'm using SWI on Mac OS X, so at the command prompt I do this:
swilg
consult('question1.pl').
to load the file, then to test it I do:
?- father(homer,bart).
true
?- father(marge,bart).
false
and so on.
My question is, how do I write a "test script" for my code?
I'm assuming I should write something like question1-tests.pl that looks like this:
(write 'test1, should be true').
father(homer,bart).
(write 'test2, should be false').
father(marge,bart).
But how do I run that script?
Sorry, I know this is simple, but I'm stuck. Thanks!