summaryrefslogtreecommitdiff
path: root/examples/math/MathEnz.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-30 13:09:46 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-30 13:09:46 +0000
commit565bd853299f8eec69326fd4a59dff8f7488fe61 (patch)
tree29fa03753bf682a05be11c3509a8fca9fa761aa0 /examples/math/MathEnz.gf
parentaf54ec7e452cc600dd3d7ddc58670ffe50827631 (diff)
math wiki example
Diffstat (limited to 'examples/math/MathEnz.gf')
-rw-r--r--examples/math/MathEnz.gf43
1 files changed, 43 insertions, 0 deletions
diff --git a/examples/math/MathEnz.gf b/examples/math/MathEnz.gf
new file mode 100644
index 000000000..b362040c2
--- /dev/null
+++ b/examples/math/MathEnz.gf
@@ -0,0 +1,43 @@
+--# -path=.:prelude
+
+concrete MathEnz of Math = open Prelude in {
+
+flags lexer = textlit ; unlexer = textlit ;
+
+-- lincat Section ; Label ; Context ; Typ ; Obj ; Prop ; Proof ; Var ;
+
+lin
+ SDefObj lab cont obj typ df =
+ ss ("Definition" ++ lab.s ++ "." ++ cont.s ++
+ obj.s ++ "is" ++ "a" ++ typ.s ++ "," ++ "defined" ++ "as" ++ df.s ++ ".") ;
+ SDefProp lab cont prop df =
+ ss ("Definition" ++ lab.s ++ "." ++ cont.s ++ "we" ++ "say" ++
+ "that" ++ prop.s ++ "to" ++ "mean" ++ "that" ++ df.s ++ ".") ;
+ SAxiom lab cont prop =
+ ss ("Axiom" ++ lab.s ++ "." ++ cont.s ++ prop.s ++ ".") ;
+ STheorem lab cont prop proof =
+ ss ("Theorem" ++ lab.s ++ "." ++ cont.s ++ prop.s ++ "." ++ proof.s ++ ".") ;
+
+ CEmpty = ss [] ;
+ CObj vr typ co = ss ("let" ++ vr.s ++ "be" ++ "a" ++ typ.s ++ "." ++ co.s) ;
+ CProp prop co = ss ("assume" ++ prop.s ++ "." ++ co.s) ;
+
+ OVar v = v ;
+ LNone = ss [] ;
+ LString s = s ;
+ VString s = s ;
+
+-- lexicon
+
+ Set = ss "set" ;
+ Nat = ss ["natural number"] ;
+ Zero = ss "zero" ;
+ Succ = prefixSS ["the successor of"] ;
+ One = ss "one" ;
+ Two = ss "two" ;
+ Even = postfixSS ["is even"] ;
+ Odd = postfixSS ["is odd"] ;
+ Prime = postfixSS ["is prime"] ;
+ Divisible = infixSS ["is divisible by"] ;
+
+}