# FLiP-1.2 : Logical Framework in Python

Jon Jacky jon.p.jacky at gmail.com
Fri Jul 8 05:26:59 CEST 2011

```FLiP-1.2, a logical framework in Python, has been released.  Code,

http://staff.washington.edu/jon/flip/www/

http://pypi.python.org/pypi/FLiP/

https://github.com/jon-jacky/FLiP

Version 1.2 is organized into packages and provides a distutils
install.  These may make FLiP easier to use and extend.  It also
includes a case study based on the "She's a witch!" scene from Monty
Python and the Holy Grail. The functionality is the same as in version
1.0, as it was announced here in July 2009:

--------

FLiP is a logical framework written in Python.  A logical framework is
a library for defining logics and writing applications such as theorem
provers.  One Flip application is a proof checker for entering and
editing proofs in natural deduction style.  Here is some output from
the checker, generated from a Python proof script:

[(Text('~Ax.P(x) |- Ex.~P(x)'), comment),
(Not(A(x, P(x))), given),
(Not(E(x, Not(P(x)))), assume),
(New(x), new),
(Not(P(x)), assume),
(E(x, Not(P(x))), Ei, 4),
(F, contra, 5,2),
(Not(Not(P(x))), raa, 4,6),
(P(x), ne, 7),
(A(x, P(x)), Ai, 3,8),
(F, contra, 9,1),
(Not(Not(E(x, Not(P(x))))), raa, 2,10),
(E(x, Not(P(x))), ne, 11)]

The checker can use different logics; Flip comes with several.  You
can add another logic, or add axioms and derived rules, by writing a
module in Python.  Python is both the object language and the
metalanguage.  Formulas, inference rules, and entire proofs are Python
expressions.  Prover commands are Python functions.  The Python
interpreter itself is the only user interface to the proof checker
application.  (It is not necessary to know much Python to use the
checker.)

Flip was undertaken as a Python programming exercise.  It is not
intended to compete with industrial-strength theorem provers such as
HOL nor with nicely-designed educational provers such as Jape.  That
said, the checker is quite capable of working the examples and
exercises in university-level textbooks on logic for computer science
or mathematics (such as those by Kaye, Huth and Ryan, or Bornat).
```