Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Semantic applications and composition

FormaSL allows building larger programs through the composition of semantic applications. Each application uses an identified contract, receives inputs under defined conditions and produces results or transitions with their own meaning. The composition determines how those operations relate, which information can cross their boundaries and which events constitute the completion of the composed program.

Queries, analyses, inferences, transformations and governed judgments can participate in the same composition. The contracts of producers and consumers establish the conditions of that integration. The resulting program has a semantic interface usable by other compositions, preserving the guarantees of its components and the history of the materially relevant transitions.

Applications bound to contracts

A semantic application binds a specific contract revision to declarations, arguments and input requirements. In the program’s explicit semantic representation, that binding makes recoverable the application’s identity, its origin in the source, the required inputs, the interpretation basis and the contract of the results it can produce.

The declaration of an application and its invocation play distinct roles. The same declared application can be used by several compositions and executed many times. Each execution receives identifiable arguments and an evaluation basis; the results keep the correspondence with the application and with the contract that produced them.

Within a composition, a stage identifies the place of an application in the composed program. The stage’s name serves to relate results, dependency and ordering. It does not replace the identity of the semantic application nor the identity of an execution occurrence.

Results preserving their meaning

A producing operation defines a ResultContract. That contract describes the content that can be delivered, the semantic status (standing) of that content, the basis needed to interpret it, its dependencies and the completeness criterion. It also identifies the alternative results and the pertinent assurance guarantees.

A query answer, an analytical value, an inference consequence and a conformance judgment can contain structurally similar data and still represent different things. The result keeps the status attributed by the contract that produced it. The consumer receives that information without needing to reconstruct the meaning from a storage format or a local runtime convention.

Dependency also has a typed role. A result can depend on a derivation premise, on evidence used by an evaluation, on a theory defining its interpretation or on a transformation producing its representation. When those relations affect the interpretation, the contract preserves their specific role, directly or by reference.

The identity of a result becomes especially relevant when it will be referenced, communicated, revised or used as support of another judgment. In those cases, the contract provides a stable way to designate the result or the intended fragment, according to the producing operation’s semantics.

Admissibility between producer and consumer

The linkage between two applications is governed by the consuming operation’s input contract. The verification considers the static formation and types, the result’s effective status, the compatibility between interpretation bases, the necessary dependencies and their completeness condition. Specialized operations add the corresponding admissibility and authority judgments.

FormaSL distinguishes the admissibility of a concrete result from the direct composability between contracts. A producer contract is directly composable with a consumer’s input contract when all its admissible outcomes for that unconditional linkage satisfy the consumer’s requirements. When the producer admits alternative states, a branching or an explicit transformation can select the appropriate results before the passage.

The acceptance of several inputs is examined jointly when their meaning depends on relations between them. Two individually admissible inputs can belong to incompatible historical revisions, to frames requiring transformation or to contexts whose correlation has not yet been established. The consumer contract defines how to evaluate the set.

A reasoning consequence, for example, can be queried as a semantic artifact. To work as a premise of another inference, it also goes through the premise admission rules of that second operation. If it is used by an authorization judgment, the corresponding governance criteria apply independently.

Dependencies and inputs bound during execution

The composition declares the data and result dependencies between its stages. An operation can consume a query’s answer, the source revision introduced by an earlier transition or the identifier of a decision produced within the program itself.

Some values only become known during evaluation. In those cases, the semantic program defines in advance from which result or transition the value will be obtained, which role it plays and how it will be selected. The binding can require a single referent, admit an optional input or operate over a set according to the applicable contract. The runtime provides the concrete values keeping those rules.

The interpretation basis also participates in the binding. The revision of a policy, the queried source state, the relevant authorization instant or a hypothetical context can change the operation’s meaning. Materially relevant environment values, such as the consulted clock or the selection of a current revision, join semantically identified inputs or dependencies. The composition records how those bases are fixed and how they stay associated with the results, even when the environment evolves during a prolonged evaluation.

Dependency, semantic order and scheduling

Data dependency indicates that a stage needs determined information produced or made available by another. Semantic order establishes precedence when the constitution of meaning requires that an event or judgment exist before another. Execution scheduling organizes when and where the work will be performed by the concrete mechanisms.

A decision used as the ground of a request establishes a semantic precedence relation. A query consuming already available data can depend on that data without requiring a new execution of the producer. Two independent analyses can be performed in parallel when their contracts guarantee the absence of relevant semantic interference.

The composition makes explicit the interactions between transitions changing authority, source or other semantic positions. When necessary, it establishes ordering, coupling, isolation over a shared basis or non-interference rules. The planner uses that information to define the scheduling, preserving the declared bindings and guarantees. The order of the source text only determines precedence when the construct’s contract attributes that role to it.

Routing of results and alternatives

The paths of a composition can depend on the results of earlier stages. FormaSL uses typed outcomes and result vocabularies to determine those alternatives. An empty answer, a violated conformance judgment, a denied admission, unknown information and an inconclusive result can lead to different paths according to the composed contract.

The unavailability of a provider or the exhaustion of resources belongs to the operational result channel. The composition contract specifies how that condition is presented or routed, including recovery or interruption alternatives when applicable.

A branching can route a valid negative result to a revision stage, use an empty query as a semantic condition or return an inconclusive composition when evidence is missing. The interpretation of each path depends on the result actually received and the rules declared for that branch.

Conditional stages that were not reached keep the condition of not reached. Their lack of execution has a meaning distinct from a performed attempt that failed or an evaluation that ended without conclusion.

Completion of the composed program

Every composition has a CompositeCompletionContract. It determines which final results and transitions are required, which alternative outcomes are admissible and which branches participate in completion under determined conditions.

A stage can be required for completion, conditional on a judgment or optional under a contract treating it as non-blocking. That assignment integrates the composition’s definition and allows correctly interpreting an execution that produced some results but still has other pending obligations.

An intermediate result can become available before the composed program satisfies its completion conditions. Likewise, the operational termination of an invocation does not by itself establish the semantic completeness of the composition. The final interface keeps the different classes of completion when they participate in the meaning.

When a relevant input is incomplete, the consumer applies its own completeness contract. It can demonstrate that the missing part does not affect its completion criterion, admit a partial result or keep the incompleteness in the next result. Those conditions accompany the information until the stage that resolves or explicitly uses them.

Incremental consumption and flow of results

An operation can make results available in increments. The composition can consume them before finalization when an incremental consumption contract establishes which increments have usable meaning and under which conditions they can be forwarded.

That contract identifies each increment’s partiality class, its ordering or revision, the possibility of substitution and the finalization criterion. It also defines when the consumer can emit results and which transitions can happen before the input becomes complete.

A transport tracking, for example, can receive new temperature readings during a trip. A visualization can accept partial updates, while an irreversible decision about a batch’s destination can require a complete evidence set or a policy expressly admitting a determined early decision.

The transport flow of the messages and the semantic admissibility of the increments are handled by their respective contracts. This allows using streaming and incremental processing under specific conditions, preserving the interpretation of the results across updates.

Iteration, recursion and nested compositions

The ordinary composition of applications has a finite, well-founded structure. When the program needs iteration or recursion between applications, a specific contract defines the initial state, the step relation, the completion criterion and the conditions of partiality or divergence.

That discipline coexists with cyclic structures of the metagraph and with the recursion proper to queries and inferences. A path query can operate over a cyclic graph under its contract; that does not require the composition invoking it to be recursive as well.

A composition can use another named composition as a component. The inner composition publishes the guarantees needed for the outer one to know its inputs, results, transitions and authority requirements. The hierarchy organizes reuse, while the material semantic interactions stay recoverable.

Named compositions and reusable interfaces

A named composition publishes a CompositionContract with its own identity and revision. Its interface determines the input contracts, the exported results and outcomes, the completion conditions and the realization requirements. It also describes the lifecycle interactions that matter to other programs.

