Pylogic is a project that aims to provide tools for the logical paradigm.
Currently it supports the use of cases/facts, which establishes relationships between the arguments it associates; knowledge bases, which are built from cases of a certain arity and allows consultation of related cases (responding in a true/false fashion or, in case of using the _
symbol, a list of answers that match the query).
Examples:
base = KnowledgeBase(2)
@case(base)
def parent(father, son):
pass
parent("bob", "tim")
base.tally(_, "tim") <- [("bob", "tim")]
It’s planned for the future the addition of predicates, that will provide the use of more conditions/filters. For more information you can visit the project!