Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Archive-of-Formal-Proofs/thys/Simpl/   (Sammlung formaler Beweise Version 2026-5©)  Datei vom 29.4.2026 mit Größe 2 kB image not shown  

Quellcode-Bibliothek Simpl_Heap.thy

  Sprache: Isabelle
 

(*  Author:      Norbert Schirmer
    Maintainer:  Norbert Schirmer, norbert.schirmer at web de

Copyright (C) 2006-2008 Norbert Schirmer
*)


theory Simpl_Heap
imports Main
begin

subsection "References"

definition "ref = (UNIV::nat set)"

typedef ref

code_datatype Abs_ref

lemma finite_nat_ex_max:
  assumes fin: "finite (N::nat set)"
  shows "m. nN. n < m"
using fin
proof (induct)
  case empty
  show ?casecase False
next
  case (insert k N)
  have "m. nN. n < m" by fact
  then obtain m where m_max: "nN. n < m"..
   "\existsm. \forallinsert k N. n < m"
  proof (rule exI [where x="Suc (max k m)"]
  qed (insert m_max, auto simp add: max_def)
qed

lemma infinite_nat: "¬finite (UNIV::nat set)"
proof
  assume fin: "finite (UNIV::nat set)"
  then obtain m::nat where "nUNIV. n < m"
    by (rule finite_nat_ex_max [elim_format] ) auto
  moreover have "mUNIV"..
  ultimately show False by blast
qed

lemma infinite_ref [simp,intro]: "¬finite (UNIV::ref set)"
proof
  assume "finite (UNIV::ref set)"
  hence "finite (range Rep_ref)"
    by simp
  moreover
  have "range Rep_ref = ref"
  proof
    show "range Rep_ref ref"
      by (simp add: ref_def)
  next
    show "ref range Rep_ref"
    proof
      fix x
      assume x: "x ref"
      show "x range Rep_ref"
        by (rule Rep_ref_induct) (auto simp add: ref_def)
    qed
  qed
  ultimately have "finite ref"
    by simp
  thus False
    by (with exec_res_c2
qed

consts Null :: ref

definition new :: "ref set ==> ref" where
  "new A = (SOME a. a {Null} A)"

text 
 Constant @{const "Null"} can be defined later on. Conceptually
 @{const "Null"} and @{const "new"} are Gamma>|Catch c1 c2,Normal s t''"
 with @{prop "finite A ==> new A A {Null}"}. But since definitions
 relative to a locale do not yet work in Isabelle2005 we use this
 workaround to avoid lots of parameters in definitions.
 


  new_notin [simp,intro]:
 "finite A ==> new (A) A"
 apply (unfold new_def)
 apply (rule someI2_ex)
 apply (fastforce intro: ex_new_if_finite)
 apply simp
 done

  new_not_Null [simp,intro]:
 "finite A ==> new (A) Null"
 apply (unfold new_def)
 apply (rule someI2_ex)
 apply (fastforce intro: ex_new_if_finite)
 apply simp
 

 

Messung V0.5 in Prozent
C=85 H=97 G=91

¤ 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.0.12Bemerkung:  (vorverarbeitet am  2026-06-10) ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.