equal
deleted
inserted
replaced
14 *} |
14 *} |
15 |
15 |
16 |
16 |
17 subsection {* Terms in normal form *} |
17 subsection {* Terms in normal form *} |
18 |
18 |
19 constdefs |
19 definition |
20 listall :: "('a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> bool" |
20 listall :: "('a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> bool" |
21 "listall P xs \<equiv> (\<forall>i. i < length xs \<longrightarrow> P (xs ! i))" |
21 "listall P xs == (\<forall>i. i < length xs \<longrightarrow> P (xs ! i))" |
22 |
22 |
23 declare listall_def [extraction_expand] |
23 declare listall_def [extraction_expand] |
24 |
24 |
25 theorem listall_nil: "listall P []" |
25 theorem listall_nil: "listall P []" |
26 by (simp add: listall_def) |
26 by (simp add: listall_def) |
359 |
359 |
360 |
360 |
361 consts -- {* A computationally relevant copy of @{term "e \<turnstile> t : T"} *} |
361 consts -- {* A computationally relevant copy of @{term "e \<turnstile> t : T"} *} |
362 rtyping :: "((nat \<Rightarrow> type) \<times> dB \<times> type) set" |
362 rtyping :: "((nat \<Rightarrow> type) \<times> dB \<times> type) set" |
363 |
363 |
364 syntax |
364 abbreviation (output) |
365 "_rtyping" :: "(nat \<Rightarrow> type) \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool" ("_ |-\<^sub>R _ : _" [50, 50, 50] 50) |
365 rtyping_rel :: "(nat \<Rightarrow> type) \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool" ("_ |-\<^sub>R _ : _" [50, 50, 50] 50) |
|
366 "(e |-\<^sub>R t : T) = ((e, t, T) \<in> rtyping)" |
366 syntax (xsymbols) |
367 syntax (xsymbols) |
367 "_rtyping" :: "(nat \<Rightarrow> type) \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool" ("_ \<turnstile>\<^sub>R _ : _" [50, 50, 50] 50) |
368 rtyping_rel :: "(nat \<Rightarrow> type) \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool" ("_ \<turnstile>\<^sub>R _ : _" [50, 50, 50] 50) |
368 translations |
|
369 "e \<turnstile>\<^sub>R t : T" \<rightleftharpoons> "(e, t, T) \<in> rtyping" |
|
370 |
369 |
371 inductive rtyping |
370 inductive rtyping |
372 intros |
371 intros |
373 Var: "e x = T \<Longrightarrow> e \<turnstile>\<^sub>R Var x : T" |
372 Var: "e x = T \<Longrightarrow> e \<turnstile>\<^sub>R Var x : T" |
374 Abs: "e\<langle>0:T\<rangle> \<turnstile>\<^sub>R t : U \<Longrightarrow> e \<turnstile>\<^sub>R Abs t : (T \<Rightarrow> U)" |
373 Abs: "e\<langle>0:T\<rangle> \<turnstile>\<^sub>R t : U \<Longrightarrow> e \<turnstile>\<^sub>R Abs t : (T \<Rightarrow> U)" |