Reputation: 572
Assume my knowledge base contains one fact: fact(fact1).
If I know submit a query fact(fact1).
39 ?- fact(fact1).
40 ?-
it says nothing, which is the equivalent to true. B/c if it's wrong, Prolog responds with false:
38 ?- fact(foobar).
false.
So how can I change it so I get a true. ?
Upvotes: 0
Views: 648
Reputation: 11
Looks like SWI Prolog Editor (at least on some versions), by default, sets the following environmental flag:
set_prolog_flag(prompt_alternatives_on, groundness).
To display true you can change it like this:
set_prolog_flag(prompt_alternatives_on, determinism).
This has the side effect of requiring the user to press after each true to return to the interactive prompt though... (Not sure if there is some better way to achieve this.)
Upvotes: 1