(* Title: ZF/Induct/Comb.thy Author: Lawrence C Paulson Copyright 1994 University of Cambridge
*)
section \<open>Combinatory Logic example: the Church-Rosser Theorem\<close>
theory Comb imports ZF begin
text\<open>
Curiously, combinators do not include free variables.
Example taken from\<^cite>\<open>camilleri92\<close>. \<close>
subsection \<open>Definitions\<close>
text\<open>Datatype definition of combinators \<open>S\<close> and \<open>K\<close>.\<close>
consts comb :: i datatype comb =
K
| S
| app ("p \ comb", "q \ comb") (infixl \\\ 90)
text\<open> Inductivedefinition of contractions, \<open>\<rightarrow>\<^sup>1\<close> and
(multi-step) reductions, \<open>\<rightarrow>\<close>. \<close>
subsection \<open>Results about Contraction\<close>
text\<open> For type checking: replaces \<^term>\<open>a \<rightarrow>\<^sup>1 b\<close> by \<open>a, b \<in>
comb\<close>. \<close>
lemmas contract_combE2 = contract.dom_subset [THEN subsetD, THEN SigmaE2] and contract_combD1 = contract.dom_subset [THEN subsetD, THEN SigmaD1] and contract_combD2 = contract.dom_subset [THEN subsetD, THEN SigmaD2]
subsection \<open>Results about Parallel Contraction\<close>
text\<open>For type checking: replaces \<open>a \<Rrightarrow>\<^sup>1 b\<close> by \<open>a, b \<in> comb\<close>\<close> lemmas parcontract_combE2 = parcontract.dom_subset [THEN subsetD, THEN SigmaE2] and parcontract_combD1 = parcontract.dom_subset [THEN subsetD, THEN SigmaD1] and parcontract_combD2 = parcontract.dom_subset [THEN subsetD, THEN SigmaD2]
text\<open>Derive a case for each combinator constructor.\<close> inductive_cases
K_parcontractE [elim!]: "K \\<^sup>1 r" and S_parcontractE [elim!]: "S \\<^sup>1 r" and Ap_parcontractE [elim!]: "p\q \\<^sup>1 r"
declare parcontract.intros [intro]
subsection \<open>Basic properties of parallel contraction\<close>
lemma K1_parcontractD [dest!]: "K\p \\<^sup>1 r \ (\p'. r = K\p' \ p \\<^sup>1 p')" by auto
lemma S1_parcontractD [dest!]: "S\p \\<^sup>1 r \ (\p'. r = S\p' \ p \\<^sup>1 p')" by auto
lemma S2_parcontractD [dest!]: "S\p\q \\<^sup>1 r \ (\p' q'. r = S\p'\q' \ p \\<^sup>1 p' \ q \\<^sup>1 q')" by auto
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.