2

I am very new to these things. Hope this is not a very naive question.

I tried the following formula in Prolog: A ⇒ B

and given that B is true, I evaluate A and it says FALSE.

My question is why FALSE? (why not TRUE?) Given the current information we don't know anything about B. Does Prolog work based on the assumption that for anything unknown, it outputs FALSE?

If this is an assumption, how common is this?

Another thing that comes into mind is that, it is finding the assignment to the conjunction of input query and axioms (basically SAT solving). Since the resulting output is TRUE, regardless of whatever value A has, it just chooses one randomly (or zero by default?).

Based the properties of the 1st order logic, it is semidecidable. if a sentence A logically implies a sentence B then this can be discovered, but not the other way around. So, how the latter case is handled in practice, when there is no proof of TRUTH?

PS1. A little explanation about how Prolog works, might also be useful. Does it use SAT solvers as black box? Or greedy search algorithms?

enter image description here

Will Ness
  • 70,110
  • 9
  • 98
  • 181
Daniel
  • 5,839
  • 9
  • 46
  • 85
  • 3
    most probably, you'll get clear answers looking at a Prolog tutorial – CapelliC Aug 09 '14 at 09:26
  • When you see I have asked this question here after testing it, it probably means that I have not found the answer in tutorials ... – Daniel Aug 09 '14 at 22:50
  • 1
    I think I would call SLD resolution a form of depth-first search. Not sure if "greedy" applies. Definitely not doing SAT solving behind the scenes. If you're interested in implementation details, most modern Prologs use Warren's Abstract Machine (WAM), which there is an excellent book about. Prolog never chooses answers randomly (you can generate random values and use those to produce random behavior, of course, it's just not a built-in feature of its proving algorithm). – Daniel Lyons Aug 12 '14 at 22:41

1 Answers1

3

Does Prolog work based on the assumption that for anything unknown, it outputs FALSE?

Yes, it certainly does. This behavior reflects the Closed-World Assumption (CWA) in that if a fact isn't explicitly stated, it is considered false.

If this is an assumption, how common is this?

Very common -- most databases use this assumption.

It may help you to learn about Prolog's method of inference: SLD Resolution.

  • Very useful! Have you seen a generalization of CWA to three-valued logic? http://en.wikipedia.org/wiki/Three-valued_logic – Daniel Aug 11 '14 at 05:55
  • 2
    Not for [quite some time](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.56.350), and certainly not as a feature supported by any mainstream logic programming language or FOL system! –  Aug 11 '14 at 06:03
  • 1
    I don't agree, some operators in Prolog implement CWA, but generally Prolog and SLD Reolution don't. –  Aug 19 '15 at 08:14