File: test17.12.ott

package info (click to toggle)
ott 0.32%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,420 kB
  • sloc: ml: 25,065; makefile: 1,393; awk: 736; lisp: 183; sh: 14; sed: 4
file content (136 lines) | stat: -rw-r--r-- 5,129 bytes parent folder | download | duplicates (4)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
% test17.12.ott  sundry list form test

embed
{{ coq 
(** some concrete labels *)
Definition LA : nat := 1.
Definition LB : nat := 2.
Definition LC : nat := 3.
}}

metavar typevar, X ::=
 {{ isa string }} {{ coq nat }} {{ coq-equality }} {{ hol string }} {{ lex Alphanum }}  
 {{ tex \mathit{[[typevar]]} }} {{ com  type variable  }}  
 {{ isavar ''[[typevar]]'' }} {{ texvar \mathrm{[[typevar]]} }} 

metavar termvar, x ::=
 {{ isa string }} {{ coq nat }} {{ hol string }}  {{ coq-equality }} {{ lex alphanum }}  
 {{ tex \mathit{[[termvar]]} }} {{ com  term variable  }} 
 {{ isavar ''[[termvar]]'' }} {{ texvar \mathrm{[[termvar]]} }} 

metavar label, l, k ::=
 {{ isa string }} {{ coq nat }} {{ hol string }} {{ lex alphanum }}  {{ tex \mathit{[[label]]} }}  {{ isavar ''[[label]]'' }} {{ holvar "[[label]]" }}
 {{ com  field label  }}

indexvar index, i, j, n, m  ::= {{ isa nat }} {{ coq nat }} {{ hol num }} {{ lex numeral }}
  {{ com indices }}


grammar

T {{ hol Typ }}, S, U :: 'T_' ::=                    {{ com type  }}
  | X                                :: :: Var          {{ com type variable }}  
  | { l1 : T1 , .. , ln : Tn }      :: :: Rec           {{ com record }}           
  | [ l0 : T0 , .. , ln-1 : Tn-1 ]      :: :: ZRec           {{ com record }}           
  | int :: :: int
  | bool :: :: bool

t :: 't_' ::=                                                      {{ com  term  }}
  | x                                     :: :: Var                 {{ com variable }}         
%  | { l1 = t1 ,  .. , ln = tn }           :: :: Rec             {{ com record  --- dots }}
%  | { </ li = ti // i /> }                :: :: Rec_comp_none   {{ com record --- comp }}
%  | { </ li = ti // , // i /> }           :: :: Rec_comp_some   {{ com record --- comp with terminal }}
%  | { </ li = ti // i IN n /> }           :: :: Rec_comp_u_none {{ com record --- compu }} 
%  | { </ li = ti // , // i IN n /> }      :: :: Rec_comp_u_some {{ com record --- compu with terminal }} 
%  | { </ li = ti // i IN 1 .. n /> }      :: :: Rec_comp_lu_none{{ com record --- complu }}  
  | { </ li = ti // , // i IN 1 .. n /> } :: :: Rec_comp_lu_some {{ com record --- complu with terminal }}  
  | [ </ li = ti // , // i IN 0 .. n-1 /> ] :: :: ZRec_comp_lu_some {{ com record --- complu with terminal }}  
  | t . l                             :: :: Proj                     {{ com projection }} 
  | true                              :: :: True {{ com True }}
  | false                             :: :: False {{ com False }}

G {{ tex \Gamma }}, D {{ tex \Delta }} :: 'G_' ::= {{ com type environment }}
  | empty                            ::   :: empty       
  | G , X <: T                       ::   :: type        
  | G , x : T                        ::    :: term
%  | G , G'                           :: M :: comma    {{ ich TODO }}
%  | G1 , .. , Gn                     :: M :: dots {{ ich TODO }}


formula :: formula_ ::=          
  | judgement              :: :: judgement
  | formula1 .. formulan   :: :: dots 
%{{ isa (List.list_all (\<lambda> b . b) ( [[ formula1 .. formulan ]] ) ) }}

%formula :: formula_ ::=          
%  | preformula1 .. preformulan   :: :: realdots {{ isa (List.list_all (\<lambda> b . b) ( [[ preformula1 .. preformulan ]] ) ) }}

terminals :: terminals_ ::=
  | |-                     ::   :: turnstile {{ tex \vdash }}
  | <:                     ::   :: subtype   {{ tex <: }}

defns
  Jtype :: '' ::= 

defn
G |- t : T ::  :: Ty :: Ty_  {{ com term $[[t]]$ has type $[[T]]$ }} by 

 G|-t0:T0 .. G|- tn-1 : Tn-1
 ------------------------------------- :: Rcd_dotform
 G|- {l0=t0,..,ln-1=tn-1}:{l0:T0,..,ln-1:Tn-1}
 
 G|- t:{l0:T0,..,ln-1:Tn-1}
 ----------------------- :: Proj_dotform
 G|- t.lj : Tj


 </ G|-ti:Ti //i/>
 -------------------------------------- :: Rcd_comp
 G|- { </li=ti//i/> }:{ </ li:Ti //i/> }

 G|- t: { </ li:Ti // i/> }
 -------------------------------------- :: Proj_comp
 G|- t.lj : Tj

 </ G|-ti:Ti //i IN n/>
 -------------------------------------------------- :: Rcd_comp_u
 G|- { </li=ti//i IN n/> }:{ </ li:Ti //i IN n/> }

 G|- t: { </ li:Ti // i IN n/> }
 -------------------------------------------------- :: Proj_comp_u
 G|- t.lj : Tj

 </ G|-ti:Ti //i IN 0..n-1/>
 ------------------------------------------------------- :: Rcd_comp_lu
 G|- { </li=ti//i IN 0..n-1/> }:{ </ li:Ti //i IN 0..n-1/> }

 G|- t: { </ li:Ti // i IN 0..n-1/> }
 ------------------------------------------------------- :: Proj_comp_lu
 G|- t.lj : Tj


 G |- x : { l_0:T_0 ,.., l_n-1:T_n-1 }
 --------------- :: foo
 G |- x : { li0:Ti0 ,.., lin-1:Tin-1 }


defn
|- T ::  :: Tyfoo :: Tyfoo_ by 

|- { } 
|- { LA:int }
|- { LA:int, LB:bool }
|- { LA:int, LB:bool, LC : bool }
|- { l1:T1,..,lm:Tm }
|- { l:T , l1:T1,..,lm:Tm }
|- { l1:T1,..,lm:Tm, l:T }
|- { l1:T1,..,lm:Tm,l:T,l1':T1',..,ln':Tn' }
--------------------------------------------- :: 1
 |- int

|- { </ li:Ti // i IN 1..m /> }
|- { l:T , </ li:Ti // i IN 1..m /> }
|- { </ li:Ti // i IN 1..m /> , l:T }
|- { </ li:Ti // i IN 1..m /> ,l:T, </ l'j:T'j // j IN 1..n /> }
-------------------------------- :: 2
|- int