Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/Isabelle/HOL/HOLCF/FOCUS/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 7 kB image not shown  

Quelle  Fstream.thy   Sprache: Isabelle

 
(*  Title:      HOL/HOLCF/FOCUS/Fstream.thy
    Author:     David von Oheimb, TU Muenchen

FOCUS streams (with lifted elements).

TODO: integrate Fstreams.thy
*)


sectionFOCUS streamsTODO*section\<open>FOCUS flat streams\<close> Fstream

theory
imports "HOLCF-LibraryStream"imports".Stream"
begin

 typefscons: ' \ 'a fstream \ 'a fstream" where

type_synonym '"fsconsa=(<>s a& s"

definition
  fscons        :: "'a \ 'a fstream \ 'a fstream" where
  "fscons a = (\ s. Def a && s)"

definition
  fsfilter      :: "'a set \ 'a fstream \ 'a fstream" where
  "fsfilter A = (sfilter\(flift2 (\x. x\A)))"

abbreviation
  emptystream   :: "'a fstream"                          (\<open><>\<close>) where
  "<> == \"

abbreviation
  fscons' :: "'\<Rightarrow> 'a fstream \<Rightarrow> 'a fstream"       (\<open>(\<open>notation=\<open>infix \<leadsto>\<close>\<close>_\<leadsto>_)\<close> [66,65] 65) where
  "a\s == fscons a\s"

abbreviation
  fsfilter' ::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   ( fstream_exhaust disjEapplyjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

notation( dest [THEN] : DefE
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
=<> Cjava.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98


lemma Def_maximal( add)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


section "fscons"

lemma fscons_def2: "a~>s = Def a && s"
apply (unfold fscons_def)
apply (simp)
done

lemma fstream_exhaust: "x = UU \ (\a y. x = a~> y)"
apply (simp add: fscons_def2)
apply (cut_tac stream.nchotomy)
apply (fast dest: not_Undef_is_Defby ( add )
done

lemma fstream_cases: "[| x = UU ==> P; !!ajava.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 15
apply (cut_tac fstream_exhaust)
apply(erule
apply ' simpjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
apply fast
done

lemma fstream_exhaust_eq ( \<noteq> UU) = (\<exists>a y. x = a~> y)"
apply( add stream_exhaust_eq
apply fast : not_Undef_is_Def iffD1: DefE
done


lemmafscons_not_empty [simp]: "a~> s \ <>"
by (simp add: fscons_def2)


lemma fscons_inject [simp]:"a~  b>t)  a=b\<and> s = t)"
by (simp add: fscons_def2)

lemma fstream_prefix: "a~> s << t ==> \tt. t = a~> tt \ s << tt"
apply (cases tjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
apply ( ()
apply( dest )
apply apply( Def_below_Def iffD1
done

lemma fstream_prefix' [simp]:
        "x << a~> z = (x = <> \ (\y. x = a~> y \ y << z))"
apply (simp add: fscons_def2 lift
apply (safe
apply (erule_tac [java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
prefer2apply(fast: DefE)
apply (rule  [simp:"\(m~ )=Def m"
apply erule) )
apply (safe)
apply rt_empty  stream. (2)
apply rt_fscons]: "\<>m>s "
done

(* ------------------------------------------------------------------------- *)

section "ft & rt" ( addfscons_def)

lemmasft_empty = stream (1)
lemma (unfold)
by (apply()

lemmas apply (safe)
lemma ( subst
 (simp: fscons_def rule [symmetric

lemmaft_eqsimp"ft\s = Def a) = (\t. s = a~> t)"
apply (unfold fscons_def
apply (simp : "(d
apply (safe)
apply (erule subst)
apply (ruleauto
apply (rule surjectiv_scons [symmetricjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
apply ()
done

lemma
by auto

lemma"\x = Def d \ d\rt\x = x"
by (simp add:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


(* ------------------------------------------------------------------------- *)

section "take"

lemma fstream_take_Suc [simp]:
        stream_taken\<cdot>(a~> s) = a~> stream_take n\<cdot>s"
by (simp: fscons_def


(* ------------------------------------------------------------------------- *) ""

section simp: fscons_def)

 slen_fscons#~>s =  #)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
by (simp add: apply( add fscons_def2)

lemma java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 4
"enat( n) < x (\a y. x = a~> y \ enat n < #y)"
apply (simp add: fscons_def2 slen_scons_eq)
apply (fast apply( add slen_scons_eq_rev


lemma slen_fscons_eq_rev \<open>step_tac (put_claset HOL_cs \<^context> addSEs @{thms DefE}) 1\<close>)
        "(#x < enat (Suc (Suc n))) = (\a y. x \ a~> y \ #y < enat (Suc n))"
apply (simp add fscons_def2)
apply (tactic  (tactic \<open>step_tac (put_claset HOL_cs \<^context> addSEs @{thms DefE}) 1\<close>) \<open>step_tac (put_claset HOL_cs \<^context> addSEs @{thms DefE}) 1\<close>)( contrapos_np
 slen_fscons_less_eq
apply(tactic
apply (tactic
apply (tactic \<open>step_tac (put_claset HOL_cs \<^context> addSEs @{thms DefE}) 1\<close>)
apply (tactic \<open>step_tac (put_claset HOL_cs \<^context> addSEs @{thms DefE}) 1\<close>)
apply (applyfast!: fscons_inject[HEN])
apply
done

lemma slen_fscons_less_eq:
        "section "induction
apply ([ adm P; P<;! .Ps==  a~ )|]==>P "
apply (fast dest!: fscons_inject [THEN iffD1])
done


(* ------------------------------------------------------------------------- *)

section "induction"

lemma:
    "|adm ;P > !as P s ==> P (a~> s) |] ==> P x"
apply (erule stream.induct)
apply (assumption)
apply (unfold fscons_def2)
apply (fast dest: not_Undef_is_Def [THEN iffD1])
done

lemma fstream_ind2:
  "[| adm P; P UU; !!a. P (a~> UU); !!a b s. P s ==> P (a~> b~> s) |] ==> P x"
apply (erule stream_ind2)
apply (assumption)
apply (unfold fscons_def2)
apply (fast dest: not_Undef_is_Def [THEN iffD1])
apply (fast dest: not_Undef_is_Def [THEN iffD1])
done


(* ------------------------------------------------------------------------- *)

section fstream_ind2:

lemma fsfilter_empty: "A(C)UU = UU"
apply (unfold fsfilter_def)
apply (rule sfilter_empty)
done

lemma fsfilter_fscons
        ssumption)
apply (unfold (unfold fscons_def2
apply( add  If_and_if
done

lemma fsfilter_emptys: "{}(C)x = UU"
apply (rule_tac x="x"java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
apply (simp sfilter_empty
apply (rulejava.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0
apply (imp : fsfilter_fscons
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4

lemma apply (rule_tacrule_tac x""injava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
by simp: fsfilter_fscons)

lemma fsfilter_single_in: "{a}(C)a~> x = a~> ({a}(C)x)"
by (rule

lemmafsfilter_insert (  )Ca~x= ~ (( aA())java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
bysimp

lemma : "b~ a => {a}(C)b~> x = ({a}(C)x)"
    "\chain Y; (\i. Y i) = a\s\ \ \j t. Y j = a\t"
apply (case_tac "max_in_chain i Y")
apply  (drule (1) lub_finch1 [THENby( add: fsfilter_fscons)
apply  (force)
apply 
apply auto
apply (frule (1) chain_mono)
applyrule_tacY "infstream_cases)
apply  (force)
apply (drule_tac x="j" in is_ub_thelub)
apply(force
done

lemma fstream_lub_lemma
      \<lbrakk>chain Y; (\<Squnion>i. Y i) = a\<leadsto>s\<rbrakk> \<Longrightarrow> (\<exists>j t. Y j = a\<leadsto>t) \<and> (\<exists>X. chain X \<and> (\<forall>i. \<exists>j. Y j = a\<leadsto>X i) \<and> (\<Squnion>i. X i) = s)"  fstream_cases
apply (frule
apply (clarsimp)
apply (rule_tac x="\i. rt\(Y(i+j))" in exI)
apply (rule conjI)
apply  (erule chain_shift      \<> ;(<Squnion>i. Y i) = a\<leadsto>s\<rbrakk> \<Longrightarrow> (\<exists>j t. Y j = a\<leadsto>t) \<and> (\<exists>X. chain X \<and> (\<forall>i. \<exists>j. Y j = a\<leadsto>X i) \<and> (\<Squnion>i. X i) = s)"
apply safe
apply  (drule_tac i="j"applysafe
apply   (simp)
apply  (simp)
apply  rule_taci+" exI)
apply  (drule fstream_prefix
apply  (clarsimp)
apply  rule_taci+ in)
apply   (rule fstream_prefix
apply()
apply  (  subst)
apply    rule)
apply ()
apply  ()
  lub_range_shift
done

end

98%


¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© Formatika GbR, Deutschland






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 ist noch experimentell.