Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Added definite_clauses_KB to logic.py
  • Loading branch information
ad71 committed Jun 28, 2018
commit 87855b97f8127139a34614df5c9c6c61c4f264af
7 changes: 7 additions & 0 deletions logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,13 @@ def pl_fc_entails(KB, q):
for s in "P==>Q; (L&M)==>P; (B&L)==>M; (A&P)==>L; (A&B)==>L; A;B".split(';'):
horn_clauses_KB.tell(expr(s))

"""
Definite clauses KB example
"""
definite_clauses_KB = PropDefiniteKB()
for clause in ['(B & F)==>E', '(A & E & F)==>G', '(B & C)==>F', '(A & B)==>D', '(E & F)==>H', '(H & I)==>J', 'A', 'B', 'C']:
definite_clauses_KB.tell(expr(clause))

# ______________________________________________________________________________
# DPLL-Satisfiable [Figure 7.17]

Expand Down