text_raw‹\snip{BExpnotdef}{2}{2}{%› fun not :: "bexp \ bexp"where "not (Bc True) = Bc False" | "not (Bc False) = Bc True" | "not b = Not b" text_raw‹}%endsnip›
lemma bval_not[simp]: "bval (not b) s = (\ bval b s)" apply(induction b rule: not.induct) apply simp_all done
text‹Now the overall optimizer:›
text_raw‹\snip{BExpbsimpdef}{0}{2}{%› 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‹}%endsnip›
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
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
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.