Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,如果我有一个表达式“C = A and B”,我想创建某种谓词,例如
solv(A, B, C) := C is A, B.
称它为
solv(A, true, true).
这样 Prolog 就会说“B 是真的”。请帮忙。
看起来像
and(A, B, R) :- A = true, B = true, R = true. or(A, B, R) :- (A = true ; B = true), R = true. solve(A, B, C, Result) :- or(A, B, R1), and(R1, C, Result).