Giter VIP home page Giter VIP logo

logix's Introduction

logix (Logic Explorer)

Version 0.2.1 Copyright Ben Selfridge 2017

A customizable proof construction tool for sequent calculi.

Introduction

logix is a tool for exploring generic sequent calculi. It was inspired by the book "Structural Proof Theory" by Sara Negri & Jan von Plato (Cambridge University Press, 2001), and is really a spiritual successor to PESCA, the proof editor companion to that book developed by Aarne Ranta. logix was intended to be like PESCA, but with more general capabilities and a slightly more intuitive interface.

logix is intended to be very extensible. I tried to take as little for granted as possible about the target theory, so even the primitive connectives are customizable. For instance, & and | come with logix for certain built-in calculi, but you can extend logix by defining your own primitive operators and deduction rules in the source code (src/Calculi.hs). The notion of conjunction and disjunction live solely in that file; the rest of logix is totally agnostic about what symbols you use, and what they mean. I put a lot of effort into making sure that defining new sequent calculi was as straightforward and obvious as possible.

What's the point?

logix is primarily an educational tool for myself. I wanted to learn about structural proof theory, and the best way to learn how to do math is to make a computer do it for you. However, I also would like other people to use the tool, so I have tried to make it as usable as possible by people who actually know something about this stuff.

Installation

To install logix, simply type

cabal install

at the root level. Alternatively, if you have Haskell Stack, you can type

stack install

Either of these commands will install logix to wherever your default location is for cabal installations.

Use

After you install logix, assuming the location of the executable on your path, you can start it up as follows:

$ logix
LogiX (Logic Explorer) v0.2.1
a customizable proof construction tool for sequent calculi
(c) Ben Selfridge 2017

Type "help" for a list of commands.
> 

For a full list of commands, type help. The only thing you need to know that isn't in the help listing is the correct format for formulas and sequents. As an illustrative example, the following command will begin a proof session with the sequent a | b => ~(~a & ~b) & (b <-> b):

> top a | b => ~(~a & ~b) & (b <-> b)
Changing goal to "a ∨ b ⇒ ¬(¬a & ¬b) & (b ↔ b)".

The important thing is to remember the special symbols; => is the sequent separator, which divides the left- and right-hand sides of a sequent. The binary operators &, |, ->, and <-> are self-explanatory. ~ is unary negation. _|_ is bottom, or false. a <-> b and ~a are both just abbreviations for (a -> b) & (b -> a) and (a -> _|_), respectively. Quantifiers are input via forall x. P(x) and exists x. P(x). Below is an illustration of how we would begin a proof that the classic "Barber's paradox" is unsatisfiable:

> top => ~exists x. (Man(x) & forall y. (Man(y) -> (Shaves(x,y) <-> ~Shaves(y,y))))
Changing goal to " ⇒ ¬∃x.(Man(x) & ∀y.(Man(y) ⊃ (Shaves(x, y) ↔ ¬Shaves(y, y))))".

By default, logix displays sequents using unicode symbols for all these connectives, but you can turn that off with the unicode command.

If you enter the sequent incorrectly, logix will report a parse error and not give you any helpful information.

We note here that the logical connectives used in the examples above are specific to the particular calculi that come with logix in src/Calculi.hs, and are not built-in. Every calculus in logix is defined completely separately from the core deduction engine.

Extending logix

To extend logix with your own sequent calculi, edit the file src/Calculi.hs encode the calculus using the other calculi as models. It's pretty easy to define your own connectives and abbreviations, and the examples in there should be straightforward to imitate. logix is intended to allow encodings of arbitrary sequent calculi, so if you have something you can't express with the tools provided, please let me know.

More info & current status

I am currently planning to add a mechanism for theory-building via axioms/assumptions and theorems. This would enable one to build the theory of groups into a logix session and prove theorems about groups without having to use cumbersome formulas every time. Axioms would be top-level assumptions that would be automatically inserted into the left-hand side of every goal sequent initiated by the top command. Theorems would be similarly inserted. We would abbreviate axioms and theorems by their names wherever they appear verbatim in a sequent. My goal is to make working with theories like Group as straightforward and clean as possible; right now, it's technically possible to do group theory, but I don't want to because I have to mentally parse the entire set of group axioms every time I want to figure out which rule to apply. Abbreviations and top-level axioms/theorems are necessary to do anything useful, so that is definitely coming.

Please contact me if you have any feedback or questions, and especially if you discover a bug.

References

[1] Negri, Sara, Aarne Ranta, and Jan Von Plato. Structural Proof Theory. Cambridge: Cambridge U, 2000. Print.

logix's People

Contributors

benjaminselfridge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logix's Issues

license confusion

Module headers indicate GPL-3, but .cabal and LICENSE indicate BSD3.

operator precedence

We can now define arbitrary binary connectives, but there is currently no way to set the precedence of those connectives. Might actually be relatively easy (just sort the parsers based on a precedence tag).

"map" pattern

Like SetPat, do MapPat which is like SetPat but every element of the set we are matching must match a pattern (rather than just wildcard). This would allow us to do things like !Gamma in linear logic rules

named formulas

Add an additional field (maybe in the form of a tuple) to a formula to give it a name of some kind. This would allow us to display particular formulas in abbreviated form

quantifier precedence

quantifier precedence too high during parsing; need to make it extend as far to the right as possible

Generalize connectives & quantifiers

We want to be able to specify arbitrary connectives, not just and, or, etc. Same goes for quantifiers. The code doesn't do anything specific for the various connectives or quantifiers; that's all supplied by the definition for a Calculus.

Goal: generalize Calculus.hs, Parse.hs, and PPCalculus.hs to work with arbitrary connectives and quantifiers. This will mainly involve modifying Calculus.hs by replacing the different types of Formula and FormulaPat with general "Op" and "Quant" cases. These cases should probably have two Strings associated with them; one for an ASCII rendering of the quantifier, and one for an (optional) unicode rendering.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.