Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Glen Mével
cosmo
Commits
f048308d
Commit
f048308d
authored
Feb 25, 2021
by
Glen Mével
Browse files
tweaks to save space in triples
parent
8b372030
Changes
3
Hide whitespace changes
Inline
Side-by-side
papers/icfp2021/figure-queue-invariant.tex
View file @
f048308d
...
...
@@ -91,7 +91,7 @@
\}
\end
{
array
}
\right
)
}
\cr
\begin
{
array
}{
@
{
\!\!
}
c@
{}
l@
{
\;
}
c@
{
\;
}
l
}
% array for aligning the formulas of the two big-stars
\cr
\begin
{
array
}{
@
{
\!\!
}
c@
{}
l@
{
\;
}
c@
{
\;
}
l
@
{}
}
% array for aligning the formulas of the two big-stars
% cells which are empty or being emptied:
\displaystyle\Sep
_{
\head
-
\capacity
\leq
\idx
<
\tail
}&
% cell bearing no value, available for next round:
...
...
papers/icfp2021/figure-queue-spec.tex
View file @
f048308d
\begin{figure}
\[
\begin
{
array
}{
@
{}
l@
{}}
\[
\
small\
begin
{
array
}{
@
{}
l@
{}}
\hoareV
{
\seen\view
_
0
}
...
...
@@ -13,7 +13,7 @@
\lahoareV
{
\begin
{
array
}{
@
{}
l@
{}}
\Forall
\tview
,
\hview
,
\nbelems
,
\elemViewList
*[]
.
\\
\hphantom
{
\Lam\Unit
.
}
\\
\hphantom
{
\Lam\Unit
.
}
\isQueue
\tview
{
\hphantom
(
\hview\hphantom
{{}
\viewjoin\view
)
}}
\elemViewList
\hphantom
{
,
\pair\elem\view
}
\isep
\seen\view
...
...
@@ -28,7 +28,7 @@
\lahoareV
{
\begin
{
array
}{
@
{}
l@
{}}
\Forall
\tview
,
\hview
,
\nbelems
,
\elemViewList
*[]
.
\\
\hphantom
{
\Lam\elem
.
}
\\
\hphantom
{
\Lam\elem
.
}
\isQueue
{
\hphantom
(
\tview\hphantom
{{}
\viewjoin\view
)
}}
\hview
\elemViewList
\isep
\seen\view
\end
{
array
}}
...
...
@@ -40,24 +40,25 @@
% \cr \seen(\tview \sqcup \eview_0)
%}
\isQueue
{
(
\tview
\sqcup
\view
)
}
\hview
{
\elemViewList
<
1
>
*
}
\isep
\seen
(
\tview
\sqcup
\eview
_
0
)
\isep
\elem
=
\elem
_
0
%\isep \seen (\tview \sqcup \eview_0)
\isep
\seen
\tview
\isep
\seen
\eview
_
0
\isep
1
\leq
\nbelems
\isep
\elem
=
\elem
_
0
}
\\\\\\
\lahoareV
{
\begin
{
array
}{
@
{}
l@
{}}
\Forall
\tview
,
\hview
,
\nbelems
,
\elemViewList
*[]
.
%\\ \hspace{118pt}
\\
\hspace
{
23
pt
}
\\
\hspace
{
2
.
9
em
}
\isQueue
\tview
{
\hphantom
(
\hview\hphantom
{{}
\viewjoin\view
)
}}
\elemViewList
\hphantom
{
,
\pair\elem\view
}
\isep
\seen\view
\end
{
array
}}
{
\tryenqueue
~
\queue
~
\elem
}
{
\Lam
\boolval
.
\matchwith
{
\boolval
}
\matchwith
nobinder
{
\boolval
}
{
\False
}{
\isQueue
\tview
{
\hphantom
(
\hview\hphantom
{{}
\viewjoin\view
)
}}
\elemViewList
}
{
\True
}{
%
\isQueue
\tview
{
(
\hview
\sqcup
\view
)
}
{
\elemListSnoc
\elemViewList
{
\pair\elem\view
}}
...
...
@@ -69,25 +70,26 @@
\lahoareV
{
\begin
{
array
}{
@
{}
l@
{}}
\Forall
\tview
,
\hview
,
\nbelems
,
\elemViewList
*[]
.
%\\ \hspace{127pt}
\\
\hspace
{
26
pt
}
\\
\hspace
{
3
.
13
em
}
\isQueue
{
\hphantom
(
\tview\hphantom
{{}
\viewjoin\view
)
}}
\hview
\elemViewList
\isep
\seen\view
\end
{
array
}}
{
\trydequeue
~
\queue
}
{
\Lam
\elemopt
.
\matchwith
{
\elemopt
}
\matchwith
nobinder
{
\elemopt
}
{
\None
}{
\isQueue
{
\hphantom
(
\tview\hphantom
{{}
\viewjoin\view
)
}}
\hview
\elemViewList
}
{
\Some\elem
}{
%
{
\Some
{
\elem
_
0
}
}{
%
%\ISep{%
% 1 \leq \nbelems \isep \elem = \elem_0
% \cr \isQueue {(\tview \sqcup \view)} \hview {\elemViewList<1>*}
% \cr \seen(\tview \sqcup \eview_0)
%}
\isQueue
{
(
\tview
\sqcup
\view
)
}
\hview
{
\elemViewList
<
1
>
*
}
\isep
\seen
(
\tview
\sqcup
\eview
_
0
)
\isep
\elem
=
\elem
_
0
%\isep \seen (\tview \sqcup \eview_0)
\isep
\seen
\tview
\isep
\seen
\eview
_
0
\isep
1
\leq
\nbelems
%\isep \elem = \elem_0
}
}
...
...
papers/icfp2021/notations.tex
View file @
f048308d
...
...
@@ -280,12 +280,18 @@
% \end{array}\right.
%}
\newcommand
{
\matchwith
}
[5]
{
%
%\mathord\lor
\left
[
\begin{array}
{
@
{
\,
}
ll@
{}}
#3
&
\text
{
if
}
#1 = #2
\\
#5
&
\text
{
if
}
#1 = #4
\end{array}
\right
.
}
\newcommand
{
\matchwithnobinder
}
[5]
{
%
\mathord\lor
\left
[
\begin{array}
{
@
{
\,
}
l@
{}
l@
{}}
#3
&{}
\isep
#1 = #2
\\
#5
&{}
\isep
#1 = #4
\end{array}
\right
.
}
% the “valid view” predicate:
\newcommand
{
\valid
}
[1]
{
\mathit
{
valid
}
\,
#1
}
...
...
@@ -707,7 +713,8 @@
\newcommand
{
\capacity
}{
\ensuremath
{
C
}}
\newcommand
{
\queue
}{
\ensuremath
{
q
}}
\newcommand
{
\boolval
}{
\ensuremath
{
b
}}
\newcommand
{
\elemopt
}{
\ensuremath
{
v
^
?
}}
%\newcommand{\elemopt}{\ensuremath{v^{\!?}}}
\newcommand
{
\elemopt
}{
\ensuremath
{
v
^{
\!\!\:\raisebox
{
-0.3ex
}{
\scriptsize
?
}}}}
\newcommand
{
\elem
}{
\ensuremath
{
v
}}
\newcommand
{
\status
}{
\ensuremath
{
s
}}
\newcommand
{
\tail
}{
\ensuremath
{
t
}}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment