diff options
author | Camil Staps | 2015-07-03 23:39:40 +0200 |
---|---|---|
committer | Camil Staps | 2015-07-03 23:41:02 +0200 |
commit | f0ed4df2b0e11ab66966a8395cd7d6d29c7a8efc (patch) | |
tree | ecdfbd232e1710f67c233c3e4281560f0344a10c /Logic.dcl | |
parent | Installation (diff) |
Latex & Html output options
Diffstat (limited to 'Logic.dcl')
-rw-r--r-- | Logic.dcl | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -23,7 +23,7 @@ */ definition module Logic -import StdEnv +import StdEnv, StdMaybe // Expressions :: Expr = B Bool // A constant @@ -47,6 +47,19 @@ import StdEnv :: AtomOption :== (AtomName,Bool) :: TruthTable = {exprs :: [Expr], options :: [[AtomOption]]} +:: FilledTruthTable = {table :: TruthTable, values :: [[Maybe Bool]]} + +:: OutputOption = Plain | Html | LaTeX +DefaultOutputOption :== Plain +instance == OutputOption + +class show a :: OutputOption a -> String +instance show Bool +instance show Char +instance show Op1 +instance show Op2 +instance show Expr +instance show FilledTruthTable isBool :: Expr -> Bool isAtom :: Expr -> Bool @@ -60,11 +73,6 @@ isOr :: Expr -> Bool isImpl :: Expr -> Bool isEquiv :: Expr -> Bool -instance toString Op1 -instance toString Op2 -instance toString Expr -instance toString TruthTable - instance == Op1 instance < Op1 // Maybe useful later if more unary operators are added instance == Op2 @@ -87,6 +95,9 @@ sorted_subexprs :: (Expr -> [Expr]) // Similar, but roughly sorted by co simple_truthtable :: Expr -> TruthTable // Simple truthtable: only the atomic expression and the expression itself simple_truthtable_n :: [Expr] -> TruthTable // Simple truthtable with multiple expressions truthtable :: Expr -> TruthTable // Truthtable from an expression +truthtable_n :: [Expr] -> TruthTable // Truthtable with multiple expressions + +compute :: TruthTable -> FilledTruthTable // Fill in a truthtable parse :: String -> Expr // Parse a string into an expression |