pub struct Dialect {Show 16 fields
pub types: BTreeMap<String, SExpr>,
pub name: String,
pub extends: Vec<String>,
pub author: Option<String>,
pub performatives: Vec<PerformativeDef>,
pub resources: ResourceBounds,
pub examples: Vec<SExpr>,
pub signature: Option<Vec<u8>>,
pub hash: Option<String>,
pub protocol: Option<String>,
pub causal_protocol: Option<CausalProtocol>,
pub shapes: Vec<ShapeConstraint>,
pub roles: Vec<RoleDecl>,
pub causal_locality: CausalLocality,
pub state: Option<StateClause>,
pub state_bounds: Option<StateBounds>,
}Expand description
A CBCL dialect (REQ-022).
Mirrors CBCL.Dialect in Dialect.lean:34–44.
Fields§
§types: BTreeMap<String, SExpr>§name: String§extends: Vec<String>Parent dialect names (Lean: extends_ : List String).
performatives: Vec<PerformativeDef>§resources: ResourceBounds§examples: Vec<SExpr>§signature: Option<Vec<u8>>§hash: Option<String>Canonical content hash, f1220<lowercase-hex64> over
crate::canonical::dialect_canonical_bytes (SPEC-014 REQ-628).
Invariant: every dialect installed into a DialectRegistry has
Some(..) — installation computes the hash when this is None.
A pre-declared hash (e.g. a :hash clause in dialect source) is
preserved verbatim so wrappers can compare the claim against the
computed value and reject mismatches.
protocol: Option<String>§causal_protocol: Option<CausalProtocol>Causal protocol declaration (REQ-200, REQ-201).
shapes: Vec<ShapeConstraint>Shape constraints for expanded messages (REQ-220).
roles: Vec<RoleDecl>Declared roles (SPEC-014 REQ-621, CON-600); empty = role-free dialect.
causal_locality: CausalLocality(:causal-locality derive|reject) (SPEC-015 REQ-709, ADR-704):
under Derive, R6(vi) failures compile into the recorded
envelope-routing table instead of rejecting; the default Reject
preserves v1 semantics bit-for-bit.
state: Option<StateClause>(state …) clause (SPEC-019 REQ-1902); None = no state layer.
state_bounds: Option<StateBounds>(:state-bounds …) (SPEC-019 REQ-1904); None = the defaults.
Implementations§
Source§impl Dialect
impl Dialect
Sourcepub fn defines_performative(&self, name: &str) -> bool
pub fn defines_performative(&self, name: &str) -> bool
Check if this dialect defines a performative with the given name (REQ-025).
Sourcepub fn find_performative(&self, name: &str) -> Option<&PerformativeDef>
pub fn find_performative(&self, name: &str) -> Option<&PerformativeDef>
Find a performative definition by name (REQ-025).
Sourcepub fn performative_names(&self) -> Vec<&str>
pub fn performative_names(&self) -> Vec<&str>
Return the names of all performatives in this dialect.