entail
is presumably slower than your industrial-grade C inference algorithm, but logical statements are given as Python expressions, and entailment can be checked at the interactive prompt. This makes the module easy to use, and fun. (Source Code).
9 comments:
Example usage
>>> S = AssumptionSet()
>>> S.assume('a => b')
>>> S.assume('b => c')
>>> S.assume('c => a')
>>> S.implies('a <=> b')
True
>>> S.implies('a')
False
>>> S.assume('a')
>>> S.implies('c')
True
See also my post "intelligent minesweeper" [1], based on this module.
this very professionalism thanks
>>> import entail
>>> Socrates = entail.AssumptionSet()
>>> Socrates.assume('A=>B')
>>> Socrates.implies('A')
False
>>> Socrates.assume('~A')
>>> Socrates.implies('~B')
True
>>>
Error?
Denying the antecedent
Hey Dave, you should use 'not A' and 'not B' then it works correctly.
Does your library allow for the "AND" and "OR" operators or nesting?
For instance, could I express a proposition like any of the below:
A & B & C => X
A | B | C => X
A & (B | C) => X
I like the sample usage, by the way. Lean and easy to read.
I should add that I've never written a line of python in my life, but that I've been searching for a lightweight propositional logic system for some time.
I also, spoke before I looked at the code (big mistake). It does look like it supports nesting, AND, and OR (at least from viewing the unit tests).
It does make me wonder, though. Is there a way to retract assumptions? For instance, can I "S.assume('a')" then later "S.unassume('a')"?
Jacket Leather Indonesia
Civet Coffee Indonesia
http://bantalsilikon01.blogspot.com/
cd
anne jelita brenda anne caca tasya ruth
bantal web jual bantal bantal bantal silikon pembicara hellow bumbu bumbu bumbu bumbu bumbu distro distro
distro
sabunherbal
keset
bantal
seo
distro
jual
marinir
bumbu
وكالة نيوز
مباراة
1437
مصر
منوعات
Post a Comment