Giter VIP home page Giter VIP logo

stalmarck's Introduction

Stalmarck

Docker CI Nix CI Contributing Code of Conduct Zulip DOI

A two-level approach to prove tautologies using Stålmarck's algorithm in Coq.

Meta

Building and installation instructions

The easiest way to install the latest released version of Stalmarck is via OPAM:

opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq-stalmarck

To instead build and install manually, do:

git clone https://github.com/coq-community/stalmarck.git
cd stalmarck
make   # or make -j <number-of-cores-on-your-machine> 
make install

Documentation

This project is composed of:

  • A Coq proof of correctness of the algorithm, as described in the paper A Formalization of Stålmarck's Algorithm in Coq, published in the proceedings of TPHOLs 2000.
  • an implementation of the algorithm. With respect to the paper, this implementation is completely functional and can be used inside Coq.
  • A reflected Coq tactic staltac that uses the extracted code to compute an execution trace; the trace checker is then called inside Coq.
  • A standalone checker program stalmarck which takes as input a formula in textual format and reports whether it can be certified as a tautology.

See algoRun.v for examples how to use the algorithm inside Coq, and see StalTac_ex.v for examples how to use the reflected tactic.

Tautology Checker

The src directory contains the code for a standalone tautology checker using the implementation of Stålmarck's algorithm extracted from Coq.

Running the checker

stalmarck <level> <file>

where:

  • <level> is an integer controling depth of dilemma. Usual values:
    • 0: does only propagation.
    • 1: dilemma upon one variable at the same time.
    • 2: dilemma can be done upon two variables at the same time; more than 2 may take very long.
  • <file> is the file containing the boolean formula.

Boolean formula syntax

Concept Syntax
Comments // (reading is suspended until the end of the line)
Variable any alphanumeric sequence plus the character _
Not ~
And &
Or #
Implication ->
Equivalence <->
Parentheses ( )
True value <T>
False value <F>

Priority of connectives, from lower to higher:

  • <->, -> (associate to the right)
  • # (associates to the left)
  • & (associates to the left)
  • ~

Output

The only interesting output is Tautology (and exit code 0). The other output is Don't know (and exit code 1): either the formula is not a tautology, or it is one but the program cannot conclude this (insufficient level).

Example

An example file with a tautology (tests/ztwaalf1_be) is included, and can be checked as follows:

stalmarck 1 tests/ztwaalf1_be
Tautology

stalmarck's People

Contributors

herbelin avatar letouzey avatar maximedenes avatar palmskog avatar ppedrot avatar silene avatar skyskimmer avatar zimmi48 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

stalmarck's Issues

Patent warning appears to be obsolete

The README contains a warning about the patented status of the algorithm. As far as I can see, the patents have all now expired.

Specifically, the patents are: Swedish Patent No. 467,076 (approved 1992); U.S. Patent No. 5,276,897 (approved 1994); European Patent No. 403,454 (approved 1995).

Extracted code is checked into version control

The staltac tactic is produced from code in version control that was previously extracted, then manually copied into an OCaml file, and mixed with imperative code. The proper way to do this is to have a project build extract the relevant code every time, and link it with the imperative code to produce the tactic.

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.