PropLogic.exe
for Windows users
PropLogic
is a Haskell package for propositional logic.
There are several ways to use it:
Run the standalone program from the command line.
For example (if $
denotes your default prompt)
$ PropLogic spcnf "[[a * b] -> b]" true
which means that you asked for the "Simplified Prime Conjunctive Normal Form" of the formula [[a * b] -> b]
and the result was true
.
Load PropLogic
in an interpreter session.
For example, if ghci
(or hugs
) is started (and >
denotes the prompt in the session)
> spcnf "[[a * b] -> b]" trueFor more details see the tutorial IntroToPropLogic.html.
As a Haskell programmer, you can import PropLogic
as a toolbox for your own programs.
The standalone program (1) can be used without any knowledge of Haskell. If you work on a Windows machine, you can even run this executable without any Haskell system on it (see PropLogic.exe for Windows users below).
PropLogic
also works with
Hugs (when started with C
PropLogic
is not uploaded, yet.)
Download the tarball
PropLogic-0.9.tar.gz
into some directory. Now unpack this tarball. On a Unix-like machine, you can use
tar -xvf PropLogic-0.9.tar.gz
Windows users can use an alternative unzip program.
This creates a new subsubdirectory with the Haskell modulues, i.e. the *.hs
files.
Make this your working directory with
cd PropLogic-0.9
Now subsequently run (try in super-user mode if it refuses)
runghc Setup.lhs configure --ghc
runghc Setup.lhs build
runghc Setup.lhs install
PropLogic
is now available for interpreter sessions and import into other programs.
PropLogic
. You could run
ghc --make -o PropLogic Main.hsto generate the executable program file in the current directory. But I am not sure, if there isn't a better way that makes the program available globally.)
The previously described full installations integrate the package into your Haskell system. But you can also do everything in a (new) local directory and delete that afterwards without leaving any traces. Start with a download of
PropLogic-0.9.tar.gz
into a local directory. Extract the tarball, e.g. with
tar -xvf PropLogic-0.9.tar.gz
Make the newly created directory PropLogic-0.9
your working directory with
cd PropLogic-0.9
For a session with the GHC interpreter, call
ghci
The prompt (probably Prelude>
) will invite you for the next input. You can now load all the PropLogic
modules with
Prelude> :load PropLogic.hs ... Ok, modules loaded: ... PropLogic>
If everything went as intended, an ...Ok, modules loaded:...
message appeared and the subsequent new prompt PropLogic>
is telling us that we have now everything ready for use and that the interpreter awaits the next input.
To generate the executable program, run
ghc --make -o PropLogic Main.hs
The new executable file PropLogic
appears in the working directory and can be called, e.g. with the help
option
./PropLogic help
PropLogic.exe
for Windows usersOn a Windows machine you can just download the single file
PropLogic.exe
into an appropriate directory, say
C:\newdir
You can then just run it from there. Just type PropLogic help
, i.e.
C:\newdir> PropLogic helpThat should answer you with a display of the program options. The tutorial A little program for propositional logic further explains how to continue from there.