FCo.txt 1.03 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
namespace TermVar: Term, Type
namespace TypeVar: Type

sort Term
    inh ctx  TermVar
    inh tctx TypeVar
    | TmVar (x@ctx)
    | TmAbs (x: Term) (t: Type) [z: TermVar]
        x.ctx = lhs.ctx, z
    | TmApp (t1: Term) (t2: Term)
    | TmTApp (t1: Term) (t: Type)
    | TmTAbs (t1: Term) [t: TypeVar]
        t1.ctx = lhs.ctx
        t1.tctx = lhs.tctx, t
    | TmTop
    | TmTuple (e1: Term) (e2: Term)
    | TmInt {Int}
    | TmCast (co: Coercion) (e: Term)

sort Type
    inh tyctx TypeVar
    | TyVar (t@tyctx)
    | TyArr (t1: Type) (t2: Type)
    | TyAll (t1: Type) [t: TypeVar]
        t1.tyctx = lhs.tyctx, t
    | TyInt
    | TyTop
    | TyProd (t1: Type) (t2: Type)

sort Coercion
    inh tycoctx TypeVar
    | CoId
    | CoTrans (co1: Coercion) (co2: Coercion)
    | CoTop (ty: Type)
    | CoBot (ty: Type)
    | CoArrow (co1: Coercion) (co2: Coercion)
    | CoTuple (co1: Coercion) (co2: Coercion)
    | CoProj1 (ty2: Type)
    | CoProj2 (ty1: Type)
    | CoAll (co1: Coercion)
    | CoDistArrow
    | CoTopArrow
    | CoTopAll
    | CoDistAll