Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  Execute.thy

  Sprache: Isabelle
 

(*  Author:     Lukas Bulwahn, TU Muenchen, 2009  *)

theory Execute
imports secTypes
begin

section Executing the small step semantics

code_pred (modes: i => o => bool as exec_red, i => i * o => bool, i => o * i => bool, i => i => bool) red .
thm red.equation

definition [code]: "one_step x = Predicate.the (exec_red x)"

lemmas [code_pred_intro] = typeVal[where lev = Low] typeVal[where lev = High]
  typeVar
  typeBinOp1 typeBinOp2[where lev = Low] typeBinOp2[where lev = High] typeBinOp3[where lev = Low]

code_pred (modes: i => i => o => bool as compute_secExprTyping,
  i => i => i => bool as check_secExprTyping) secExprTyping
proof -
  case secExprTyping
  from secExprTyping.prems show thesis
  proof
    fix Γ V lev assume "x = Γ" "xa = Val V" "xb = lev"
    from secExprTyping(1-2) this show thesis by (cases lev) auto
  next
    fix Γ Vn lev
    assume "x = Γ" "xa = Var Vn" "xb = lev" "Γ Vn = Some lev"
    from secExprTyping(3) this show thesis by (auto simp add: Predicate.eq_is_eq)
  next
    fix Γ e1 e2 bop
    assume "x = Γ" "xa = e1«bop¬ e2" "xb = Low"
       e1 : Low"  e2 : Low"
    from secExprTyping(4) this show thesis by auto
  next
    fix Γ e1 e2 lev bop
    assume "x = Γ" "xa = e1«bop¬ e2" "xb = High"
     e1 : High"  e2 : lev"
    from secExprTyping(5-6) this show thesis by (cases lev) (auto)
  next
    fix Γ e1 e2 lev bop
    assume "x = Γ" "xa = e1«bop¬ e2" "xb = High"
     e1 : lev"  e2 : High"
    from secExprTyping(6-7) this show thesis by (cases lev) (auto)
  qed
qed

lemmas [code_pred_intro] = typeSkip[where T=Low] typeSkip[where T=High]
  typeAssH[where T = Low] typeAssH[where T=High]
  typeAssL typeSeq typeWhile typeIf typeConvert

code_pred (modes: i => o => i => bool as compute_secComTyping,
  i => i => i => bool as check_secComTyping) secComTyping
proof -
  case secComTyping
  from secComTyping.prems show thesis
  proof
    fix Γ T assume "x = Γ" "xa = T" "xb = Skip"
    from secComTyping(1-2) this show thesis by (cases T) auto
  next
    fix Γ V T e assume "x = Γ" "xa = T" "xb = V:=e" "Γ V = Some High"
    from secComTyping(3-4) this show thesis by (cases T) (auto)
  next
    fix Γ e V
    assume "x = Γ" "xa = Low" "xb = V:=e"  e : Low" "Γ V = Some Low"
    from secComTyping(5) this show thesis by auto
  next
    fix Γ T c1 c2
    assume "x = Γ" "xa = T" "xb = Seq c1 c2" "Γ,T c1" "Γ,T c2"
    from secComTyping(6) this show thesis by auto
  next
    fix Γ b T c
    assume "x = Γ" "xa = T" "xb = while (b) c"  b : T" "Γ,T c"
    from secComTyping(7) this show thesis by auto
  next
    fix Γ b T c1 c2
    assume "x = Γ" "xa = T" "xb = if (b) c1 else c2"  b : T" "Γ,T c1" "Γ,T c2"
    from secComTyping(8) this show thesis by blast
  next
    fix Γ c
    assume "x = Γ" "xa = Low" "xb = c" "Γ,High c"
    from secComTyping(9) this show thesis by blast
  qed
qed

thm secComTyping.equation

subsection An example taken from Volpano, Smith, Irvine

definition "com = if (Var ''x'' «Eq¬ Val (Intg 1)) (''y'' := Val (Intg 1)) else (''y'' := Val (Intg 0))"
definition "Env = map_of [(''x'', High), (''y'', High)]"

values "{T. Env (Var ''x'' «Eq¬ Val (Intg 1)): T}"
value "Env, High com"
value "Env, Low com"
values 1 "{T. Env, T com}"

definition "Env' = map_of [(''x'', Low), (''y'', High)]"

value "Env', Low com"
value "Env', High com"
values 1 "{T. Env, T com}"

  
end

Messung V0.5 in Prozent
C=98 H=97 G=97

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© 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 und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge