The Setting
An observation of a dependent function records its response to a typed argument and an optional observation of that argument. The types at which these observations are available are selected by signed paths between sort profiles. Candidate readouts then assign sets of strongly normalizing terms to substituted types.
Fix a pure type specification , with arbitrary axiom and product-rule relations.✦ Terms are variables, sorts, applications, annotated abstractions , and dependent products .✦ Write for typing and for the equivalence relation generated by full reduction, including reduction in annotations and binder bodies. A valid context is obtained from the empty context by extensions with .✦ Substitution into newest-first contexts uses de Bruijn indices; named binders in the formulas denote capture-avoiding substitution.
Assume system weak normalization: in every valid context, both the subjects and the expected types of typing judgments have a normal form.✦ Write for a chosen normal form. For sets of sorts, the sort profile, axiom successors, and product outputs are the sets in (1). (1) A feasible profile is a nonempty set for a normal term in a valid context.✦ A feasible product triple, written , consists of three feasible profiles with .✦
A term is legal in when it occurs as the subject or the expected type of a typing judgment in .✦
The primary signed graph has positive edges for proper inclusions between feasible profiles. Each feasible product triple gives a negative edge and a positive edge . A signed walk has sign or according to the parity of its negative edges; the empty walk has sign .✦ For a signed graph , write for a walk of sign and when its sign is unrestricted. Write for a walk using only positive primary edges.✦ A strongly connected component is a nonempty set of all vertices mutually reachable with one of its vertices.✦
A saturated context tower is a sequence of valid context prefixes of length at stage , each extending its predecessor by a sorted type, in which every type available in a prefix is declared again arbitrarily late.✦ Tower terms use fixed levels for free variables; means that some prefix types both and after level-to-index reversal.✦ Write .✦
The top set , ground set , and tested stacks at a type are defined together by (2) and the stack clause below, where means strong normalization for full reduction and denotes left-associated application. (2) A tested stack at a tower type is an argument list that is empty, or, at , has first argument and a tail tested at .✦ A normalization candidate at a tower type is a set between and closed under typed head expansion: if has tower type , its annotation, body and arguments are strongly normalizing, and belongs to , then so does the uncontracted term.✦ Strong normalization of an argument list uses reduction of one component at a time.
An actual type is a term that is either a sorted normal term in the tower or a literal sort.✦ Write for the collection of normalization candidates at .✦ A base assignment chooses a member of for every actual type .✦ The top assignment chooses at every coordinate✦, and a coordinate update replaces the candidate at one specified actual type.✦
The Definition
Definition 1. Let be a family of sort profiles. The set of observation layers relative to consists of the profiles specified by (3). (3)✦ The secondary signed graph is specified by (4), where and denote the positive and negative edge relations of . (4)✦ A direct layer relative to is an observation layer that occurs as the domain of a feasible product triple whose other profiles lie in , as in (5). (5)✦ An active layer relative to is a profile from which a direct layer is reachable in the secondary graph, as in (6). (6)✦ A plain layer relative to is a profile having walks of both signs in the secondary graph to direct layers, with possibly different endpoints, as in (7). (7)✦ A free layer of sign relative to is a nonplain profile with a walk of that sign in the secondary graph to a direct layer, as in (8). (8)✦ A forbidden configuration for and is a strongly connected component of the secondary graph with the properties in (9); the component condition is denoted by . $$\begin{aligned} \mathsf{Forbidden}(P,C)\iff\exists\mathcal D,\quad& \operatorname{SCC}_2(\mathcal D),\quad \forall H\in\mathcal D,\ \mathsf P_C(H),\\ &\exists H,K\in\mathcal D,\ E_2^-(H,K),\\ &\exists I,J,K,s,\quad \mathsf F(I,J,K),\quad J,K,\{s\}\in\mathcal D,\\ &\hspace{27mm}\operatorname{Ax}(s)\ne\varnothing,\quad \operatorname{Ax}(s)\leadsto_{1,+}I. \end{aligned}$$(9)✦
For the observation spaces, let be finite and suppose there is no forbidden configuration. A normalized active type is a normal term with for some sort and .✦ A plain node is a normal term with for some sort and with plain profile .✦ An application key at a normalized active type is a pair consisting of a decomposition and a normal argument with and active profile . Its target is ✦; its optional domain is when the domain profile is active, and is absent otherwise.
A plain observation schema is an assignment of application keys, target nodes, and optional domain nodes to each node.✦ A continuation path from a node is a finite sequence of application keys starting at , each subsequent key being at the preceding target.✦ A slot of a continuation path is an occurrence of a domain node along , with distinguishing occurrences.✦ Parameters for a path assign an observation to each slot✦; parameters for one frame assign an observation to its optional domain.✦ The recursive domain relation holds when a key on a continuation path from has domain node .✦
For a plain observation schema whose recursive domain relation is well-founded, the plain observation space is the recursive table space in (10), where is the set of base outputs, is the set of continuation paths from , and consists of the domain-node occurrences along , with distinguishing occurrences, including repeated ones. (10)✦ The actual plain schema uses the plain nodes and application keys above; an active domain is itself a plain node.✦ Prefix decomposition separates the empty path’s base output from the continuation at each first key.✦ A constant table with output is the distinguished plain observation.✦ For a family of parameter spaces, a plain observation table at assigns a base output in to each continuation path from and each assignment of an element of to every occurrence of a domain node on that path.✦
For sets and a set of opposite observations, a free frame is a pair consisting of a key in and a payload in .✦ Its continuation stacks are finite lists of frames✦, and an exit stack is a continuation stack followed by a terminal frame.✦ A free table assigns a base output to each continuation stack and an exit output to each exit stack.✦ Write for this table space. The negative and positive spaces are given by (11), using the stage inclusions induced by double reindexing of tables. $$X_0=\varnothing,\qquad X_{n+1}=\mathcal T(\mathcal T(X_n)),\qquad \mathcal M=\varinjlim_n X_n,\qquad \mathcal U=\mathcal T(\mathcal M).$$(11) Each negative observation has a represented behavior in . Finite stages embed into ✦, and positive tables restrict along these embeddings.✦ Reindexing changes opposite payloads; slicing prefixes one frame to each stack.✦ Constant tables give positive and negative defaults. A negative behavior determines a negative observation by choosing a representative when it has one, and by taking the default otherwise.✦ Finite stage behavior assigns a table over to each finite stage observation; at stage it reindexes the observation along restriction of positive tables to stage .✦ The negative observation slice of at a frame over is a chosen negative observation whose represented behavior is the slice of the represented behavior of .✦ A raw lambda table over is specified by a base output, a negative observation for each first frame, and an exit output for each terminal frame. Its empty continuation has the prescribed base output, a lone terminal frame uses the exit output, and every longer stack uses the represented behavior of the negative observation selected by its first frame.✦
For actual observations, take to be the term set, , and to be the set of pairs with a plain node and ; take . A raw observation is a plain pair, a positive observation in , or a negative observation in .✦ Write for their disjoint union. A raw observation fits an actual type when it is a plain observation at exactly , a positive observation with , or a negative observation with .✦ The typed observation space is (12). (12)✦ An optional payload fits an actual type when is absent and is inactive, or is present and its value fits .✦ An active matching payload determines a typed value.✦ The base assignment of an observation is its empty-path output, using represented behavior for a negative observation.✦
Each normalized active type has a distinguished value in . The prescribed base value at for has empty-path output and retains all nonempty observations of the distinguished default.✦ For a normalized active type , observation value application sends a value , an application key at , and a matching domain payload to a typed observation value at the key’s target. A lambda action at a normalized active type is an assignment of a typed observation value at the target to every application key at and matching domain payload.✦ Plain lambda values use prefix decomposition. Free lambda values use continuation tables until a plain target gives an exit. The gate for a frame requires its argument and payload to match a key, and its exit flag to agree with plainness of the target.✦ Ineligible continuations use the top base assignment and an absent exit. Projection retains a fitting raw value and otherwise selects a distinguished value✦; an exit uses this projection on a present plain value and the distinguished value on an absent one.✦ Plain payload encoding turns a matching optional payload for a plain application key into its single frame parameters, retaining the matching plain observation.✦ Plain payload decoding returns the plain observation at the domain node when the domain profile is active, and returns absence otherwise.✦ A positive application frame has a term as its key and a payload that is absent, a tagged plain observation, or a negative observation.✦ A negative application frame has a term as its key and a payload that is absent, a tagged plain observation, or a positive observation.✦ Positive frame payload encoding at a positive free type retains absence and plain observations and places a matching negative observation in the opposite payload.✦ Positive frame payload decoding returns the corresponding absent, plain, or negative raw payload.✦ Negative frame payload encoding at a negative free type retains absence and plain observations and places a matching positive observation in the opposite payload.✦ Negative frame payload decoding returns the corresponding absent, plain, or positive raw payload.✦ The default plain observation at a plain node is the constant plain table whose output is the top candidate assignment.✦ Plain observation application at a plain source takes the continuation coordinate of its prefix decomposition at the application key and matching domain payload, giving a typed value at the normalized target.✦ The positive lambda continuation at a positive free type uses the positive observation in the lambda action result when the decoded frame passes the continuation gate; otherwise it is the positive default with top base assignment and absent exit.✦ The negative lambda continuation at a negative free type uses the negative observation in the lambda action result when the decoded frame passes the continuation gate; otherwise it is the negative default with top base assignment and absent exit.✦ The lambda exit operation returns a tagged plain observation from the lambda action when the decoded frame passes the exit gate, and returns absence otherwise.✦ The positive lambda table has the top candidate assignment on the empty continuation, follows the positive lambda continuation after a first continuing frame, and uses the lambda exit operation with positive payload decoding at a terminal frame.✦ The negative lambda behavior is the raw lambda table with top candidate assignment as base, negative lambda continuation as body action, and the lambda exit operation with negative payload decoding as exit action.✦
A typing tree at is a finite tree generated by (13), every node satisfying its displayed ordinary typing judgment. Write for the collection of these trees and for context lookup with expressed in the full context. (13)✦
An observation environment for a context is a pair consisting of an actual substitution and optional parameters satisfying (14). (14)✦ Extension by an argument of tower type and a matching payload extends both the actual substitution and its parameters.✦ A typing judgment determines the actual type ✦; a judgment also determines the actual expression .✦
For a typing tree with root and an observation environment , put and . Structural preevaluation of a typing tree in an observation environment is the pair of value and candidate readout in (15). (15)✦ The variable operation uses context lookup in the environment. The sort operation gives a distinguished value and the top readout.✦ Abstraction and application use lambda actions and value application. The optional parameter of a result is its value when the expected type is active, and is absent otherwise.✦ A base readout takes the observation’s base assignment at when , the expected type is a literal sort with , and is active; in every other case it is .✦ A base evaluation result pairs the assigned observation values at an active expected type with their base candidate readout.✦
A product instance is a tuple consisting of formation judgments and , a permitted rule , and an observation environment .✦ Its substituted domain and body are and , where fixes the bound variable and shifts the images of the other variables. Their normal forms are denoted , and . Given a domain readout and body readouts indexed by typed arguments and matching payloads, the product candidate is the indexed product test in (16). (16)✦ Product evaluation uses the domain and body evaluation readouts in this test to obtain its candidate readout.✦ When its expected type is active, its product observation updates the candidate coordinate at the normalized substituted product with this product candidate. Its body environments extend by the tested argument and its payload.✦ The raw instantiated target substitutes the tested argument for the bound variable of the product body and the environment images for its other free variables.✦ Its chosen normal form is the normalized instantiated target .✦ The product tester set uses the domain readout when the normalized domain profile lies in , and the top set at that domain otherwise.✦ The product candidate fibers collect all body candidates over matching payloads when has the normalized domain type and its target profile lies in ; for a typed argument outside that case they contain only the top set at its target, and for an untyped argument they are empty.✦ For a typed argument with active target, the normalized argument frame is the application key at the normalized product whose argument is , whose domain and body are and , and whose target retains the same normal form.✦
For a typing tree and a raw actual substitution , the recursive evaluation goodness conditions concern its value and readout. The two goodness predicates are (17) and (18). (17)✦ (18)✦ At a variable, the value condition is automatic; at a sort, both conditions are automatic. For a product with domain subtree , body subtree , and result sort , the required recursive condition is readout goodness of when , together with readout goodness of at every whose substituted body has profile in . The product value condition imposes this requirement when both and the substituted product profile lies in ; its readout condition imposes it when the latter profile lies in . The abstraction value clause requires value goodness of the body for every typed argument with active target. For application, an active function type requires value goodness of the function and of the argument when its domain is active; an inactive function type requires a neutral application.
For , the normal readout is the readout obtained by preevaluating a chosen typing tree for , regarded as a candidate at .✦ The component interpretation of a term in context and observation environment is the set in (19), using a chosen sort witness in its first case. (19)✦
What Is Checked
The layer definitions concern the primary profile graph of a specification and a family of profiles. The observation constructions concern a finite sort set, a saturated context tower, system weak normalization, and exclusion of the forbidden configuration; evaluation takes a typing tree and a typed observation environment, while goodness is stated for a raw substitution.
Every typing judgment admits a typing tree.✦ Exclusion of the forbidden configuration makes the actual plain domain dependency well-founded.✦ A nonplain continuation of a free application key retains its sign✦, and decoding plain frame parameters gives a matching payload.✦ Normalization of a substituted product has domain and body ✦; a tester typed at is also typed at the substituted domain✦, and the body substitution determined by a frame has the frame target as its normal form.✦ Every dependent product occurring as the type of a function has a sort.✦ At a plain node every typed value is represented by a plain observation✦, while at a positive or negative free type every typed value has the corresponding free tag.