forked from GitHub/gf-core
tutorial example of LF
This commit is contained in:
@@ -1876,15 +1876,19 @@ In a logical framework, the formalization of a mathematical theory
|
|||||||
is a set of type and function declarations. The following is an example
|
is a set of type and function declarations. The following is an example
|
||||||
of such a theory, represented as an ``abstract`` module in GF.
|
of such a theory, represented as an ``abstract`` module in GF.
|
||||||
```
|
```
|
||||||
abstract Geometry = {
|
abstract Arithm = {
|
||||||
cat
|
cat
|
||||||
Line ; Point ; Circle ; -- basic types of figures
|
Prop ; -- proposition
|
||||||
Prop ; -- proposition
|
Nat ; -- natural number
|
||||||
fun
|
fun
|
||||||
Parallel : Line -> Line -> Prop ; -- x is parallel to y
|
Zero : Nat ; -- 0
|
||||||
Centre : Circle -> Point ; -- the centre of c
|
Succ : Nat -> Nat ; -- successor of x
|
||||||
|
Even : Nat -> Prop ; -- x is even
|
||||||
|
And : Prop -> Prop -> Prop ; -- A and B
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
A concrete syntax is given below, as an example of using the resource grammar
|
||||||
|
library.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user