evhub / pyprover Goto Github PK
View Code? Open in Web Editor NEWResolution theorem proving for predicate logic in pure Python.
License: Apache License 2.0
Resolution theorem proving for predicate logic in pure Python.
License: Apache License 2.0
Could you please provide documentation tjat contains detailed examples so that we understand more
I have been trying different FOL expressions with quantifiers and equality (Eq
).
Firstly, strict_proves
seems to provide incorrect results for many expressions. For example:
# Expression for testing whether predicate P is true for three or more different constants
>>> strict_proves((P(a)), EX(x, EX(y, EX(z, P(x) & P(y) & P(z) & ~Eq(x,y) & ~Eq(y,z) ))))
True
>>> proves((P(a)), EX(x, EX(y, EX(z, P(x) & P(y) & P(z) & ~Eq(x,y) & ~Eq(y,z) ))))
False
Secondly, proves
gets stuck when given expressions with many nested quantifiers. For example:
# Function gets stuck and never returns
proves((P(a), P(b)), EX(x,EX(y,EX(z, P(x) & P(y) & P(z) & ~Eq(x,y) & ~Eq(y,z)))))
Thanks for this awesome library. But I think maybe the following results are wrong?
In [4]: from pyprover import *
In [5]: f1 = '∃y,∃z,∀x, (Q(x,z)->Q(y,x))'
...: f2 = '∀y,∃x, ((R(x,z)∧R(x))->R(y))'
...: print(proves_and_proved_by(expr(f1),expr(f2)))
True
these two are not equal, right?
In [2]: from pyprover import *
...: f1 = '∀z,∃x, ¬((Q(z)∧Q(x)))'
...: f2 = '∃z,∀x, ¬((Q(x)∧Q(z)))'
...: print(proves_and_proved_by(expr(f1),expr(f2)))
True
these two are also not equal, right?
>> x = Var('x')
>> y = Var('y')
>> (Q(x)).find_unification(Q(a))
>> {Var("x"): Const("a")}
>> (Q(x) & P(y)).find_unification((Q(a) & P(b)))
>>
That is, (Q(x) & P(y)).find_unification((Q(a) & P(b)))
output None.
I think there is something wrong with the find_unification.
Is it possible to use this library to create Fitch-style natural deduction or semantic tableaux tree diagrams?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.