Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Beautiful, interactive visualizations of logical inference

branch: master

Fix some bugs and refactor some common code.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
latest commit 35fc5ac64e
Edward Z. Yang authored December 20, 2012
Octocat-spinner-32 doc Writeup. May 16, 2012
Octocat-spinner-32 .gitignore
Octocat-spinner-32 ClassicalFOL.hs
Octocat-spinner-32 ClassicalFOL.v
Octocat-spinner-32 ClassicalFOLFFI.hs
Octocat-spinner-32 Common.hs
Octocat-spinner-32 CommonFFI.hs Linear checkpoint. September 16, 2012
Octocat-spinner-32 Coq.hs Turn on warnings. May 21, 2012
Octocat-spinner-32 CoqTop.hs
Octocat-spinner-32 Intuitionistic.hs
Octocat-spinner-32 IntuitionisticFFI.hs
Octocat-spinner-32 IntuitionisticFOL.v Intuitionistic first order logic yo. February 24, 2012
Octocat-spinner-32 JSONGeneric.hs
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Linear.hs Fix some bugs and refactor some common code. December 20, 2012
Octocat-spinner-32 LinearFFI.hs
Octocat-spinner-32 Ltac.hs
Octocat-spinner-32 README
Octocat-spinner-32 Setup.hs Add cabal file for easy library version checking. April 29, 2012
Octocat-spinner-32 TODO Turn off checkState due to lack of alpha-equivalence support. May 17, 2012
Octocat-spinner-32 build.sh Fix some bugs and refactor some common code. December 20, 2012
Octocat-spinner-32 common.ur Fix some bugs and refactor some common code. December 20, 2012
Octocat-spinner-32 ffi.js Convert to using activate. July 23, 2012
Octocat-spinner-32 haskell.c Lots of stuff for intuitionistic. September 17, 2012
Octocat-spinner-32 haskell.h
Octocat-spinner-32 haskell.urp
Octocat-spinner-32 haskell.urs Lots of stuff for intuitionistic. September 17, 2012
Octocat-spinner-32 intuitionistic.ur
Octocat-spinner-32 intuitionistic.urp G4ip intuitionistic implementation. October 01, 2012
Octocat-spinner-32 intuitionistic.urs Lots of stuff for intuitionistic. September 17, 2012
Octocat-spinner-32 jquery-ui.js
Octocat-spinner-32 jquery.infinitedrag.js
Octocat-spinner-32 jquery.js JavaScript libraries. March 13, 2012
Octocat-spinner-32 jquery.tipsy.js
Octocat-spinner-32 js.urp Convert to using activate. July 23, 2012
Octocat-spinner-32 js.urs Convert to using activate. July 23, 2012
Octocat-spinner-32 linear.ur
Octocat-spinner-32 linear.urp
Octocat-spinner-32 linear.urs
Octocat-spinner-32 logitext.cabal
Octocat-spinner-32 logitext.ur Fix some bugs and refactor some common code. December 20, 2012
Octocat-spinner-32 logitext.urp Hook up intuitionistic and ordinary together. September 17, 2012
Octocat-spinner-32 logitext.urs
Octocat-spinner-32 style.css
Octocat-spinner-32 style.ur Hook up intuitionistic and ordinary together. September 17, 2012
Octocat-spinner-32 style.urp
Octocat-spinner-32 tc.sh
Octocat-spinner-32 tipsy.css
README
Install
-------

1) Get a copy of Coq with PGIP support

    git clone https://github.com/ezyang/coq
    # build Coq using the standard methods

You need to tell Logitext about where this Coq lives.
The easiest way is to create a file named config in the
Logitext directory that sets the PATH to the bin directory of
the built Coq, e.g.

    echo 'export PATH=$HOME/coq/bin:$PATH' > config

(Note: We use the -boot option to run Coq; this makes installation
easier but requires you to keep the build directory around.  If
you really want to 'make install' your copy of Coq, you'll need
to edit CoqTop.hs to remove the -boot flag, or make a coqtop wrapper
executable that strips the -boot flag.)

Test this setup by running the following commands:

    . config
    coqtop -v    # should have build date equal to current date
    coqtop -boot # should put you into repl

2) Get the Ur metaprogramming library

    hg clone http://hg.impredicative.com/meta/

Place this as a subdirectory of the logitext folder, and it will
automatically get picked up.

3) Get the Ur/Web compiler

    hg clone http://hg.impredicative.com/urweb
    # build Ur/Web using the standard method

You have a few options for setting up Ur/Web.  If you can install
it globally on the system, you need no further changes.

Alternatively, you can configure an alternate --prefix for Ur/Web, and
then add the Ur/Web in that location to your PATH.  (The build.sh script
references 'config', so you can place it there.) You'll also need to add
the include directory to C_INCLUDE_PATH, as we use the C FFI, which
needs a fully qualified header name (GHC will need this too).

Another convenient option is to just set URWEB_FLAGS="-boot",
and don't bother installing into an alternate prefix.  You'll
still need to modify PATH and C_INCLUDE_PATH, but you can directly
point them at the build directory.

4) Prepare GHC and Haskell

Any widely available distribution should do; the author personally
is using 7.4.1 with the Haskell Platform.  Run

    cabal configure

in order to find out what libraries you need, and install them.
We don't use cabal to build the Haskell products though, because
we need to use GHC to link Ur/Web and Haskell code together.

5) Build it!

You'll need a Linux system with inotify to use the normal scripts. Run

    ./build.sh

which sets up a continuous rebuilding server, and automatically starts
up with the normal parameters.  Tweak the script for your own needs
as necessary.  You can also run

    ./tc.sh

to get continuous typechecking on the Ur/Web files.

6) Serve static files

Ur/Web doesn't support serving static files natively, so you will need
to have another running web server to serve the external JavaScript and
CSS files.  By default they are expected to be at the URL
http://localhost/logitext/ but you can change this by editing
js.urp, logitext.urp, and logitext.ur (be sure to change the <link>
href, the script directives and the allow url directives).

Troubleshooting
---------------

    Database connection initialized.
    Starting up coqtop...
    Ready coqtop
    fd:9: commitBuffer: resource vanished (Broken pipe)

This means you are not using a version of Coq which understands the -pgip flag.

    In file included from /tmp/fileMvYC8r/webapp.c:7:0:
    /home/ezyang/Dev/logitext/haskell.h:1:25: fatal error: urweb/urweb.h: No such file or directory

You have not set your C_INCLUDE_PATH correctly.

    unhandled exception: Io: openIn "/usr/local/lib/urweb/ur/char.ur" failed with SysErr: No such file or directory [noent]

You forgot to pass the -boot flag to Ur/Web using URWEB_FLAGS.
Something went wrong with that request. Please try again.