section‹A small-step (reduction) operational semantics for PCF› (*<*)
theory SmallStep imports
OpSem begin
(*>*) text‹
small-step semantics allows us to express more things, like the
of well-typed programs.
adjust: This relation is non-deterministic, but only ‹β›-reduces terms where the argument is a value. Moreover if we
with a closed term then our values are also closed. So while in
(i.e., for open terms) our substitution operation is wrong and
relation is too big, we show that things work out if we start
from a closed term (i.e., a program).
inductive
reduction :: "db ==> db ==> bool" (‹_ →v _› [50, 50] 50) where
betaN: "DBApp (DBAbsN u) v →v u<v/0>"
| betaV: "val v ==> DBApp (DBAbsV u) v →v u<v/0>"
| "f →v f' ==> DBApp f x →v DBApp f' x"
| "[f = DBAbsV u; x →v x']==> DBApp f x →v DBApp f x'"
| "DBFix f →v f<DBFix f/0>"
| "DBCond DBtt t e →v t"
| "DBCond DBff t e →v e"
| "DBSucc (DBNum n) →v DBNum (Suc n)"
| "DBPred (DBNum (Suc n)) →v DBNum n"
| "DBIsZero (DBNum 0) →v DBtt"
| "0 < n ==> DBIsZero (DBNum n) →v DBff"
abbreviation ― ‹The transitive, reflexive closure of the reduction relation.›
reduction_trc :: "db ==> db ==> bool" (‹_ →v* _› [100, 100] 100) where "reduction_trc ≡ rtranclp reduction"
declare reduction.intros[intro!]
inductive_cases reduction_inv: "DBVar v →v t'" "DBApp f x →v t'" "DBAbsN u →v t'" "DBAbsV u →v t'" "DBFix f →v t'" "DBCond i t e →v t'" "DBff →v t'" "DBtt →v t'" "DBNum n →v t'" "DBSucc n →v t'" "DBPred n →v t'" "DBIsZero n →v t'"
lemma reduction_val: assumes"val v" assumes"v →v v'" shows False using assms by (auto elim: val.cases reduction_inv)
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.