[問題] 兩題prolog?

作者: jolin19 (alex)   2018-03-30 01:27:51
第一次學這東西有點頭痛Orz...
懇請幫忙!
1. Write a prolog program that tests if a Boolean formula expressed in terms is
satisfiable.
In other words satisfiable (Booleanterm) is true if there is an assignment
(true or false) to each of the variables in Boolean term that render it
satisfiable (that is true).
Boolean term can contain embedded terms like:
and(X,Y), or(X,Y), not(X)
In other words you have to produce the clauses like:
satisfiable (and(X,Y)):- ...
satisfiable (or(X,Y)) :- ...
satisfiable (not(Z)) :- ...
2. Write a Prolog program that recognizes if a string made of left and right
parentheses is "well balanced" (as shown in the following examples):
"()"

Links booklink

Contact Us: admin [ a t ] ucptt.com