Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sgdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gradual-typing
sgdt
Commits
1fe7e8e8
Commit
1fe7e8e8
authored
1 year ago
by
Eric Giovannini
Browse files
Options
Downloads
Patches
Plain Diff
remove section on topos of trees model
parent
1d62639d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
paper-new/technical-background.tex
+0
-144
0 additions, 144 deletions
paper-new/technical-background.tex
with
0 additions
and
144 deletions
paper-new/technical-background.tex
+
0
−
144
View file @
1fe7e8e8
...
...
@@ -154,147 +154,3 @@ Guarded Cubical Agda \cite{veltri-vezzosi2020}, an implementation of Clocked Cub
% TODO axioms (clock irrelevance, tick irrelevance)?
\subsubsection
{
The Topos of Trees Model
}
The topos of trees model provides a useful intuition for reasoning in SGDT
\cite
{
birkedal-mogelberg-schwinghammer-stovring2011
}
.
This section presupposes knowledge of category theory and can be safely skipped without
disrupting the continuity.
The topos of trees
$
\calS
$
is the presheaf category
$
\Set
^{
\omega
^
o
}$
.
%
We assume a universe
$
\calU
$
of types, with encodings for operations such
as sum types (written as
$
\widehat
{
+
}$
). There is also an operator
$
\laterhat
\colon
\later
\calU
\to
\calU
$
such that
$
\El
(
\laterhat
(
\nxt
A
))
=
\,\,
\later
\El
(
A
)
$
, where
$
\El
$
is the type corresponding
to the code
$
A
$
.
An object
$
X
$
is a family
$
\{
X
_
i
\}
$
of sets indexed by natural numbers,
along with restriction maps
$
r
^
X
_
i
\colon
X
_{
i
+
1
}
\to
X
_
i
$
(see Figure
\ref
{
fig:topos-of-trees-object
}
).
These should be thought of as ``sets changing over time", where
$
X
_
i
$
is the view of the set if we have
$
i
+
1
$
time steps to reason about it.
We can also think of an ongoing computation, with
$
X
_
i
$
representing the potential results of the computation
after it has run for
$
i
+
1
$
steps.
\begin{figure}
% https://q.uiver.app/?q=WzAsNSxbMiwwLCJYXzIiXSxbMCwwLCJYXzAiXSxbMSwwLCJYXzEiXSxbMywwLCJYXzMiXSxbNCwwLCJcXGRvdHMiXSxbMiwxLCJyXlhfMCIsMl0sWzAsMiwicl5YXzEiLDJdLFszLDAsInJeWF8yIiwyXSxbNCwzLCJyXlhfMyIsMl1d
\[
\begin
{
tikzcd
}
[
ampersand replacement
=
\&
]
{
X
_
0
}
\&
{
X
_
1
}
\&
{
X
_
2
}
\&
{
X
_
3
}
\&
\dots
\arrow
[
"
{
r
^
X
_
0
}
"', from
=
1
-
2
, to
=
1
-
1
]
\arrow
[
"
{
r
^
X
_
1
}
"', from
=
1
-
3
, to
=
1
-
2
]
\arrow
[
"
{
r
^
X
_
2
}
"', from
=
1
-
4
, to
=
1
-
3
]
\arrow
[
"
{
r
^
X
_
3
}
"', from
=
1
-
5
, to
=
1
-
4
]
\end
{
tikzcd
}\]
\caption
{
An example of an object in the topos of trees.
}
\label
{
fig:topos-of-trees-object
}
\end{figure}
A morphism from
$
\{
X
_
i
\}
$
to
$
\{
Y
_
i
\}
$
is a family of functions
$
f
_
i
\colon
X
_
i
\to
Y
_
i
$
that commute with the restriction maps in the obvious way, that is,
$
f
_
i
\circ
r
^
X
_
i
=
r
^
Y
_
i
\circ
f
_{
i
+
1
}$
(see Figure
\ref
{
fig:topos-of-trees-morphism
}
).
\begin{figure}
% https://q.uiver.app/?q=WzAsMTAsWzIsMCwiWF8yIl0sWzAsMCwiWF8wIl0sWzEsMCwiWF8xIl0sWzMsMCwiWF8zIl0sWzQsMCwiXFxkb3RzIl0sWzAsMSwiWV8wIl0sWzEsMSwiWV8xIl0sWzIsMSwiWV8yIl0sWzMsMSwiWV8zIl0sWzQsMSwiXFxkb3RzIl0sWzIsMSwicl5YXzAiLDJdLFswLDIsInJeWF8xIiwyXSxbMywwLCJyXlhfMiIsMl0sWzQsMywicl5YXzMiLDJdLFs2LDUsInJeWV8wIiwyXSxbNyw2LCJyXllfMSIsMl0sWzgsNywicl5ZXzIiLDJdLFs5LDgsInJeWV8zIiwyXSxbMSw1LCJmXzAiLDJdLFsyLDYsImZfMSIsMl0sWzAsNywiZl8yIiwyXSxbMyw4LCJmXzMiLDJdXQ==
\[
\begin
{
tikzcd
}
[
ampersand replacement
=
\&
]
{
X
_
0
}
\&
{
X
_
1
}
\&
{
X
_
2
}
\&
{
X
_
3
}
\&
\dots
\\
{
Y
_
0
}
\&
{
Y
_
1
}
\&
{
Y
_
2
}
\&
{
Y
_
3
}
\&
\dots
\arrow
[
"
{
r
^
X
_
0
}
"', from
=
1
-
2
, to
=
1
-
1
]
\arrow
[
"
{
r
^
X
_
1
}
"', from
=
1
-
3
, to
=
1
-
2
]
\arrow
[
"
{
r
^
X
_
2
}
"', from
=
1
-
4
, to
=
1
-
3
]
\arrow
[
"
{
r
^
X
_
3
}
"', from
=
1
-
5
, to
=
1
-
4
]
\arrow
[
"
{
r
^
Y
_
0
}
"', from
=
2
-
2
, to
=
2
-
1
]
\arrow
[
"
{
r
^
Y
_
1
}
"', from
=
2
-
3
, to
=
2
-
2
]
\arrow
[
"
{
r
^
Y
_
2
}
"', from
=
2
-
4
, to
=
2
-
3
]
\arrow
[
"
{
r
^
Y
_
3
}
"', from
=
2
-
5
, to
=
2
-
4
]
\arrow
[
"
{
f
_
0
}
"', from
=
1
-
1
, to
=
2
-
1
]
\arrow
[
"
{
f
_
1
}
"', from
=
1
-
2
, to
=
2
-
2
]
\arrow
[
"
{
f
_
2
}
"', from
=
1
-
3
, to
=
2
-
3
]
\arrow
[
"
{
f
_
3
}
"', from
=
1
-
4
, to
=
2
-
4
]
\end
{
tikzcd
}\]
\caption
{
An example of a morphism in the topos of trees.
}
\label
{
fig:topos-of-trees-morphism
}
\end{figure}
The type operator
$
\later
$
is defined on an object
$
X
$
by
$
(
\later
X
)
_
0
=
1
$
and
$
(
\later
X
)
_{
i
+
1
}
=
X
_
i
$
.
The restriction maps are given by
$
r
^
\later
_
0
=
\,
!
$
, where
$
!
$
is the
unique map into
$
1
$
, and
$
r
^
\later
_{
i
+
1
}
=
r
^
X
_
i
$
.
The morphism
$
\nxt
^
X
\colon
X
\to
\later
X
$
is defined pointwise by
$
\nxt
^
X
_
0
=
\,
!
$
, and
$
\nxt
^
X
_{
i
+
1
}
=
r
^
X
_
i
$
. It is easily checked that
this satisfies the commutativity conditions required of a morphism in
$
\calS
$
.
%
Given a morphism
$
f
\colon
\later
X
\to
X
$
, i.e., a family of functions
$
f
_
i
\colon
(
\later
X
)
_
i
\to
X
_
i
$
that commute with the restrictions in the appropriate way,
we define
$
\fix
(
f
)
\colon
1
\to
X
$
pointwise
by
$
\fix
(
f
)
_
i
=
f
_{
i
}
\circ
\dots
\circ
f
_
0
$
.
This can be visualized as a diagram in the category of sets as shown in
Figure
\ref
{
fig:topos-of-trees-fix
}
.
% Observe that the fixpoint is a \emph{global element} in the topos of trees.
% Global elements allow us to view the entire computation on a global level.
% https://q.uiver.app/?q=WzAsOCxbMSwwLCJYXzAiXSxbMiwwLCJYXzEiXSxbMywwLCJYXzIiXSxbMCwwLCIxIl0sWzAsMSwiWF8wIl0sWzEsMSwiWF8xIl0sWzIsMSwiWF8yIl0sWzMsMSwiWF8zIl0sWzMsNCwiZl8wIl0sWzAsNSwiZl8xIl0sWzEsNiwiZl8yIl0sWzIsNywiZl8zIl0sWzAsMywiISIsMl0sWzEsMCwicl5YXzAiLDJdLFsyLDEsInJeWF8xIiwyXSxbNSw0LCJyXlhfMCJdLFs2LDUsInJeWF8xIl0sWzcsNiwicl5YXzIiXV0=
% \[\begin{tikzcd}[ampersand replacement=\&]
% 1 \& {X_0} \& {X_1} \& {X_2} \\
% {X_0} \& {X_1} \& {X_2} \& {X_3}
% \arrow["{f_0}", from=1-1, to=2-1]
% \arrow["{f_1}", from=1-2, to=2-2]
% \arrow["{f_2}", from=1-3, to=2-3]
% \arrow["{f_3}", from=1-4, to=2-4]
% \arrow["{!}"', from=1-2, to=1-1]
% \arrow["{r^X_0}"', from=1-3, to=1-2]
% \arrow["{r^X_1}"', from=1-4, to=1-3]
% \arrow["{r^X_0}", from=2-2, to=2-1]
% \arrow["{r^X_1}", from=2-3, to=2-2]
% \arrow["{r^X_2}", from=2-4, to=2-3]
% \end{tikzcd}\]
% \begin{figure}
% % https://q.uiver.app/?q=WzAsMTksWzEsMiwiWF8wIl0sWzIsMywiWF8xIl0sWzMsMSwiMSJdLFswLDEsIjEiXSxbMCwyLCJYXzAiXSxbMSwzLCJYXzEiXSxbMSwxLCIxIl0sWzIsMSwiMSJdLFsyLDIsIlhfMCJdLFsyLDQsIlhfMiJdLFszLDIsIlhfMCJdLFszLDMsIlhfMSJdLFszLDQsIlhfMiJdLFszLDUsIlhfMyJdLFs0LDIsIlxcY2RvdHMiXSxbMCwwLCJcXGZpeChmKV8wIl0sWzEsMCwiXFxmaXgoZilfMSJdLFsyLDAsIlxcZml4KGYpXzIiXSxbMywwLCJcXGZpeChmKV8zIl0sWzMsNCwiZl8wIl0sWzAsNSwiZl8xIl0sWzYsMCwiZl8wIl0sWzcsOCwiZl8wIl0sWzgsMSwiZl8xIl0sWzEsOSwiZl8yIl0sWzIsMTAsImZfMCJdLFsxMCwxMSwiZl8xIl0sWzExLDEyLCJmXzIiXSxbMTIsMTMsImZfMyJdXQ==
% \[\begin{tikzcd}[ampersand replacement=\&]
% {\fix(f)_0} \& {\fix(f)_1} \& {\fix(f)_2} \& {\fix(f)_3} \\
% 1 \& 1 \& 1 \& 1 \\
% {X_0} \& {X_0} \& {X_0} \& {X_0} \& \cdots \\
% \& {X_1} \& {X_1} \& {X_1} \\
% \&\& {X_2} \& {X_2} \\
% \&\&\& {X_3}
% \arrow["{f_0}", from=2-1, to=3-1]
% \arrow["{f_1}", from=3-2, to=4-2]
% \arrow["{f_0}", from=2-2, to=3-2]
% \arrow["{f_0}", from=2-3, to=3-3]
% \arrow["{f_1}", from=3-3, to=4-3]
% \arrow["{f_2}", from=4-3, to=5-3]
% \arrow["{f_0}", from=2-4, to=3-4]
% \arrow["{f_1}", from=3-4, to=4-4]
% \arrow["{f_2}", from=4-4, to=5-4]
% \arrow["{f_3}", from=5-4, to=6-4]
% \end{tikzcd}\]
% \caption{The first few approximations to the guarded fixpoint of $f$.}
% \label{fig:topos-of-trees-fix-approx}
% \end{figure}
\begin{figure}
% https://q.uiver.app/?q=WzAsNixbMywwLCIxIl0sWzAsMiwiWF8wIl0sWzIsMiwiWF8xIl0sWzQsMiwiWF8yIl0sWzYsMiwiWF8zIl0sWzgsMiwiXFxkb3RzIl0sWzIsMSwicl5YXzAiXSxbNCwzLCJyXlhfMiJdLFswLDEsIlxcZml4KGYpXzAiLDFdLFswLDIsIlxcZml4KGYpXzEiLDFdLFswLDMsIlxcZml4KGYpXzIiLDFdLFswLDQsIlxcZml4KGYpXzMiLDFdLFswLDUsIlxcY2RvdHMiLDMseyJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJub25lIn0sImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbMywyLCJyXlhfMSJdLFs1LDQsInJeWF8zIl1d
\[
\begin
{
tikzcd
}
[
ampersand replacement
=
\&
,column sep
=
2
.
25
em
]
\&\&\&
1
\\
\\
{
X
_
0
}
\&\&
{
X
_
1
}
\&\&
{
X
_
2
}
\&\&
{
X
_
3
}
\&\&
\dots
\arrow
[
"
{
r
^
X
_
0
}
", from
=
3
-
3
, to
=
3
-
1
]
\arrow
[
"
{
r
^
X
_
2
}
", from
=
3
-
7
, to
=
3
-
5
]
\arrow
[
"
{
\fix
(
f
)
_
0
}
"
{
description
}
, from
=
1
-
4
, to
=
3
-
1
]
\arrow
[
"
{
\fix
(
f
)
_
1
}
"
{
description
}
, from
=
1
-
4
, to
=
3
-
3
]
\arrow
[
"
{
\fix
(
f
)
_
2
}
"
{
description
}
, from
=
1
-
4
, to
=
3
-
5
]
\arrow
[
"
{
\fix
(
f
)
_
3
}
"
{
description
}
, from
=
1
-
4
, to
=
3
-
7
]
\arrow
[
"
\cdots
"
{
marking
}
, draw
=
none, from
=
1
-
4
, to
=
3
-
9
]
\arrow
[
"
{
r
^
X
_
1
}
", from
=
3
-
5
, to
=
3
-
3
]
\arrow
[
"
{
r
^
X
_
3
}
", from
=
3
-
9
, to
=
3
-
7
]
\end
{
tikzcd
}\]
\caption
{
The guarded fixpoint of
$
f
$
.
}
\label
{
fig:topos-of-trees-fix
}
\end{figure}
% TODO global elements?
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