summaryrefslogtreecommitdiff
path: root/writetest.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-09-14 10:19:55 +1000
committerJed Barber <jjbarber@y7mail.com>2012-09-14 10:19:55 +1000
commitc7d3f7662fb9c7bb86ab1270e9f74de6d08876fa (patch)
tree8b4e8c7c26d36cc8ac3709daec3faed231ced5dd /writetest.hs
parentbd9772daf2fe36de53fdc358ba3bb52bc416d562 (diff)
Misc test files
Diffstat (limited to 'writetest.hs')
-rw-r--r--writetest.hs43
1 files changed, 43 insertions, 0 deletions
diff --git a/writetest.hs b/writetest.hs
new file mode 100644
index 0000000..81df3d7
--- /dev/null
+++ b/writetest.hs
@@ -0,0 +1,43 @@
+import Library.WriteProof
+import Library.ProofGraph
+
+
+list = [-- create a var term, define a constant to it
+ "\"const\"","\"x\"","const","\"t1\"","typeOp","nil","opType","1","def","constTerm","0","def","defineConst",
+
+ -- hypothesis list for theorem
+ "nil",
+
+ -- equals name
+ "\"=\"","const",
+
+ -- equals type
+ "\"->\"","typeOp","1","ref","\"->\"","typeOp","1","ref","\"bool\"","typeOp","nil","opType","nil","cons","cons","opType",
+ "nil","cons","cons","opType",
+
+ -- equals term
+ "constTerm",
+
+ -- the constant
+ "\"const\"","const","1","remove","constTerm",
+
+ -- construct the equation of constant = variable
+ "appTerm",
+ "0","remove",
+ "appTerm",
+
+ "thm","pop"]
+
+graph = doGraphGen list
+
+fst3 :: (a,b,c) -> a
+fst3 (a,_,_) = a
+
+snd3 :: (a,b,c) -> b
+snd3 (_,b,_) = b
+
+thd3 :: (a,b,c) -> c
+thd3 (_,_,c) = c
+
+edgeCheck :: (Ord d) => (a,b,(c,d)) -> (e,f,(g,d)) -> Ordering
+edgeCheck = (\a b -> compare (snd . thd3 $ a) (snd . thd3 $ b))