We begin by fixing the object under discussion: let T denote the given prose to be
transformed. Our immediate task is not yet to perform any
transformation, but to determine the and of T, understood as the minimal
information needed to justify a correct and appropriately targeted
reformulation. Concretely, we seek (i) what T is meant to achieve, (ii) for whom
it is written, and (iii) under what assumptions it operates. We treat
these three items as a specification triple
Σ(T) ≔ (Scope (T), Intent (T), Assump (T)),
whose determination constrains all subsequent choices of structure,
vocabulary, and level of detail.
By we mean the portion of the conceptual universe that T ranges over. We extract from T the ambient domain (e.g. a
mathematical subfield, an algorithmic setting, a narrative situation),
the objects in play (variables, entities, actors), and the admissible
operations (definitions invoked, transformations permitted, the kinds of
claims made). Formally, we may regard Scope (T) as a set of symbols and
relations implicit in T
together with boundary conditions: what the content explicitly includes
and what it deliberately excludes. When T contains constraints
(e.g. assume $x>0$'',only in the finite case’’), these
become part of the scope since they delimit the valid instances.
By we mean the functional role of T: what output state it aims to produce in the reader or in the downstream artifact. We treat intent as a map from inputs to outputs, where inputs are the presumed reader state and contextual data, and outputs are the intended deliverable (a proof, an explanation, a plan, a definition, a critique, a decision procedure). Thus Intent (T) is identified by locating (a) the main claim or goal statement, (b) any secondary goals (motivation, justification, examples), and (c) the success criterion (what would count as having ``achieved’’ the text). In particular, if T asks for a construction, we record the nature of the constructed object and its required properties; if $T argues for a proposition, we record the proposition and the standard of rigor.
By we mean the intended reader class as encoded by the prerequisites and the register. We infer audience via the density of unexplained terms, the reliance on specialized notation, and the expectations about background knowledge. This is reflected in Assump (T) as well: assumptions include both explicit hypotheses (stated conditions) and implicit prerequisites (definitions taken as known, lemmas treated as available, conventions assumed). We therefore partition assumptions into (i) required for truth, and (ii) required for readability. Only the former constrain mathematical validity; the latter constrain presentation.
Operationally, we read T and extract: a goal clause (intent), a vocabulary list and boundary clauses (scope), and a prerequisite list plus all stated conditions (assumptions). The resulting Σ(T) functions as the contract for transformation: it determines what must be preserved invariant (the goal and constraints), what may be re-encoded (order, phrasing, auxiliary exposition), and what must be made explicit when shifting to a different formal register.
We now pass from the specification triple Σ(T) to an explicit of the
content of T. Concretely, we
define a context map
𝒞(T) ≔ (Given(T), Required(T), Process(T), Result(T)),
where each component is a finite, labeled collection of extracted items,
together with a dependency relation encoding how later items are
justified by earlier ones. Our aim is to separate what is assumed from
what is demanded, and what is performed from what is produced, without
altering the underlying commitments of T.
We treat as typed symbols. Thus an extracted term is recorded as a
pair (s, τ), where
s is the surface token
(e.g. graph'',loss function’‘,
character'') and $\tau$ is an inferred sort (object, set, map, predicate, procedure, data structure, etc.). Terms are placed into $\mathsf{Given}(T)$ when they are introduced as already available (inputs, ambient objects, fixed conventions), and into $\mathsf{Required}(T)$ when the text demands their construction or identification (outputs, targets, witnesses). Constraints are recorded as predicates on terms; for example a clause of the formassume
x > 0’’ contributes the
constraint (x > 0) attached
to the term x, whereas ``only
in the finite case’’ contributes a global guard restricting the ambient
domain. When T contains
quantitative bounds or admissibility conditions, we record them as
explicit hypotheses rather than as prose qualifiers.
We next extract . Inputs are those terms and data items that appear free in the goal statement(s) without being constructed by the text; these are placed in Given(T) with their required interfaces (types, dimensions, allowed operations). Outputs are those items that the text claims to deliver: a proposition to be proved, an algorithm to be described, a reformulation to be produced, or a structured artifact (e.g. a list of slots). These are placed in Result(T), while the obligations they must satisfy (correctness conditions, invariants, format constraints) populate Required(T). In particular, if T requests a transformation, then the transformed object is a Result item and the preservation requirements (what must remain invariant) are Required items.
We then extract the as Process(T). Here we record each
operation as an abstract action with preconditions and postconditions.
Discourse markers (first'',then’‘,
finally'',in order to’‘) induce a partial order;
subordinate clauses (``to do α, we must first establish β’’) induce a dependency edge β → α. When steps are
iterative or branching, we record the control structure (loop, case
split, recursion) as part of the process item. Formally, we maintain a
directed acyclic graph on extracted items, where an edge u → v indicates that v semantically presupposes u (use of a definition, invocation
of a constraint, reliance on a prior subresult).
The output 𝒞(T) is thus a normalized inventory: what is present, what is demanded, what is done, and what is delivered, each annotated with dependencies sufficient to reconstruct the intended deductive or procedural structure.
Let T be the fragment to be transformed, whose imperative content is the directive: ``map each idea into explicit context slots, labeling what is , , , and .’’ We treat this directive itself as an object-level specification of a transformation, and we therefore slot its constituents into 𝒞(T) by making explicit the inputs it presupposes, the obligations it imposes, the actions it requests, and the artifact it claims to produce.
We take as already available: (i) a finite collection of extracted
from T (at minimum, the
directive contains the ideas map,''idea,’’ ``context
slot,’’ and the four labels); (ii) the vocabulary of slots {Given, Required, Process, Result} together
with their intended reading; and (iii) a representation scheme in which
each idea can be written as a term (possibly with type) and, when
applicable, as a predicate constraint. Formally, we assume a domain of
candidate items I(T)
and an ambient typing discipline sufficient to distinguish objects,
actions, and deliverables.
The directive imposes the following obligations. First, we must
produce an explicit classification function
λ : I(T) → {Given, Required, Process, Result}
(or, equivalently, four disjoint labeled subcollections whose union is
I(T)), together with
any necessary attachments (types, constraints). Second, we must ensure
that each idea is placed into a slot compatible with the slot semantics:
assumptions must not be mislabeled as outputs, and actions must not be
mislabeled as static premises. Third, we must represent the directive
``map’’ as an executable or at least well-ordered procedure, so that the
resulting structure determines a rewrite that increases explicitness
without changing commitments.
The output is a rewritten version of T in which the directive is realized as a concrete, slot-indexed specification: a quadruple 𝒞(T) (possibly with a dependency graph) and a corresponding ordered presentation. Concretely, we deliver (i) explicit lists Given(T), Required(T), Process(T), Result(T) whose union covers the extracted ideas, and (ii) a normalized narration in which each sentence can be read as declaring an assumption, stating an obligation, performing an action, or recording an obtained artifact.
We assume that the contextualization stage has already produced a slotting 𝒞(T) of the relevant material, i.e. explicit collections Given(T), Required(T), Process(T), Result(T) together with the dependency relation → registering admissible order. We furthermore assume that each extracted item has a representation as a well-typed term, predicate, action schema, or artifact description, so that subsequent rewriting can be stated as syntactic transformation guided by semantic role. Finally, we take as fixed a criterion of meaning preservation: two renderings are equivalent when they impose the same commitments on the ambient context (same presuppositions, obligations, and deliverables) up to definitional expansion and renaming.
The directive
rewrite the content using the mapped structure'' requires that we produce an ordered sequence of \emph{slot-aligned beats} that (i) collectively mention all items in $\mathcal{C}(T)$ that are relevant to the rewritten passage, (ii) respect the dependency constraints induced by $\to$, and (iii) replace vague or implicit relations by explicit logical form (quantifiers, antecedents, and scope) without strengthening or weakening the commitments. In particular, if a sentence in the original relies on an implicit subject (e.g.\ an unspokenwe’‘),
an implicit object
(e.g. this'' referring to a prior step), or an implicit modality (e.g.\should’’
meaning an obligation), then the rewrite must introduce the
corresponding explicit referent and deontic status in the appropriate
slot. We also require coherence: each beat must be locally intelligible
given preceding beats, and the whole must read as a connected subtree of
the larger deductive presentation.
We define the rewriting operator as a function
Rewrite : (𝒞(T), → ) → (B1, …, Bn),
where each beat Bk is a sentence
annotated by a slot label in {Given, Required, Process, Result}. First, we
choose a linear extension of →
restricted to the items we will mention; we thereby obtain an order in
which prerequisites appear before dependent actions or conclusions.
Second, for each item x, we
render it in a canonical surface form determined by its slot: premises
become explicit assumptions
(e.g. assume $P(x)$''), obligations become explicit goals (e.g.\it
suffices to exhibit y such
that ’‘), actions become explicit operations
(e.g. define'',construct’‘,
apply''), and deliverables become explicit outputs (e.g.\we
obtain ’‘). Third, we address vagueness by introducing explicit binding
and reference: any pronoun is replaced by its antecedent; any implicit
quantification is made explicit
(e.g. for each idea'' becomes $\forall i\in I(T)$); any unspecified comparison standard (e.g.\increase
clarity’‘) is operationalized as a checkable constraint
(e.g. every beat has a slot label and depends only on prior beats''). Fourth, we insert bridging beats when the dependency graph has an edge $u\to v$ but the surface realization of $v$ would be unintelligible without a stated relation; such bridges are themselves placed in $\mathsf{Process}$ if they are actions (e.g.\record
the dependency’’) or in Given if they
are definitional reminders. Finally, we normalize the resulting prose by
eliminating redundancy, while preserving the explicit slot
alignment.
The produced sequence (B1, …, Bn) constitutes a rewritten passage whose structure is visible: the reader can identify what is assumed, what is demanded, what is done, and what is obtained, in an order compatible with →. Meaning is preserved because each original commitment is represented exactly once as either a premise, an obligation, an operation, or an output, and any added material serves only to make implicit scope and reference explicit. Coherence is verified by checking (i) coverage (every referenced symbol is introduced earlier), (ii) well-foundedness (no beat requires a future definition), and (iii) slot consistency (no action is stated as a premise, and no premise is presented as a deliverable). Under these conditions, the rewrite is a faithful expansion that increases explicitness and thereby increases clarity without altering the underlying specification.
We therefore perform an explicit coherence and continuity check on
the produced beat sequence (B1, …, Bn),
treating it as a candidate subtree of a larger derivation. Let Γ0 denote the ambient
stock of globally available declarations (fixed notation, previously
proved lemmas, and the prerequisite definitions assumed in the enclosing
scope). For each k ≥ 1 we
define inductively a running context
Γk := Γk − 1 ∪ Decl(Bk),
where Decl(Bk) is the
set of newly introduced symbols, bound variables, hypotheses, goals,
action outputs, and named artifacts introduced by Bk (including
explicit binders such as ∀x ∈ X and explicit
constructions such as ``define f by ’’).
We check by computing, for each beat Bk, the set
Use(Bk) of
free symbols and unresolved referents occurring in Bk after parsing
quantifier scope and anaphora. The condition is
Use(Bk) ⊆ Γk − 1 for
all k = 1, …, n,
so that every term and predicate employed at step k is already available from prior
beats or from Γ0.
Any violation is repaired only by inserting an earlier beat whose slot
matches the needed status: if the missing item is definitional, we
insert a Given reminder; if it is an
intermediate construction, we insert a Process beat; if it is an unmentioned
obligation needed to justify an action, we insert a Required beat.
We check relative to the given relation → by selecting (or verifying) an index
function ι from mentioned
items to beat positions such that u → v implies ι(u) < ι(v).
In addition, for each dependency edge u → v we require that the
surface rendering contains an explicit inferential bridge: either Bι(v)
states that it invokes u
(e.g. apply $u$ to obtain \dots''), or there exists some $k$ with $\iota(u)<k\le \iota(v)$ whose content makes the applicability condition of $u$ to the situation of $v$ explicit. This preventsmissing
links’’ where the order is correct but the reader cannot see why the
edge is admissible.
We check by verifying that each beat’s illocution matches its label: Given beats introduce assumptions and definitions without asserting new deliverables; Required beats state goals or subgoals; Process beats perform constructions, applications, or transformations; Result beats assert obtained outputs. Formally, if Slot(Bk) = s, then the main predicate form of Bk must lie in the canonical class associated to s (assumption/goal/action/output, respectively). When a sentence mixes roles, we split it into multiple beats so that each commitment is stated exactly once and in the correct slot.
We check by isolating the external boundary. Let ExtUse(Bk) := Use(Bk) \ Γ0. The closure requirement is that every element of ⋃kExtUse(Bk) is introduced somewhere in ⋃kDecl(Bk), i.e. the subtree is internally self-supplying except for the explicitly admitted ambient context Γ0. Equivalently, no beat relies on an unstated lemma, definition, or artifact that is neither in Γ0 nor introduced earlier in the subtree.
Finally, we check by a monotonicity constraint on commitments: if Γk is read as the cumulative set of standing hypotheses and available constructions after beat k, then each subsequent beat is interpretable as an operation on Γk − 1 yielding Γk without retracting prior commitments. This is verified syntactically by forbidding backward references that change the status of previously introduced material (e.g. converting a previously assumed statement into a goal) and by ensuring that each new quantifier binder has a clear scope contained within the beat where it is introduced. Under these checks, the sequence reads as a complete, gap-free subtree: every reference is grounded, every dependency is witnessed, and the local logical flow is determined solely by the preceding beats and the declared ambient context.