Skip to main content

Module contract

Module contract 

Source
Expand description

Contract parsing, resolution, and rendering.

Three front-ends (inline attributes, embedded JSON, and pred!-style compound-property macros, plus the pest DSL for expressions) all funnel into Property::parse_list, producing a single IR defined in types.

§Layering

Contracts go through two stages, each with its own type:

#[rapx::requires(...)] text        std-*.json            pred!(...) / def_property
   └─ attr.rs ──▶ AttrProperty      └─ json.rs ──▶ JsonProperty   └─ compound.rs ──▶ CompoundSpec
                     └────────────────── builder.rs ──────────────────▶ Property   (Atom | Or)

Within the resolved IR, the naming follows granularity rather than stage: Property* names the formula level (Property, PropertyKind, PropertyArg), while Contract* names the expression sub-language that fills PropertyArg::Expr (ContractPlace, ContractExpr, ContractProjection).

Modules§

attr 🔒
Parsing utilities for #[rapx::requires(...)] outer attributes.
builder 🔒
Assemble a safety tag into a Property via the declarative spec table.
compound 🔒
User-defined compound-contract layer.
json 🔒
The bundled JSON contract front-end: loading, lookup, and conversion.
pest_conv 🔒
Semantic converter: pest Pairs<Rule> → ContractExpr / NumericPredicate / CompoundBody.
pest_grammar 🔒
pest parser for the contract DSL.
place 🔒
Place resolution: syn::Expr → ContractPlace.
render 🔒
User-facing rendering of contract data structures.
resolve 🔒
Expression / argument resolution: syn::Expr → semantic values.
spec 🔒
Declaration table mapping tag names to their property specs.
types 🔒
The contract IR: places, expressions, predicates, and the property model.