~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to benchmark/Syntacticosmos/UntypedLambda.agda

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-08-05 06:38:12 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140805063812-io8e77niomivhd49
Tags: 2.4.0.2-1
* [6e140ac] Imported Upstream version 2.4.0.2
* [2049fc8] Update Build-Depends to match control
* [93dc4d4] Install the new primitives
* [e48f40f] Fix typo dev→doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
module UntypedLambda where
2
 
 
3
 
open import Basics
4
 
open import Pr
5
 
open import Nom
6
 
import Syntacticosmos
7
 
 
8
 
data Tag : Set where
9
 
  lamT : Tag
10
 
  appT : Tag
11
 
 
12
 
open module ULam = Syntacticosmos TT TT (\_ -> Tag)
13
 
 
14
 
LAM : Kind
15
 
LAM = Ty _
16
 
 
17
 
SigLAM : Kind
18
 
SigLAM = Pi _ conk where
19
 
  conk : Tag -> Kind
20
 
  conk lamT = (LAM |> LAM) |> LAM
21
 
  conk appT = LAM |> LAM |> LAM
22
 
 
23
 
Lam : Cxt -> Set
24
 
Lam G = G [! SigLAM !]- LAM
25
 
 
26
 
lam : {G : Cxt}(x : Nom){Gx : [| G Hasn't x |]} ->
27
 
      Lam ((G [ x - LAM ]) {Gx}) -> Lam G
28
 
lam x {Gx} b = G[ lamT G^ G\\ (bind x {Gx} b) G& Gnil ]
29
 
 
30
 
app : {G : Cxt} -> Lam G -> Lam G -> Lam G
31
 
app f s = G[ appT G^ f G& s G& Gnil ]
32
 
 
33
 
moo : Lam EC
34
 
moo = lam Ze (lam (Su Ze) (var Ze))
35
 
 
36
 
noo : Lam EC
37
 
noo = lam (Su Ze) (lam Ze (var (Su Ze)))
38
 
 
39
 
coo : Id moo noo
40
 
coo = refl
41
 
 
42
 
 
43