Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

First Order Logic Engine

I'd like to create an application that can do simple reasoning using first order logic. Can anyone recommend an "engine" that can accept an arbitrary number of FOL expressions, and allow querying of those expressions (preferably accessible via Python)?

like image 289
Cerin Avatar asked Feb 21 '10 04:02

Cerin


People also ask

What does first order mean in logic?

First-order logic is symbolized reasoning in which each sentence, or statement, is broken down into a subject and a predicate. The predicate modifies or defines the properties of the subject. In first-order logic, a predicate can only refer to a single subject.

What is first-order logic examples?

Definition A first-order predicate logic sentence G over S is a tautology if F |= G holds for every S-structure F. Examples of tautologies (a) ∀x.P(x) → ∃x.P(x); (b) ∀x.P(x) → P(c); (c) P(c) → ∃x.P(x); (d) ∀x(P(x) ↔ ¬¬P(x)); (e) ∀x(¬(P1(x) ∧ P2(x)) ↔ (¬P1(x) ∨ ¬P2(x))).

What is first-order logic in AI?

FOL is a mode of representation in Artificial Intelligence. It is an extension of PL. FOL represents natural language statements in a concise way. FOL is also called predicate logic. It is a powerful language used to develop information about an object and express the relationship between objects.

What are the 3 families of first order inference algorithm?

As propositional logic we also have inference rules in first-order logic, so following are some basic inference rules in FOL: Universal Generalization. Universal Instantiation. Existential Instantiation.


3 Answers

Don't query using first-order logic (FOL) unless you absolutely have to: first-order logic is not decidable, but only semi-decidable, and so queries will often, unavoidably not terminate.

Description logic is essentially a decidable fragment of first-order logic, reformulated in a manner that is good for talking about classes of entity and their interrelationships. There are many engines for description logic in Python, for example seth, based on OWL-DL.

If you are really sure that you need the vastness of FOL, then FLiP is worth a look. I've not used it (not really keen on Python, to be honest), but this is a good approach to making logic checking available to a programming language.

like image 138
Charles Stewart Avatar answered Sep 21 '22 02:09

Charles Stewart


PyLog:

PyLog is a first order logic library including a PROLOG engine in Python.

like image 43
Eli Bendersky Avatar answered Sep 22 '22 02:09

Eli Bendersky


Recipe 303057: Pythologic -- Prolog syntax in Python / http://code.activestate.com/recipes/303057/

like image 40
miku Avatar answered Sep 20 '22 02:09

miku