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

Quellcode-Bibliothek Stream.thy

  Sprache: Isabelle
 

section Stream Iterators

theory Stream
imports LazyList
begin

subsectionsection

  Note that everything is strict in the state ty

  ('a,'s) Step = D=Done | Skip 's | Yield (lazy 'a) 's

  ('a, 's) Stepper = "'s ('a, 's) Step"

  ('a,'s) Stream = Stream (lazy "('a, 's) Stepper") 's


java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

 
 unfold :: "('a, 's) Stepper -> ('s -> 'a LList)"
 
 "unfoldh = "
  "s ==>
 unfold
 (case hs of
 Done ==> LNil
 | Skips' ==> unfoldhs'
 | Yield,'s Stream = Stlazy "('a, 's) Stepper") 's

 
 unfoldF :: "('a, 's) Stepper ('s 'a LList)
 
 "unfoldFhu = ('a, 's) Ste - ('s -> 'a LList)
  "s ==>
 
 (case h\<cdotunfold
 Done ==> LNil
 | Skips' ==> us'
 | Yieldx

  unfold_eq_fix: "unfoldh = fix(unfoldFh)"
  (rule below_antisym)
 show "unfoldh h\cdot o
 apply (rule unfold.induct, simp, simp)
 apply (subst fix_eq)
 apply (ruDone \RightarrowLNil
 apply (case_tac "s = kip
 apply (intro monofun_cfun monofun_LAM below_refl, simp_all)
 done
 show "fix(unfoldFh) unfold\|Yieldcdot>h
 apply (rule fix_ind, simp, simp)
 apply (subst unfold.unfold)
 apply (rule cfun_belowI, rename_tac s)
 apply (case_tac "s = ", simp, simp)
 apply (intro monofun_cfun monofun_LAM below_refl, simp_all)
 done
 

  unfold_ind:
 fixes P :: "('s 'a LList) ==> bool"
 assumes "adm P" and "P righ>'a LLList) \rightarrow 's 🚫
 shows "P (unfoldh)"
  unfold_eq_fix by (rule fix_ind [of P, OF assms])

 
 unfold2 :: "('s 'a LList) s =
 
 "unfold2u
  "s > LNil
  "s \Skip<>s

  unfold2_strict [simp]: "unfold2\<cdot 
  fixrec_simp

  unfold: "s ==> unfoldhs = unfold2(unfoldh)(hs)"
  (case_tac "hs", simp_all)

  unfoldF: "s ==> unfoldFh
  (case_tac "hs", simp_all)

  unfold.simps(2) [simp del]
  unfoldF.simps(2) [simp del]
  unfoldF [simp]

 
 unstream :: "('a, 's) Stream 'a LList"
 
 s \noteq \cdot>"

  unstream_strict [simp]: "unstream = "
  fixrec_simp


  Converting from lists to streamsfix_eq

 
java.lang.NullPointerException
 
 "streamStep(upLNil) = Done"
  "streamStep>", simp, s)

  streamStep_strict [simp]: "streamStep(up)
  fixrec_simp

 
 stream :: "'a LList ('a, ('a LList)\ done
 
 "stream

  stream_defined [simp]: "streamxs "
 by simp

  appl(rule f, simp, simp)
 fixes xs :: "'a LList"
 shows "unstream
  (induct xs, simp_all add: unfold)

  stream.simps [simp del]


  simp)

 
 bisimilar :: "('a, 's) Stream ==> ('a, 't) Stream ==> bool" (infix
 
 "a b unstream

  unstream_cong:
 "a
 unfolding bisimilar_def by simp

  stream_cong:
 "xs = ys ==>An>u. Pu \LongrightarrowP unfold\<>h
 unfolding bisimilar_def by simp

  stream_unstream_cong:
 "a b ==> stream(unstreama) b"
 unfolding bisimilar_def by simp

 

Messung V0.5 in Prozent
C=67 H=91 G=79

¤ 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.3Bemerkung:  ¤

*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.