The LifecycleInteractionSummary informs, as applicable, the introduction of Claims or decisions, the changes of authoritative source, the external action requests, the observation acquisitions and the involved authority or ordering conditions. That information lets the composition be used as a unit without hiding transitions affecting its consumers.

The internal implementation can evolve. A new implementation keeps compatibility with the published contract when it preserves the guarantees other programs use, including the completeness classes, the alternative outcomes and the lifecycle interactions. The equality of the final value presented to the user is only one of the properties that can participate in that compatibility.

Reuse, repetition and history

The runtime can reuse existing results when an equivalence or ReuseAdmissible contract establishes that they satisfy the new consumption’s requirements. The comparison considers the result’s relevant dimensions, such as the revision of the theory or model, the temporal and contextual basis, the authority, the dependencies and the completeness state.

The composition also distinguishes reusing a result, repeating the delivery of the same request and starting a new execution. That difference is particularly important when the stages produce historical occurrences or interact with external mechanisms. The operation’s semantics determines which identities and records must be preserved in each case.

The history can be stored in or referenced by specialized artifacts, as long as the relations needed to reconstruct the path remain available. The composition keeps the contracts’ revisions, the bases admitted at each linkage and the references to the material results and transitions.

Composition of judgments and effects

Some compositions integrate governed judgments and lifecycle transitions. A validation can produce a conformance judgment; a policy can participate in a candidate’s admission; a decision can ground an execution request. Each stage adds its result or occurrence under the corresponding authority.

The composition contract determines the required precedences and semantic effects. When two introductions need to happen in coupled form, the coupling relation belongs to the semantic contract; realization selects mechanisms capable of respecting it. The infrastructure choices for grouping stages do not by themselves establish a new commitment of semantic atomicity.

A later failure can interrupt the composition or require a compensation transition. The already introduced events keep their history. Rectifications, retractions and compensations are represented by their own transitions and bound to the path that motivated their performance.

An example of composition

Consider an application meant to track the release of a batch of medicine transported under temperature control. The composition uses a query over the transport history, an analysis of the measurements, a conformance judgment and a governed decision stage.

The query selects the observations pertinent to the batch and to the intervals required by the contract. The analysis uses the measurements admitted under an identified revision of the risk model. The validation considers the restrictions applicable to the product, while the decision stage receives the results and the authority bases required to determine the destination.

Those inputs need to be correlated to the same batch and to compatible temporal bases. A conformance judgment can depend on a complete observation interval; an analytical estimate can be produced before that and remain marked as partial. The composition contract determines which paths admit that partiality and which require additional data.

If the evidence is complete and the normative conditions satisfied, the program can produce the applicable decision under the decider’s authority. If the information is insufficient, an inconclusive result can route the batch to a new evaluation. The decision can ground a later request to the stock system. The issuance of that request is another transition; its execution is tracked under the responsible mechanism’s guarantees.

The composition publishes the results and interactions relevant to other systems: the judgment performed, the decision taken, the dependencies considered and the eventual execution requests. Later operations can query that path or use it as a basis, preserving the revisions and the conditions in which each result was produced.

Relation to realization

In the .fsl program, the composition expresses the contracts, the applications, the results and the dependency, ordering and completion relations. The concrete surface includes composition, let, stage, order, couple, case, return and unresolved, with meanings determined by the structure and the contracts used.

Elaboration preserves those relations in the explicit semantic program. The .fsp realization associates requirements to concrete capabilities, and the runtime executes the stages through a typed invocation and binding path. Planning can optimize or parallelize stages when it keeps the composition’s obligations.

The chain between source, application, contract, realization, execution and result remains reconstructible. Thus a larger composition can take advantage both of its stages’ semantic results and of the history and guarantees defining how they were produced.

Semantic operations and transitions presents the operation families used in composition. Semantic continuity defines how its qualifications cross the boundaries between stages. From the semantic program to realization explains how those contracts reach planning and the runtime. Modules, interfaces and reference resolution describes the publication of reusable declarations and contracts.