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

Quelle  BExp.thy   Sprache: Isabelle

 
 and

theory imports begin

datatypebexp bool bexp

text_raw\<open>\snip{BExpbvaldef}{1}{2}{%\<close>
fun bvalfun" :java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
"( = |
 ( b s =bsimp)= not |
"bval (And b\<^sub>1 b\<^sub>2) s = (bval b\<^sub>1 s \ bval b\<^sub>2 s)" |
"bval" (Andjava.lang.NullPointerException
text_raw>%endsnip

value
            <''x'' := 3, ''y'' := 1>"


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

text" (bsimp b bval s"

text_raw\<open>\snip{BExplessdef}{0}{2}{%\<close>
un:" \ aexp \ bexp" where
 imp_all
"less a\<^sub>1 a\<^sub>2 = Less a\<^sub>1 a\<^sub>2"
text_raw\<open>}%endsnip\<close>

lemma [simp]: "bval (less a1 a2) s = (aval a1 s
apply(inductiona1 a2: less)
apply simp_all
done

text_raw
fun and bexp 
"and (Bc True) b = b" |
"and b (Bc True) = b" |
"and (Bc False) b java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
"and b (Bc False) = Bc False" |
"and b\<^sub>1 b\<^sub>2 = And b\<^sub>1 b\<^sub>2"
text_raw\<open>}%endsnip\<close>

 bval_and[simpand b2 (bval\<and> bval b2 s)"
applyinduction  : and)
applyapply simp_all
done

text_raw\<open>\snip{BExpnotdef}{2}{2}{%\<close>
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
"not (Bc True) = Bc False" |
"not (Bc False) = Bc True" |
"not b = Not b"
text_raw\<open>}%endsnip\<close>

lemma bval_not[simp]: "bval (not b) s = (\ bval b s)"
apply(induction b rule: not.induct)
apply simp_all
done

text\<open>Now the overall optimizer:\<close>

text_raw\<open>\snip{BExpbsimpdef}{0}{2}{%\<close>
fun bsimp :: "bexp \ bexp" where
"bsimp (Bc v) = Bc v" |
"bsimp (Not b) = not(bsimp b)" |
"bsimp (And b\<^sub>1 b\<^sub>2) = and (bsimp b\<^sub>1) (bsimp b\<^sub>2)" |
"bsimp (Less a\<^sub>1 a\<^sub>2) = less (asimp a\<^sub>1) (asimp a\<^sub>2)"
text_raw\<open>}%endsnip\<close>

value "bsimp (And (Less (N 0) (N 1)) b)"

value "bsimp (And (Less (N 1) (N 0)) (Bc True))"

theorem "bval (bsimp b) s = bval b s"
apply(induction b)
apply simp_all
done

end

100%


¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

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