From 537bb5e2bae76e0df0d9e07a40dbe6b299be6aad Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 3 Jul 2015 12:43:24 +0200 Subject: Truth tables --- Logic.dcl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Logic.dcl') diff --git a/Logic.dcl b/Logic.dcl index 46228dc..90d579b 100644 --- a/Logic.dcl +++ b/Logic.dcl @@ -20,6 +20,11 @@ import StdEnv // All Chars may be used, but typically only [a-zA-Z] are used :: AtomName :== Char +// Possibility for an atom to be true or false +:: AtomOption :== (AtomName,Bool) + +:: TruthTable = {exprs :: [Expr], options :: [[AtomOption]]} + isBool :: Expr -> Bool isAtom :: Expr -> Bool isApp1 :: Expr -> Bool @@ -38,3 +43,12 @@ instance toString Expr binds_stronger :: Op2 Op2 -> Bool // True iff arg1 stronger binds than arg2 +all_atoms :: Expr -> [AtomName] // All the atomic expressions in an expressions +all_atom_options :: Expr -> [[AtomOption]] // All AtomOptions for all atomic expressions in an expression + +substitute :: AtomOption Expr -> Expr // Substitute all atomic expressions with some name with some constant +substitute_all :: [AtomOption] Expr -> Expr // Same, for multiple options +eval :: Expr -> [Bool] // Evaluate to a simpler form + +instance toString TruthTable + -- cgit v1.2.3