It is improbable that John went to the garden. It is highly likely that Greg is green. It is highly likely that Julius is gray. It is highly unlikely that if either 'John went to the garden' or 'Julius is gray' but not both then Emily is a wolf. There is little chance that if 'Greg is green' or 'Julius is gray' or both then Brian is gray. It is impossible that if 'John went to the garden and Julius is gray' then Mary is in the hallway.
We believe that 'Mary is in the hallway and Brian is gray'.
It is impossible that 'Mary is in the hallway and Brian is gray'.
We believe that 'Mary is in the hallway and Brian is gray'.

  and(A,B) :- A,B.
  or(A,B) :- A;B.
  nand(A,B) :- not(and(A,B)).
  nor(A,B) :- not(or(A,B)).
  xor(A,B) :- or(A,B), nand(A,B).

  %hop0
  0.1::factA.
  0.9::factB.
  0.9::factC.
  %hop1
  0.05::factX:-xor(factA,factC).
  0.1::factY:-or(factB,factC).
  0.0::factZ:-and(factA,factC).

  %hop2
  conclusion:-and(factZ,factY).

  query(conclusion).
  
'Mary is in the hallway and Brian is gray'.