Concrete surface of the language
The concrete surface of FormaSL defines the writing of .fsl semantic sources and .fsp realizations. The syntax identifies each construct’s category; resolution selects its referents and revisions; formation verifies the applicable contracts’ conditions. Elaboration keeps the correspondence between the authored text and the explicit semantic program.
This reference gathers the rules of the H1 basis with the current modifications of H4, Post-H4 and P8. The H2 compression laws remain by incorporation in H4. The hardenings of computed heads and of R2 aggregate correlation are handled in their own loci.
The edition’s EBNF file organizes the productions in a single consultation surface. Lexical predicates, resolution, formation and completeness conditions described on this page complement the EBNF: recognizing a grammatical expression does not suffice to admit it semantically.
Ratified reconciliation: two bounded loci
This edition incorporates two source reconciliations reproduced against the H1 basis, the H4 amendment and the Post-H4 amendment, now with the owner’s decision recorded on 2026-10-21 (campaign FORMA-DOC-NORMATIVE-SUCCESSION-CLOSEOUT-2026-10; complete record in docs/campaigns/forma-doc-normative-succession-closeout-v0.1/decisoes/OWNER-DECISIONS.md).
G-N09-01 — derivation head: RATIFIED (APPROVED_BY_OWNER). The basis defines rule_head_value = rule_term | bound_expression, and restricts computed values by the R2 profile. Post-H4 makes the role map of rule_atom parenthesized, but presents derive using that simple atom, which does not carry computed head expressions. The ratified form keeps a specialized rule_head_atom with parentheses, whose arguments use rule_head_value, and keeps derive consuming that head. It does not extend the domain of computed values, does not admit them in R1/R3 and does not abandon the R2 binding, finiteness, purity and definition conditions. Premise atoms when and naf remain simple. Executed evidence: productive R2 positive, UNDEFINED without head instantiation, typed refusal COMPUTED_HEAD_VALUE_NOT_ADMITTED, canonical matrix rc02r04 green on this tree.
G-N09-02 — local Claim: RATIFIED AS CANDIDATE GRAMMAR (APPROVED_BY_OWNER, executable admission conditioned). H4 moves the Claim’s roles to the parenthesized map before the metadata body. In the local application assert claim : Relation(...) { ... }, the ratified form inserts claim_role_map after the relation reference; it keeps the declaration’s absence of name, the mandatory emitter and the attribution and basis fields. It does not introduce implicit issuance by execution, nor grant authority to a result. Measured executable state: the current parser admits only the named form and rejects the local form with a typed refusal (INVALID_IDENTIFIER); executable admission requires implementation in a future conditional WP. Until that implementation, the production is ratified grammar without corresponding executable behavior — no PARSER_CONFORMANT claim is issued for this locus.
The other consolidated forms follow the explicit loci of the amendments, including R2’s Source.role. The G-N09-01 productions are NORMATIVE_CURRENT (aligned to the implemented and tested surface); the G-N09-02 production is NORMATIVE_CURRENT_GRAMMAR / EXECUTABLE_ADMISSION_PENDING, and not PARSER_CONFORMANT.
Sources and identifiers
Each .fsl unit contains exactly one module declaration; each .fsp unit, exactly one realization declaration. The source unit, the file path and the module have different identities.
The encoding is UTF-8. Identifiers follow Unicode 17.0.0, with the XID classes of UAX #31 and the core admitting underscore. Identifier comparison uses NFC and is case-sensitive. Raw spelling and position in the source stay available separately from the normalized key. Visual similarity between characters does not establish equality.
An identifier between backquotes allows using a word that would collide with a reserved structural function. The unescaped token _ is an anonymous wildcard; `_` designates an identifier. $name designates a lexical variable and ?name a witness variable in the loci admitting it.
The selectors have their own functions: :: qualifies names; . selects typed members; @ selects the exact revision of a nominal reference; # selects an application locus for realization. The revision binds to the complete nominal reference before member selection.
Spacing, comments and literals
Outside strings and comments, U+0020 space and U+0009 tab are the admitted horizontal spacing. Indentation does not determine the language’s structure. LF, CRLF and CR breaks keep their correspondence with the source and receive a classification: clause terminator, block layout break or soft continuation.
Inside parentheses, brackets and recognized type-argument regions, the break is a soft continuation. Outside them, a complete simple clause uses a terminator line break or ;. Between items of a braced body, layout breaks are lexically trivial. An incomplete expression needs explicit grouping to continue; the break does not create continuation or semantic order by convenience.
// starts a line comment. Consecutive /// lines, immediately before a documentable construct and without an empty line or intermediate token, form its source documentation. The H1 surface does not admit block comments.
Strings use double quotes and admit escapes for backslash, quote, newline, return, tab and u{...}. The Unicode escape contains one to six hexadecimal digits and identifies a valid scalar value, excluding surrogates and values above U+10FFFF. Raw Cc control characters, physical breaks, quotes and backslashes require the treatment defined by the lexical contract. The content of strings and comments does not receive NFC normalization.
Integers and decimals are base ten; underscores only appear between digits. A leading zero does not change the base. There is no H1 exponential syntax and the sign is an operator. Quantities have an ASCII suffix started by a letter, followed by letters, digits or underscores. The meaning of a unit depends on the exact contract of the consuming type, field or slot. There is no universal null literal.
Contract origin and formation
Every material construct obtains its contract through one of four routes: explicit reference; the resolved declaration’s contract; the native contract of the language revision; or structural synthesis defined by the semantic owner. The route and the revision remain reconstructible.
A match query without using uses the Query synthesis foreseen by the language. A non-opaque composition synthesizes its contract from its structure. Synthesis does not mean selecting a contract by similar name, implicit current state or runtime preference.
Contract fields are resolved by the combination of locus, exact revision and field reference. Unknown, ambiguous fields or fields colliding with structural clauses are refused. An extension field cannot hide the introduction of bindings, scopes, categories, authority or source states.
In the eligible instance loci, omitting an empty block means providing an empty set of authored fields to the same exact contract. That applies to analyze, validate, admit, authorize, decide, revise, execution_request, observe and incorporate, besides the corresponding self-delimited local forms. The omission is only valid when no mandatory authored information is missing. Bodies containing Reasoning, transformation, scenario or source evolution semantics remain mandatory.
Expressions and types
Expression precedence goes from member selection to unary operations, multiplication and division, addition and subtraction, comparison, and and or. Bound expressions add witness variables to the common repertoire. A call in expression position requires an exact pure-call contract; a call in application position requires a named semantic application.
Operators are selected by the operands’ contracts, the expected context and the exact basis of types and operators. The language does not adopt truth by coercion, ordering between arbitrary types, unit conversion, precision widening or overflow handling from the host language.
Lists and records are built under exact collection and value contracts. Punctuation does not universally choose set, multiset or sequence, nor introduce Claim, observation, decision or consequence by structural similarity. Query, Reasoning and transformation keep their own value definition and evaluation rules.
Type references admit arguments and parameters with <: bounds. Declarative parameters and application parameters have different roles. The common application parameter is written $x: T and receives the ordinary role fixed by the language revision. A typed dependency is written depends R $x: T. The positive token input is not part of that canonical form.
The signature -> T restricts the static content interface exported under the producer’s contract. It does not change status, completeness, basis, dependencies or outcome vocabulary.
Modules and declarations
Modules gather imports, exports, interfaces, semantic declarations, subtyping, Claims, applications and compositions. Imports and exports can select and rename bindings. Interfaces publish declarations through expose clauses. Module admission does not execute its applications.
The category is the first structural token of the canonical declarations: type, alias type, distinct type, opaque type, relation, theory, ontology, rule, constraint, policy, hypothesis, action and content. The ceremonial prefix define was replaced, not kept as a second canonical form.
Types can have parameters and specialization. The declaration subtype S <: T has its own judgment. Relations declare roles by role, with an admissible type or an accepts contract. Role blocks can declare cardinality with counting unit, multiplicity, ordering, keys, qualification and correlation. A simple role receives no implicit cardinality, order or multiplicity.
Theories and ontologies can declare use, statement and adopt, besides their contracts’ fields. Rules, restrictions and policies keep their own categories even when a theory references them. Content declarations, hypotheses and actions also preserve their functions; declaring content does not perform an assertion or observation.
Claims
A named assertion separates the role map from the content and the act’s metadata: the former appears in parentheses in the header; the latter, in the body. Roles are resolved against the exact relation. Missing mandatory role, duplication, unknown name and inadmissible value receive the corresponding refusal.
The attribution header requires by; for and under have the roles defined by issuance and representation. The admitted qualifications include based_on, valid_at, recorded_at, scope, frame and support.
import claim references an existing assertion. adopt claim, retract claim and supersede claim use their transition contracts. For those three transitions, the exact schema admits the fields by, for, under, based_on, valid_at, recorded_at, scope, frame and support; only by is mandatory. Unknown field is UNKNOWN_CONTRACT_FIELD; repetition is CONTRACT_FIELD_STRUCTURAL_COLLISION; missing by is MISSING_REQUIRED_CONTRACT_FIELD. An empty block, therefore, does not satisfy those transitions.
The values follow the elaboration of the assertion metadata. Enumerating fields does not invent the meaning of their values. Import, adoption, retraction and succession remain semantically distinct events.
Query and binding
match declares a query with signature, optional contract and body. Match items cover relational patterns, paths, conditions, optional blocks, existence, non-existence and alternatives. Groupings, projections, aggregations and selectors organize the result.
The canonical relational pattern keeps the pattern marker, the occurrence’s variable and a named map in parentheses. A new witness variable introduces a binding; a repeated visible variable imposes compatibility. The wildcard _ creates no binding or correlation.
A binding present in all surviving branches is definitely bound. A visible binding that can be missing remains potentially unbound. Local existence variables do not escape; branch variables follow the presence and visibility rules. Absence in an optional block produces no null or unknown.
Empty blocks and empty branches require identity or empty semantics admitted by the Query contract at that locus. Explicit subcontracts of alternatives must be compatible with the origin contract.
limit requires semantic order. any K declares an AnyK selection. order followed by limit only equals top-k when the contract demonstrates that equivalence. top also identifies the tie-break contract. Path-family selection and query-result selection are different loci. A graph view produced by a query keeps Query answer status.
Incidence paths
path binds a path variable to origin and destination ends. A step identifies the relation and the exact origin and destination roles. Repetition declares bounds and can name groups; alternatives make multiplicity explicit as set, multiset or an exact contract.
Each path admits at most one reuse clause and one selector. Composed policies use an appropriate contractual reference, without resolution by first or last clause. each filters and summaries operate over the structure defined by the paths contract.
The semantic order is candidate generation, local predicates, admissibility by reuse or restriction, path selection and the query’s external post-filter. A realization can reorder work when it demonstrates the preservation of that meaning.
repeat n..* requires the exact contract to determine an admissible condition of finiteness, completeness or flow. The construct can be justified by restrictors, reuse, selectors, finite domain or another mechanism admitted by the Query owner. The mere presence of repetition does not provide its own guarantee. Without sufficient basis, formation returns INVALID_UNBOUNDED_PATH_FORMATION. The form repeat n..m, with finite upper bound, has structural finiteness.
Rules and inference
A rule identifies its contract in using, optional witness parameters and clauses. when introduces a positive premise; naf, negation by failure under the appropriate profile and closure basis; where, condition; exists, existential witness; derive, consequence with polarity; aggregate, aggregation proper to the Reasoning profile.
The using target has a defined formation disposition. A theory or ontology provides reasoning authority selected or admitted through an authorized chain. A relation provides content coordinate and dependency, without theory authority; its reachability follows from the admitted rule chain or the declared objectives. Named content participates only under the selected authority, without obtaining authority from objectives or heads. The other categories without disposition at that locus are refused. Selection uses exact identities, not labels, prefixes or source order.
Premise atoms use role maps in parentheses and simple terms. Computed heads add the expressional value category under the R2 value-generation contract. The documentary basis records a production mismatch between the specialized head and the Post-H4 amendment; its resolution is isolated in this edition’s pending record, without creating an alternative form by the consolidator’s decision.
In the R2 executable contract identified by the surface, computed heads admit the arithmetic carrier of variables, literals, references, negative sign and +, -, *, /, with their definition rules. Comparisons and where connectives do not automatically provide boolean values for roles. Pure calls, member selection, lists and records without an R2 value contract are refused with COMPUTED_HEAD_VALUE_NOT_ADMITTED. R1 and R3 do not admit those computed heads. Inputs need positive binding or a concluded aggregate, and value generation cannot form a cycle. If a computed value of a head conjunction is undefined, no head of that conjunction is instantiated for that substitution.
Reasoning aggregates
COUNT, SUM, MIN and MAX are native contracts of the R2 exact operator basis. They do not depend on import and are not selected by a user declaration with similar spelling. The operator’s identity does not transfer to it jurisdiction over source, groups, multiplicity or closure.
COUNT(Relation) counts distinct Reasoning contents of the exact signature in the concluded lower stratum. SUM(Relation.role) and the other reducers use a static source root and the admitted value expression. Execution variables do not choose the signature; pattern-looking calls, multiple roots and COUNT(A.x) as distinct-from-scalars counting are not admitted shortcuts.
The components of by are exactly ?v, Source.role and Source.role as ?v. There are two complete modes: MemberDerived, with member projection and eventual output binding, and SeededCorrelated, with external seed and member projection.
In Source.role as ?v, a positive binding independent of ?v determines the seeded mode; otherwise, the form introduces an output derived from the member. An aggregate output binding does not turn into a seed independent of another aggregate. In by ?v, the abbreviated form requires exactly one distinct role of the exact source explicitly bound to the variable by positive premises. No role generates AGGREGATE_GROUP_CORRELATION_REQUIRED; several generate AMBIGUOUS_AGGREGATE_GROUP_CORRELATION.
Each derived output binding has a single introduction and differs from the aggregate result’s binding; collisions return AGGREGATE_GROUP_BINDER_COLLISION. External references and member projections keep separate environments. The structural order of the group tuple is preserved. A fully seeded tuple can establish an empty group; a mixed tuple without surviving member does not fabricate the missing derived coordinate.
Transformation, governance and scenarios
analyze selects its analysis contract; infer declares the reasoning basis and objectives. transform declares sources and construction rules. Each transformation rule identifies the correspondence and the contribution mode: per match occurrence, per distinct key or per group. Target construction keeps keys, roles, references and the collision, coverage and loss policies. Building the target does not imply modifying the origin nor authorizes reverse update.
validate, admit, authorize, decide and revise are applications with different contracts. execution_request and observe keep request, attempt, effect and acquisition separate. Acquisition failure does not become negative observation.
scenario fixes a basis by from, admits qualifications and deltas defined by its contract and composes operations within the hypothetical context. assume, mask, substitute, introduce local and transition hypothetical have their own reaches. A scenario’s authority provides no output to the base world.
evolve source declares basis, agent and changes of bindings or content. incorporate is its own transition, whose contract requires the pertinent artifact, source, basis, agent and authority references. Preparing source and introducing an authoritative state are different events.
Composition and scope
let binds a result. stage identifies a named application locus in the composition. order establishes semantic precedence; couple expresses coupling under a contract. Stage labels are declared in the relational scope before resolving order and coupling; duplicates are refused. Result variables keep lexical scope and data dependency.
The named invocation is written Application(argument: value) in application position, without apply. In expression position, the same syntactic appearance requires a pure-call contract. The locus fixes the expected category before resolution.
The passage of result to content is explicit and only uses members the contract exports. case resolves names, arities and types by the examined result’s outcome vocabulary. Its bindings are local to the branch. return and unresolved also follow the composition’s contract.
In a structurally synthesized composition, an authored unresolved joins the completion surface and can introduce the corresponding outcome, subject to the formation and the result’s interface. Under an exact external contract, that outcome must already be admitted. None of those rules automatically turns timeout, cancellation, provider failure or gas exhaustion into semantic inconclusiveness.
Synthesis keeps the composition’s identity and revision, interfaces, loci, dependencies, order, couplings, outcome routes, reachability, completion obligations, lifecycle interactions, realization requirements and correspondence with the source.
Realization .fsp
Realization values cover literals, qualified references, external references, lists and realization-specific records. They do not receive semantic $ variables nor pure .fsl calls by implicit inheritance.
A target starts with the category: app, stage, composition, module, source or capability; it does not use the old for prefix. app X identifies the application declaration; stage Owner#s, the exact application-occurrence locus. Ambiguous or invalid targets are refused.
bind associates a slot to a value; require declares a requirement; limit bounds resources; prefer expresses preference; budget establishes a budget. Slots and values are verified by the target’s exact schema. An external reference is not a secret in plain text. Late provider binding does not authorize late choice of meaning.
Realization groups use unique members per resolved locus and joint obligations. Satisfying each member in isolation does not demonstrate the joint satisfaction. A unitary group is only admitted when its contract makes it non-vacuous of effect. The group can realize an existing semantic coupling, but not create it.
More specific scopes can complete choices and strengthen compatible requirements; they do not weaken semantic requirements or mandatory restrictions. Source order does not define priority.
Correspondence and diagnostics
Elaboration keeps or makes reconstructible the source unit and revision, positions and raw spellings, normalized keys, category and hierarchy of constructs, binding and declaration identities, exact contracts selected or synthesized, result contracts, loci of application, query, path, rule, construction, lifecycle and realization.
Synthetic descendants are determined by the authored loci. Parser recovery can vary after recording the normative refusal, but does not silently admit an invalid source.
The associated catalog separates lexical, reference, type, contract, role, scope, query, reasoning, construction, scenario, composition and realization errors. Those diagnostics are not equivalent to false, unknown or operational failure. The identifiers S-I01 to S-I46 remain in the correspondence map as surface obligations, including the separation between source order and execution and between physical writing and semantic authority.