function tm_of_nat :: ‹nat → tm› where ‹tm_of_nat n = (case prod_decode n of
(n, 0) →#n
| (f, Suc ts) →\†f (map tm_of_nat (list_decode ts)))› by pat_completeness auto terminationby (relation ‹measure id›) simp_all
function fm_of_nat :: ‹nat → fm› where ‹fm_of_nat 0 = \⊥›
| ‹fm_of_nat (Suc n) = (case sum_decode n of
Inl n → let (P, ts) = prod_decode n in \‡P (map tm_of_nat (list_decode ts))
| Inr n → (case prod_decode n of
(Suc p, q) → fm_of_nat p \⟶ fm_of_nat q
| (0, p) →\∀(fm_of_nat p)))› by pat_completeness auto terminationby (relation ‹measure id›) simp_all
lemma fm_nat: ‹fm_of_nat (nat_of_fm p) = p› using tm_nat by (induct p) (simp_all add: map_idI)
lemma surj_fm_of_nat: ‹surj fm_of_nat› unfolding surj_def using fm_nat by metis
subsection‹Rules›
text‹Pick a large number to help encode the Idle rule, so that we never hit it in practice.›
definition idle_nat :: nat where ‹idle_nat ≡ 4294967295›
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.