@@ -39,7 +39,7 @@ The grammar of HeapLang, and in particular its set \Expr{} of \emph{expressions}
\InrE(\expr) \mid
\Match\expr with \Inl => \expr_1 | \Inr => \expr_2 end \mid
{}\\&
\Alloc(\expr_1,\expr_2) \mid
\AllocN(\expr_1,\expr_2) \mid
\Free(\expr) \mid
\deref\expr\mid
\expr_1 \gets\expr_2 \mid
...
...
@@ -66,7 +66,7 @@ We will leave away the disambiguating subscript when it is clear from the contex
All of this lets us define $\ofval$ as simply applying the value injection (the very first syntactic form of $\Expr$), which makes a lot of things in Coq much simpler.
$\toval$ is defined recursively in the obvious way.
\langkw{Alloc} takes as first argument the number of heap cells to allocate (must be strictly positive), and as second argument the default value to use for these heap cells.
\langkw{AllocN} takes as first argument the number of heap cells to allocate (must be strictly positive), and as second argument the default value to use for these heap cells.
This lets one allocate arrays.
$\Ptradd$ implements pointer arithmetic (the left operand must be a pointer, the right operand an integer), which is used to access array elements.
...
...
@@ -103,8 +103,8 @@ The HeapLang operational semantics is defined via the use of \emph{evaluation co
\Inr(\lctx) \mid
\Match\lctx with \Inl => \expr_1 | \Inr => \expr_2 end \mid
{}\\&
\Alloc(\expr, \lctx) \mid
\Alloc(\lctx, \val) \mid
\AllocN(\expr, \lctx) \mid
\AllocN(\lctx, \val) \mid
\Free(\lctx) \mid
\deref\lctx\mid
\expr\gets\lctx\mid
...
...
@@ -198,7 +198,7 @@ The $\HLOp$ subscript indicates that this is the HeapLang operator, not the math