Closed cionx closed 8 months ago
Thank you!
To be consistent with OCaml, we need to evaluate the subexpression e
in fst e
(sim. snd
) fully to a value. So I added two rules:
fst e --> fst e'
if e --> e'
snd e --> snd e'
if e --> e'
While leaving the existing rules unchanged.
I believe that resolves the issue, but if I've missed something, please reopen.
The small step rules for Core OCaml have the following entries for
fst
andsnd
:https://github.com/cs3110/textbook/blob/7b131977bcd587151bd700cd38ae83e72748a7fd/src/chapters/interp/substitution.md?plain=1#L939-L941
But we have no rules for
fst (e1, e2)
andsnd (e1, e2)
when one of the two entriese1
ande2
is not a value. I guess that in the quoted code sample,v1
andv2
should bee1
ande2
instead.