datatype (plugins only: code extraction) sumbool = Left | Right
subsection‹Type of extracted program›
extract_type "typeof (Trueprop P) ≡ typeof P"
"typeof P ≡ Type (TYPE(Null)) ==> typeof Q ≡ Type (TYPE('Q)) ==> typeof (P ⟶ Q) ≡ Type (TYPE('Q))"
"typeof Q ≡ Type (TYPE(Null)) ==> typeof (P ⟶ Q) ≡ Type (TYPE(Null))"
"typeof P ≡ Type (TYPE('P)) ==> typeof Q ≡ Type (TYPE('Q)) ==> typeof (P ⟶ Q) ≡ Type (TYPE('P ==> 'Q))"
"(λx. typeof (P x)) ≡ (λx. Type (TYPE(Null))) ==> typeof (∀x. P x) ≡ Type (TYPE(Null))"
"(λx. typeof (P x)) ≡ (λx. Type (TYPE('P))) ==> typeof (∀x::'a. P x) ≡ Type (TYPE('a ==> 'P))"
"(λx. typeof (P x)) ≡ (λx. Type (TYPE(Null))) ==> typeof (∃x::'a. P x) ≡ Type (TYPE('a))"
"(λx. typeof (P x)) ≡ (λx. Type (TYPE('P))) ==> typeof (∃x::'a. P x) ≡ Type (TYPE('a × 'P))"
"typeof P ≡ Type (TYPE(Null)) ==> typeof Q ≡ Type (TYPE(Null)) ==> typeof (P ∨ Q) ≡ Type (TYPE(sumbool))"
"typeof P ≡ Type (TYPE(Null)) ==> typeof Q ≡ Type (TYPE('Q)) ==> typeof (P ∨ Q) ≡ Type (TYPE('Q option))"
"typeof P ≡ Type (TYPE('P)) ==> typeof Q ≡ Type (TYPE(Null)) ==> typeof (P ∨ Q) ≡ Type (TYPE('P option))"
"typeof P ≡ Type (TYPE('P)) ==> typeof Q ≡ Type (TYPE('Q)) ==> typeof (P ∨ Q) ≡ Type (TYPE('P + 'Q))"
"typeof P ≡ Type (TYPE(Null)) ==> typeof Q ≡ Type (TYPE('Q)) ==> typeof (P ∧ Q) ≡ Type (TYPE('Q))"
"typeof P ≡ Type (TYPE('P)) ==> typeof Q ≡ Type (TYPE(Null)) ==> typeof (P ∧ Q) ≡ Type (TYPE('P))"
"typeof P ≡ Type (TYPE('P)) ==> typeof Q ≡ Type (TYPE('Q)) ==> typeof (P ∧ Q) ≡ Type (TYPE('P × 'Q))"
"typeof (P = Q) ≡ typeof ((P ⟶ Q) ∧ (Q ⟶ P))"
"typeof (x ∈ P) ≡ typeof P"
subsection‹Realizability›
realizability "(realizes t (Trueprop P)) ≡ (Trueprop (realizes t P))"
"(typeof P) ≡ (Type (TYPE(Null))) ==> (realizes t (P ⟶ Q)) ≡ (realizes Null P ⟶ realizes t Q)"
"(typeof P) ≡ (Type (TYPE('P))) ==> (typeof Q) ≡ (Type (TYPE(Null))) ==> (realizes t (P ⟶ Q)) ≡ (∀x::'P. realizes x P ⟶ realizes Null Q)"
"(realizes t (P ⟶ Q)) ≡ (∀x. realizes x P ⟶ realizes (t x) Q)"
"(λx. typeof (P x)) ≡ (λx. Type (TYPE(Null))) ==> (realizes t (∀x. P x)) ≡ (∀x. realizes Null (P x))"
"(realizes t (∀x. P x)) ≡ (∀x. realizes (t x) (P x))"
"(λx. typeof (P x)) ≡ (λx. Type (TYPE(Null))) ==> (realizes t (∃x. P x)) ≡ (realizes Null (P t))"
"(realizes t (∃x. P x)) ≡ (realizes (snd t) (P (fst t)))"
"(typeof P) ≡ (Type (TYPE(Null))) ==> (typeof Q) ≡ (Type (TYPE(Null))) ==> (realizes t (P ∨ Q)) ≡ (case t of Left ==> realizes Null P | Right ==> realizes Null Q)"
"(typeof P) ≡ (Type (TYPE(Null))) ==> (realizes t (P ∨ Q)) ≡ (case t of None ==> realizes Null P | Some q ==> realizes q Q)"
"(typeof Q) ≡ (Type (TYPE(Null))) ==> (realizes t (P ∨ Q)) ≡ (case t of None ==> realizes Null Q | Some p ==> realizes p P)"
"(realizes t (P ∨ Q)) ≡ (case t of Inl p ==> realizes p P | Inr q ==> realizes q Q)"
"(typeof P) ≡ (Type (TYPE(Null))) ==> (realizes t (P ∧ Q)) ≡ (realizes Null P ∧ realizes t Q)"
"(typeof Q) ≡ (Type (TYPE(Null))) ==> (realizes t (P ∧ Q)) ≡ (realizes t P ∧ realizes Null Q)"
"(realizes t (P ∧ Q)) ≡ (realizes (fst t) P ∧ realizes (snd t) Q)"
"typeof P ≡ Type (TYPE(Null)) ==> realizes t (¬ P) ≡¬ realizes Null P"
"typeof P ≡ Type (TYPE('P)) ==> realizes t (¬ P) ≡ (∀x::'P. ¬ realizes x P)"
"typeof (P::bool) ≡ Type (TYPE(Null)) ==> typeof Q ≡ Type (TYPE(Null)) ==> realizes t (P = Q) ≡ realizes Null P = realizes Null Q"
"(realizes t (P = Q)) ≡ (realizes t ((P ⟶ Q) ∧ (Q ⟶ P)))"
subsection‹Computational content of basic inference rules›
theorem disjE_realizer: assumes r: "case x of Inl p ==> P p | Inr q ==> Q q" and r1: "∧p. P p ==> R (f p)"and r2: "∧q. Q q ==> R (g q)" shows"R (case x of Inl p ==> f p | Inr q ==> g q)" proof (cases x) case Inl with r show ?thesis by simp (rule r1) next case Inr with r show ?thesis by simp (rule r2) qed
theorem disjE_realizer2: assumes r: "case x of None ==> P | Some q ==> Q q" and r1: "P ==> R f"and r2: "∧q. Q q ==> R (g q)" shows"R (case x of None ==> f | Some q ==> g q)" proof (cases x) case None with r show ?thesis by simp (rule r1) next case Some with r show ?thesis by simp (rule r2) qed
theorem disjE_realizer3: assumes r: "case x of Left ==> P | Right ==> Q" and r1: "P ==> R f"and r2: "Q ==> R g" shows"R (case x of Left ==> f | Right ==> g)" proof (cases x) case Left with r show ?thesis by simp (rule r1) next case Right with r show ?thesis by simp (rule r2) qed
theorem conjI_realizer: "P p ==> Q q ==> P (fst (p, q)) ∧ Q (snd (p, q))" by simp
theorem exI_realizer: "P y x ==> P (snd (x, y)) (fst (x, y))"by simp
theorem exE_realizer: "P (snd p) (fst p) ==> (∧x y. P y x ==> Q (f x y)) ==> Q (let (x, y) = p in f x y)" by (cases p) (simp add: Let_def)
theorem exE_realizer': "P (snd p) (fst p) ==> (∧x y. P y x ==> Q) ==> Q"by (cases p) simp
disjE (P, Q, R): "λpq pr qr. (case pq of Inl p ==> pr p | Inr q ==> qr q)" "🪙λ(c: _) (d: _) (e: _) P Q R pq (h1: _) pr (h2: _) qr. disjE_realizer ⋅ _ ⋅ _ ⋅ pq ⋅ R ⋅ pr ⋅ qr ∙ c ∙ d ∙ e ∙ h1 ∙ h2"
disjE (Q, R): "λpq pr qr. (case pq of None ==> pr | Some q ==> qr q)" "🪙λ(c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr. disjE_realizer2 ⋅ _ ⋅ _ ⋅ pq ⋅ R ⋅ pr ⋅ qr ∙ c ∙ d ∙ h1 ∙ h2"
disjE (P, R): "λpq pr qr. (case pq of None ==> qr | Some p ==> pr p)" "🪙λ(c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr (h3: _). disjE_realizer2 ⋅ _ ⋅ _ ⋅ pq ⋅ R ⋅ qr ⋅ pr ∙ c ∙ d ∙ h1 ∙ h3 ∙ h2"
disjE (R): "λpq pr qr. (case pq of Left ==> pr | Right ==> qr)" "🪙λ(c: _) P Q R pq (h1: _) pr (h2: _) qr. disjE_realizer3 ⋅ _ ⋅ _ ⋅ pq ⋅ R ⋅ pr ⋅ qr ∙ c ∙ h1 ∙ h2"
disjE (P, Q): "Null" "🪙λ(c: _) (d: _) P Q R pq. disjE_realizer ⋅ _ ⋅ _ ⋅ pq ⋅ (λx. R) ⋅ _ ⋅ _ ∙ c ∙ d ∙ arity_type_bool"
disjE (Q): "Null" "🪙λ(c: _) P Q R pq. disjE_realizer2 ⋅ _ ⋅ _ ⋅ pq ⋅ (λx. R) ⋅ _ ⋅ _ ∙ c ∙ arity_type_bool"
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 und die Messung sind noch experimentell.