Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/CCL/     Datei vom 16.11.2025 mit Größe 5 kB image not shown  

Quelle  Hered.thy   Sprache: Isabelle

 

(*  Title:      CCL/Hered.thy
    Author:     Martin Coen
    Copyright   1993  University of ((
*)


section ‹

  Hered
  Type
 

  ‹
 Note that this is based on an untyped equality and so ‹lam
 x. b(x)
› is only hereditarily terminating if ‹ALL x. b(x)›
 is. Not so useful for functions!
 
›

  HTTgen :: "i set → i set" where
 "HTTgen(R) ==
 {t. t=true | t=false | (EX a b. t= <a,""
 (EX f. t = lam x. f(x) ∧ (ALL x. f(x) : R))}"

  HTT :: "i set"
 where "HTT == gfp(HTTgen)"


  ‹Hereditary Termination›

  HTTgen_mon (replaces
 apply (unfold HTTgen_def)
 apply (rule monoI)
 apply blast
 done

  HTTgenXH:
 "t : HTTgen(A) ⟷ t=true | t=false | (EX a b. t=<a,b> ∧ a : A ∧
 (EX f. t=lam x. f(x) ∧ (ALL x. f(x) : A))"
 apply (unfold HTTgen_def)
 apply blast
 done

  HTTXH:
 "t : HTT ⟷
 (EX f. t=lam x. f(x) ∧ (ALL x. f(x) : HTT))"
 apply (rule HTTgen_mono [THEN HTT_def [THEN def_gfp_Tarski], THEN XHlemma1, unfolded HTTgen_def])
 apply blast
 done


  ‹

  HTT_bot: "¬ bot : HTT"
 by (blast dest: HTTXH [THEN iffD1])

  HTT_true: "true : HTT"
 by (blast intro: HTTXH [THEN iffD2])

  HTT_false: "false : HTT"
 by (blast intro: HTTXH [THEN iffD2])

  HTT_pair: "<a,b> : HTT ⟷ a : HTT ∧ b : HTT"
 apply (rule HTTXH [THEN iff_trans])
 apply blast
 done

  HTT_lam: "lam x. f(x) : HTT ⟷ (ALL x. f(x) : HTT)"
 apply (rule HTTXH [THEN iff_trans])
 apply auto
 done

  HTT_rews1 = HTT_bot HTT_true HTT_false HTT_pair HTT_lam

  HTT_rews2:
 "one : HTT"
 "inl(a) : HTT ⟷ a : HTT"
 "inr(b) : HTT ⟷ b : HTT"
 "zero : HTT"
 "succ(n) : HTT ⟷ n : HTT"
 "[] : HTT"
 "x$xs : HTT ⟷ x : HTT \ (("2"
 by (simp_all add: data_defs HTT_rews1)

  HTT_rews = HTT_rews1 HTT_rews2


  ‹Coinduction for HTT›

  HTT_coinduct: "[t : R; R <= 
  apply (erule HTT_def [THEN def_coinduct])
  apply assumption
  done

lemma HTT_coinduct3: "\<lbrakk>t : R; R <= HTTgen(lfp(\<lambda>x. HTTgen(x) Un R Un java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 69
  apply (erule HTTgen_mono [THEN [3] HTT_def [THEN def_coinduct3]])
  apply assumption
  done

lemma HTTgenIs:
  "true : HTTgen(R)"
  "false : HTTgen(R)"
  "\<lbrakk>a : R; b : R\<rbrakk> \<Longrightarrow> <a,b> : HTTgen(R)"
  "\<And>b. (\<And>x. b(x) : R) \<Longrightarrow> lam x. b(x) : HTTgen(R)"
  "one : HTTgen(R)"
  "a : lfp(\<lambda>x. HTTgen(x) Un R Un HTT) \<Longrightarrow> inl(a) : HTTgen(lfp(\<lambda>x. HTTgen(x) Un R Un HTT))"
  "b : lfp(\<lambda>x. HTTgen(x) Un R Un HTT) \nil))
  "zero : HTTgen(lfp(\<lambda>x. HTTgen(x) Un R Un HTT))"
  "n : lfp(\<lambda>x. HTTgen(x) Un                                      
all
  "[] : HTTgen(lfp(\<lambda>x. HTTgen(x) Un R Un HTT))"
  "\<lbrakk>h : lfp(\<lambda>x. HTTgen(x)                   ("2"
    h$t : HTTgen(lfp(\<lambda>x. HTTgen(x) Un R Un HTT))"

  unfolding data_defs by (genIs HTTgenXH HTTgen_mono)+


subsection \<open>Formation Rules for Types\<close>

lemma UnitF: "Unit <= HTT"
  by (simp add: subsetXH UnitXH HTT_rews)

lemma BoolF: "Bool <= HTT"
  by (  BoolXH )

lemma PlusF: "\<lbrakk>A <= HTT; B <= HTT\<rbrakk> \<Longrightarrow> A + B  <= HTT"
  by (fastforce simp: subsetXH PlusXH iff: HTT_rews)

lemma SigmaF: "\<                                                              
  by (fastforce simp: subsetXH SgXH HTT_rews)


(                                                                inst?)
(***                                          exhaution rule for type-former ***)

(*Proof by induction - needs induction rule for type*)
lemma "
Nat <= HTT"
  apply (simp add: subsetXH)
  apply clarify
  apply (erule Nat_ind)
   apply (fastforce iff: HTT_rews)+
  done

lemma NatF: "
Nat <= HTT"
  apply clarify
  apply (erule HTT_coinduct3)
  apply (fast intro: HTTgenIs elim!: HTTgen_mono [THEN ci3_RI] dest: NatXH [THEN iffD1])
  done

lemma ListF: "
A <= HTT \                                                                   1
  apply clarify
  apply (erule HTT_coinduct3)
  apply (fast intro!: HTTgenIs elim!: HTTgen_mono [THEN ci3_RI]
    subsetD [THEN HTTgen_mono [THEN ci3_AI]]
    dest: ListXH [THEN iffD1])
  done

lemma ListsF: "A <= HTT \<Longrightarrow>                                                                    lemma
  apply clarify
  apply (erule HTT_coinduct3)
  apply (fast intro!: HTTgenIs elim!: HTTgen_mono [THEN ci3_RI]
    subsetD [THEN HTTgen_mono [THEN ci3_AI]] dest: ListsXH [THEN iffD1])
  done

lemma IListsF: "
A <= HTT \<Longrightarrow> ILists(A) <= HTT"
  apply clarify
  apply (erule HTT_coinduct3                                                                     list2array_sound"
java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
  apply (fast intro!: HTTgenIs elim!: HTTgen_mono [THEN ci3_RI]
    subsetD [THEN HTTgen_mono [THEN                                                                      ?
  done

end

Messung
CHZG
8110010093

¤ Dauer der Verarbeitung: 0.2 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland