From 4353f331b5ab4af157f576f54b1cc79dd08abb12 Mon Sep 17 00:00:00 2001 From: Chloe Brown Date: Wed, 23 Apr 2025 15:59:22 +0100 Subject: Current state of affairs. --- sec/lang.ltx | 388 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 186 insertions(+), 202 deletions(-) (limited to 'sec/lang.ltx') diff --git a/sec/lang.ltx b/sec/lang.ltx index c7851e2..3b0134a 100644 --- a/sec/lang.ltx +++ b/sec/lang.ltx @@ -4,223 +4,207 @@ \section{Core Language}% \label{sec:lang} -In this section, we describe \lang{} a new calculus with higher-order functions -and regular types~\cite{Squid:unpublished/McBride01}. We start by describing the -types within the language: products, sums, recursive types and functions. We -then describe the syntax which is standard for n-ary products and sums. We also -define a \mapkw{} operation over arbitrary (covariant) functors.\@ \mapkw{} is -necessary to define the equational theory of \foldkw{}, the eliminator for -recursive types. The equational theory has \(\beta\) equalities, but no \(\eta\) -equalities, a consequence of the embedding into System~T. - -Types for \lang{}, in \cref{fig:lang-wf}, are given relative to a context of -type variables. The judgement \(\jdgmnt{ty}{\Theta}{A}\) states that \(A\) is a -well-formed type in with variables from context \(\Theta\). Products and sums -are well-formed when each of the n-ary components are well-formed. The recursive -type \(\mu X. A\) is formed from a type \(A\) in a context extended by \(X\). -The other type formation rules ensure that \(X\) is used strictly positively, -and thus that recursive types are well-formed. In particular the rule forming -function types forbids using any type variables on the left of the arrow. This -forbids the use of type variables in negative positions. The function type -formation rule also forbids variables on the right. This is to forbid types -such as \(\mu X. 1 + \nat \to X\) of countable trees, as such a type cannot be -represented by System~T~\cite{proof}. Well-formed types also respect -substitution: -\begin{proposition}[Type Substitution] -Given \(\jdgmnt{ty}{\Theta}{A}\) and \(\jdgmnt{ty}{\Psi}{B_i}\) where \(i\) -ranges from \(0\) to \(\lvert \Theta \rvert\), we have -\(\jdgmnt{ty}{\Psi}{\FIXME{\sub{A}{X_i/B_i}}}\). -\end{proposition} +\TODO{ + \begin{itemize} + \item introduce core language as STLC with regular types + \end{itemize} +} \begin{figure} -\[ -\begin{array}{ccccc} - \begin{prooftree} - \hypo{ - X \in \Theta - \vphantom{\jdgmnt{ty}{\Theta}{A}} %% Spooky formatting phantom - } - \infer1{\jdgmnt{ty}{\Theta}{X}} - \end{prooftree} - & - \begin{prooftree} - \hypo{\rangeover{\jdgmnt{ty}{\Theta}{A_i}}{i