AI Knowledge Based System: I am having difficulties understanding proposition logic I am having difficulties wrapping my head around how the answer is being produced. How does the solution come up with the answer 3? How does one derive the answer 3 from the truth table? 

For example the following file :


  TELL  p2=> p3; p3 => p1;
  
  ASK p2


Produces the following result. 




  Standard output is an answer of the form YES or NO, depending on
  whether the ASK(ed) query q follows from the TELL(ed) knowledge base
  KB. When the method is TT and the answer is YES, it should be followed
  by a colon (:) and the number of models of KB
The provided result is a non-sense for this input.

In a closed world paradigm (ie: prolog), where all non-provable facts are assumed as false, from "p2->p3 and p3->p1", p2 is false, and the program result should be "p2 ? No".

In an open world, as it is not possible to proof "p2" nor "not p2", the result must be "p2 ? unknown"

"p2 -> p3 and p3 -> p1" doesn't provides any information about "p2" in the same way that "if it is sunny then I'm happy" doesn't provides information about if it is sunny or raining.

The meaning of the number after the "yes" (the number of "models") is unknown. Even present two true tables for a single fact "p2 -> p3 and p3 -> p1" can be considered an error.