Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Roux
Iris
Commits
2a680dab
Commit
2a680dab
authored
2 years ago
by
Jonas Kastberg
Committed by
Ralf Jung
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Clean up \valForm / \exprForm
parent
b0618979
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tex/heaplang.sty
+13
-5
13 additions, 5 deletions
tex/heaplang.sty
tex/heaplang.tex
+10
-10
10 additions, 10 deletions
tex/heaplang.tex
with
23 additions
and
15 deletions
tex/heaplang.sty
+
13
−
5
View file @
2a680dab
...
...
@@ -23,16 +23,11 @@
\newcommand
{
\stateHeap
}{
\textproj
{
heap
}}
\newcommand
{
\stateProphs
}{
\textproj
{
prophs
}}
\newcommand\exprForm
{{
\langkw
{
e
}}}
\newcommand\valForm
{{
\langkw
{
v
}}}
\def\Let
#1=#2in
{
\langkw
{
let
}
\spac
#1
\mathrel
{
=
}
#2
\spac
\langkw
{
in
}
\spac
}
\def\If
#1then
{
\langkw
{
if
}
\spac
#1
\spac
\langkw
{
then
}
\spac
}
\def\Else
{
\spac\langkw
{
else
}
\spac
}
\def\Ref
{
\operatorname
{
\langkw
{
ref
}}}
\def\Rec
#1#2=
{
\langkw
{
rec
}
\spac\operatorname
{
#1
}
#2
\mathrel
{
=
}
}
\def\RecE
#1#2=
{
\langkw
{
rec
}_
\exprForm\spac\operatorname
{
#1
}
#2
\mathrel
{
=
}
}
\def\RecV
#1#2=
{
\langkw
{
rec
}_
\valForm\spac\operatorname
{
#1
}
#2
\mathrel
{
=
}
}
\def\Skip
{
\langkw
{
skip
}}
\def\Assert
{
\operatorname
{
\langkw
{
assert
}}}
\def\Inl
{
\operatorname
{
\langkw
{
inl
}}}
...
...
@@ -82,3 +77,16 @@
\newcommand\valne
{
\ncong
}
\newcommand\litCompareSafe
{
\textlog
{
lit
\_
compare
\_
safe
}}
\newcommand\valCompareSafe
{
\textlog
{
val
\_
compare
\_
safe
}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% VALUE AND EXPRESSION DISAMBIGUATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\valForm
{{
\langkw
{
v
}}}
\def\RecV
#1#2=
{
\langkw
{
rec
}_
\valForm\spac\operatorname
{
#1
}
#2
\mathrel
{
=
}
}
\def\InlV
{
\Inl
_
\valForm
}
\def\InrV
{
\Inr
_
\valForm
}
\newcommand\exprForm
{{
\langkw
{
e
}}}
\def\RecE
#1#2=
{
\langkw
{
rec
}_
\exprForm\spac\operatorname
{
#1
}
#2
\mathrel
{
=
}
}
\def\InlE
{
\Inl
_
\exprForm
}
\def\InrE
{
\Inr
_
\exprForm
}
This diff is collapsed.
Click to expand it.
tex/heaplang.tex
+
10
−
10
View file @
2a680dab
...
...
@@ -19,8 +19,8 @@ The grammar of HeapLang, and in particular its set \Expr{} of \emph{expressions}
\prophid
\mid
{}&
(z
\in
\integer
,
\loc
\in
\Loc
,
\prophid
\in
\ProphId
)
\\
&
\RecV\lvarF
(
\lvar
)=
\expr
\mid
(
\val
,
\valB
)
_
\valForm
\mid
\Inl
(
\val
)
_
\valForm
\mid
\Inr
(
\val
)
_
\valForm
\\
\Inl
V
(
\val
)
\mid
\Inr
V
(
\val
)
\\
\expr
\in
\Expr
\bnfdef
{}&
\val
\mid
\lvar
\mid
...
...
@@ -35,8 +35,8 @@ The grammar of HeapLang, and in particular its set \Expr{} of \emph{expressions}
\Fst
(
\expr
)
\mid
\Snd
(
\expr
)
\mid
{}
\\
&
\Inl
(
\expr
)
_
\exprForm
\mid
\Inr
(
\expr
)
_
\exprForm
\mid
\Inl
E
(
\expr
)
\mid
\Inr
E
(
\expr
)
\mid
\Match
\expr
with
\Inl
=>
\expr
_
1 |
\Inr
=>
\expr
_
2 end
\mid
{}
\\
&
\Alloc
(
\expr
_
1,
\expr
_
2)
\mid
...
...
@@ -154,10 +154,10 @@ The intention of this is to forbid directly comparing large values such as pairs
(
\RecV\lvarF
(
\lvar
)=
\expr
,
\state
,
\nil
)
\\
((
\val
_
1,
\val
_
2)
_
\exprForm
,
\state
)
\hstep
[\nil]
{}&
((
\val
_
1,
\val
_
2)
_
\valForm
,
\state
,
\nil
)
\\
(
\Inl
(
\val
)
_
\exprForm
,
\state
)
\hstep
[\nil]
{}&
(
\Inl
(
\val
)
_
\valForm
,
\state
,
\nil
)
\\
(
\Inr
(
\val
)
_
\exprForm
,
\state
)
\hstep
[\nil]
{}&
(
\Inr
(
\val
)
_
\valForm
,
\state
,
\nil
)
\\
(
\Inl
E
(
\val
),
\state
)
\hstep
[\nil]
{}&
(
\Inl
V
(
\val
),
\state
,
\nil
)
\\
(
\Inr
E
(
\val
),
\state
)
\hstep
[\nil]
{}&
(
\Inr
V
(
\val
),
\state
,
\nil
)
\\
&
\alignheader\textbf
{
Pure reductions
}
\\
((
\RecV\lvarF
(
\lvar
)=
\expr
)(
\val
),
\state
)
\hstep
[\nil]
{}&
(
\subst
{
\subst
\expr
\lvarF
{
(
\Rec\lvarF
(
\lvar
)=
\expr
)
}}
\lvar
\val
,
\state
,
\nil
)
\\
...
...
@@ -183,9 +183,9 @@ The intention of this is to forbid directly comparing large values such as pairs
(
\val
_
1,
\state
,
\nil
)
\\
(
\Snd
((
\val
_
1,
\val
_
2)
_
\valForm
),
\state
)
\hstep
[\nil]
{}&
(
\val
_
2,
\state
,
\nil
)
\\
(
\Match
\Inl
(
\val
)
_
\valForm
with
\Inl
=>
\expr
_
1 |
\Inr
=>
\expr
_
2 end,
\state
)
\hstep
[\nil]
{}&
(
\Match
\Inl
V
(
\val
) with
\Inl
=>
\expr
_
1 |
\Inr
=>
\expr
_
2 end,
\state
)
\hstep
[\nil]
{}&
(
\expr
_
1(
\val
),
\state
,
\nil
)
\\
(
\Match
\Inr
(
\val
)
_
\valForm
with
\Inl
=>
\expr
_
1 |
\Inr
=>
\expr
_
2 end,
\state
)
\hstep
[\nil]
{}&
(
\Match
\Inr
V
(
\val
) with
\Inl
=>
\expr
_
1 |
\Inr
=>
\expr
_
2 end,
\state
)
\hstep
[\nil]
{}&
(
\expr
_
2(
\val
),
\state
,
\nil
)
\end{align*}
\caption
{
HeapLang pure and boxed reduction rules.
\\
\small
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment