"\ me \ (b\<^sub>1,c\<^sub>1) \ (bv\<^sub>1,c\<^sub>2); me \ (b\<^sub>2,c\<^sub>2) \ (bv\<^sub>2,c\<^sub>3) \ \
me ⊨ (And b🚫1 b🚫2,c🚫1) → (bv🚫1∧bv🚫2,c🚫3)" |
"\ me \ (e\<^sub>1,c\<^sub>1) \ (r\<^sub>1,c\<^sub>2); me \ (e\<^sub>2,c\<^sub>2) \ (r\<^sub>2,c\<^sub>3) \ \
me ⊨ (Eq e🚫1 e🚫2,c🚫1) → (r🚫1=r🚫2,c🚫3)"
code_pred (modes: i => i => o => bool) big_step .
text‹Example: natural numbers encoded as objects with a predecessor
field. Null is zero. Method succ adds an object in front, method add
adds as many objects in front as the parameter specifies.
First, the method bodies:›
definition "m_succ = (''s'' ::= New)\''pred'' ::= V ''this''; V ''s''"
definition"m_add = IF Eq (V ''param'') Null THEN V ''this''
ELSE V ''this''∙''succ''<Null>∙''add''<V ''param''∙''pred''>"
text‹The main code, adding 1 and 2:› definition"main = ''1'' ::= Null∙''succ''<Null>; ''2'' ::= V ''1''∙''succ''<Null>;
V ''2''∙''add'' <V ''1''>"
text‹Execution of semantics. The final variable environment and store are
converted into lists of references based on given lists of variable and field
names toextract.›
values "{(r, map ve' [''1'',''2''], map (\n. map (s' n)[''pred'']) [0..
r ve' s' n. menv ⊨ (main, λx. null, nth[], 0) ==> (r,ve',s',n)}"
end
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 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.