Skip to content

Commit 2fa24df

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6f6113d commit 2fa24df

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

inference_engine_algorithms/forward_chaining.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def find_symbols_in_kb(knowledge_base: list[str]) -> dict:
3030

3131

3232
def number_of_symbols_in_premise(knowledge_base: list[str]) -> dict:
33-
3433
"""
3534
Count the number of prposiotion symbols in each premise of KB clause.
3635
:param knowledge_base: a list of string of definite clauses
@@ -66,13 +65,13 @@ def get_known_facts(knowledge_base: list[str]) -> list[str]:
6665
def forward_chaining(knowledge_base: list[str], query: str) -> bool:
6766
"""Forward chaining on Knowledge Base(KB) of definite clauses
6867
:param knowledge_base: a list of string of definite clauses
69-
:param query: a single proposition symbol
68+
:param query: a single proposition symbol
7069
:returns: If the query entailed by the KB or not?
71-
>>> input_kb = [ "P => Q", "L & M => P",
70+
>>> input_kb = [ "P => Q", "L & M => P",
7271
... "B&L=> M", "A&P=>L", "A&B=>L", "A", "B" ]
7372
>>> forward_chaining(input_kb, "Q")
7473
True
75-
>>> input_kb = [ "P => Q", "L & M => P",
74+
>>> input_kb = [ "P => Q", "L & M => P",
7675
... "B&L=> M", "A&P=>L", "A&B=>L", "A", "B" ]
7776
>>> forward_chaining(input_kb, "C")
7877
False

0 commit comments

Comments
 (0)