3 ms·
I think the reason is that the right hand side can be a long and complex set of premises. It is supposed to be read as: The lhs is true iff everything on the rh
by khaledh 2y ago
I think the reason is that the right hand side can be a long and complex set of premises. It is supposed to be read as: The lhs is true iff everything on the rhs is true.
You can also think the same way about functions in typical languages: we don't write the body of the function first and then assign it to an identifier.
- Jtsummers 2y agoYes, but not `iff`. f(X) :- g(X), h(X). f(a). With those two statements, `f(a)` is true, but it does not mean that `g(a)` and `h(a)` are also true. Instead, it means that we happen to know some fact, `f(a)`, and some rule for cases beyond that fact. If it also happened that `g(a)` and `h(a)` are true then we'd have two ways of arriving at the fact of `f(a)` being true. It's a reverse of the implication arrow and is meant to be read that way: f(X) :- g(X), h(X). Is read as "f(X) if g(X) and h(X)", versus "if g(X) and h(X) then f(X)".
- khaledh 2y agoThanks for the correction :)