From 8141816bccdc173b8318ba9eb80043bec2d644b3 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 3 Jul 2015 16:54:12 +0200 Subject: Parser; cleanup --- Logic.dcl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Logic.dcl') diff --git a/Logic.dcl b/Logic.dcl index b6f3705..7e50822 100644 --- a/Logic.dcl +++ b/Logic.dcl @@ -65,12 +65,12 @@ instance toString Op2 instance toString Expr instance toString TruthTable -instance == Op1 -instance < Op1 +instance == Op1 +instance < Op1 // Maybe useful later if more unary operators are added instance == Op2 -instance < Op2 +instance < Op2 // To sort by precedence instance == Expr -instance < Expr // To sort by unrigorous 'complexity'; e.g. in truthtables +instance < Expr // To sort by unrigorous 'complexity'; e.g. in truthtables binds_stronger :: Op2 Op2 -> Bool // True iff arg1 stronger binds than arg2 @@ -87,3 +87,5 @@ sorted_subexprs :: (Expr -> [Expr]) // Similar, but roughly sorted by co simple_truthtable :: Expr -> TruthTable // Simple truthtable: only the atomic expression and the expression itself truthtable :: Expr -> TruthTable // Truthtable from an expression +parse :: String -> Expr // Parse a string into an expression + -- cgit v1.2.3