text‹The ‹domain› type class, which is the default type class
HOLCF, fixes two overloaded functions: ‹emb::'a → udom› and ‹prj::udom → 'a›. By composing the ‹prj› and ‹emb›
together, we can coerce values between any two types in ‹domain›. \medskip›
text‹When working with proofs involving ‹emb›, ‹prj›, ‹coerce›, it is often difficult to tell at which types those
are being used. To alleviate this problem, we define special
and output syntax to indicate the types. \medskip›
text‹Coercing from the strict product type @{typ "'a ⊗ 'b"} to
strict product type @{typ "'c ⊗ 'd"} is equivalent to mapping ‹coerce› function separately over each component using ‹sprod_map :: ('a → 'c) → ('b → 'd) → 'a ⊗ 'b → 'c ⊗ 'd›. Each
the several type constructors defined in HOLCF satisfies a similar
, with respect to its own map combinator. \medskip›
text‹When simplifying applications of the ‹coerce› function,
rules are always oriented to replace ‹coerce› at complex
with other applications of ‹coerce› at simpler types.›
text‹The safest rewrite rules for ‹coerce› are given the ‹[simp]› attribute. For other rules that do not belong in the
simpset, we use dynamic theorem list called ‹coerce_simp›,
will collect additional rules for simplifying coercions. \medskip›
named_theorems coerce_simp "rule for simplifying coercions"
text‹The ‹coerce› function commutes with data constructors
various HOLCF datatypes. \medskip›
lemma coerce_up [simp]: "coerce⋅(up⋅x) = up⋅(coerce⋅x)" by (simp add: coerce_u)
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.