summaryrefslogtreecommitdiff
path: root/old-examples/math/MathAgd.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
commite9e80fc389365e24d4300d7d5390c7d833a96c50 (patch)
treef0b58473adaa670bd8fc52ada419d8cad470ee03 /old-examples/math/MathAgd.gf
parentb96b36f43de3e2f8b58d5f539daa6f6d47f25870 (diff)
changed names of resource-1.3; added a note on homepage on release
Diffstat (limited to 'old-examples/math/MathAgd.gf')
-rw-r--r--old-examples/math/MathAgd.gf53
1 files changed, 53 insertions, 0 deletions
diff --git a/old-examples/math/MathAgd.gf b/old-examples/math/MathAgd.gf
new file mode 100644
index 000000000..9b723c26e
--- /dev/null
+++ b/old-examples/math/MathAgd.gf
@@ -0,0 +1,53 @@
+--# -path=.:prelude
+
+concrete MathAgd of Mathw = open Prelude in {
+
+flags lexer = codelit ; unlexer = codelit ;
+
+-- lincat Section ; Context ; Typ ;
+ lincat Obj, Prop = {s,name : Str} ;
+-- Proof ; Var ;
+
+lin
+ SDefObj cont obj typ df =
+ ss (obj.name ++ "::" ++ cont.s ++ typ.s ++
+ "=" ++ df.s ++ ";") ;
+ SDefProp cont prop df =
+ ss (prop.name ++ "::" ++ cont.s ++ "Prop" ++
+ "=" ++ df.s ++ ";") ;
+ SAxiom cont prop =
+ ss ("ax" ++ "::" ++ cont.s ++ prop.s ++ ";") ;
+ STheorem cont prop proof =
+ ss ("thm" ++ "::" ++ cont.s ++ prop.s ++
+ "=" ++ proof.s ++ ";") ;
+
+ CEmpty = ss [] ;
+ CObj vr typ co = ss ("(" ++ vr.s ++ "::" ++ typ.s ++ ")" ++ co.s) ;
+ CProp prop co = ss ("(" ++ "_" ++ "::" ++ prop.s ++ ")" ++ co.s) ;
+
+ OVar v = obj v.s [] ;
+
+ V_x = ss "x" ;
+ V_y = ss "y" ;
+ V_z = ss "z" ;
+
+oper
+ obj : Str -> Str -> {s,name : Str} = \f,xs -> {
+ s = f ++ xs ;
+ name = f
+ } ;
+
+-- lexicon
+lin
+ Set = ss "set" ;
+ Nat = ss ["Nat"] ;
+ Zero = obj "Zero" [] ;
+ Succ x = obj "Succ" x.s ;
+ One = obj "one" [] ;
+ Two = obj "two" [] ;
+ Even x = obj "Even" x.s ;
+ Odd x = obj "Odd" x.s ;
+ Prime x = obj "Prime" x.s ;
+ Divisible x y = obj "Div" (x.s ++ y.s) ;
+
+}