Thank for your response. I'm pretty sure your program works fine in prolog. My apologies for perhaps not being explicit on my doubts. Do allow me to rephrase my question.
I know some prolog, but I'm not sure what you're asking.
Okay, say you have cat and dog. First you say that they're animals
Somewhere above, you may have defined one or both of these (or neither). For this example, let's say you have both:
By entering the above clauses into prolog, we're saying that love(cat) and love(dog) are both true statements and thus are both logical consequence of our logic program.
However, if we let (cat = p) and (dog = q), the original question:
"I love cats or I love dogs" translate into "p v q"
"If I love cats then I love dogs" translate into "q \<- p"
By constructing a truth table for the above, we get the following:
p | q | p v q | q \<- p |
T | T | T | T | (1)
T | F | T | F | (2)
F | T | T | T | (3)
F | F | F | T | (4)
It is shown that q is the only logical consequence of the program since it is true when both statements are also true (as shown in (1) and (3)). p on the other hand is not a logical consequence since it is false under (3). This would directly contredict our program clause earlier.
My question therefore is:
"Is there a way to use prolog to demonstrate what the truth table has just shown us?"
Any reply is greatly appreciated!
p/s - I also have another question on Herbrand Theorem which i hope your can help me with please. Thanks :lol: