From 4536333e33d838c40f7041bf6737d63328b32160 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 3 Jul 2015 13:11:30 +0200 Subject: Nicer truthtables --- Logic.dcl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Logic.dcl') diff --git a/Logic.dcl b/Logic.dcl index 90d579b..bf76859 100644 --- a/Logic.dcl +++ b/Logic.dcl @@ -40,6 +40,14 @@ isEquiv :: Expr -> Bool instance toString Op1 instance toString Op2 instance toString Expr +instance toString TruthTable + +instance == Op1 +instance < Op1 +instance == Op2 +instance < Op2 +instance == Expr +instance < Expr // To sort by unrigorous 'complexity'; e.g. in truthtables binds_stronger :: Op2 Op2 -> Bool // True iff arg1 stronger binds than arg2 @@ -50,5 +58,7 @@ substitute :: AtomOption Expr -> Expr // Substitute all atomic expressions substitute_all :: [AtomOption] Expr -> Expr // Same, for multiple options eval :: Expr -> [Bool] // Evaluate to a simpler form -instance toString TruthTable +subexprs :: Expr -> [Expr] // Subexpressions of an expression +sorted_subexprs :: (Expr -> [Expr]) // Similar, but roughly sorted by complexity +truthtable :: Expr -> TruthTable // Truthtable from an expression -- cgit v1.2.3