symbols

Architecture snapshot · search, inspect, and follow dependenciesOpen full-page explorer ↗
Chapter contents

Symbol

Erased definition identity; specialized interfaces retain the definition kind. {anchor}`definition_identity` Resolution may use names, paths, scopes, and namespaces to discover a definition, but every successful downstream semantic reference records the resulting symbol. Renaming an import or choosing another path to the same definition must not mint a different definition identity. {anchor}`kind_wrappers` Symbol supports heterogeneous membership and resolution results. Operations whose meaning requires a definition kind accept the corresponding kind-specific wrapper; conversion into Symbol preserves identity, checked recovery accepts the right kind, and recovery of a wrong kind fails.

FnSymbol

Kind-specific local-or-external semantic interface.

FnSymbol::signature Return this definition's checked interface. Local and external representations dispatch separately.

TraitSymbol

Kind-specific local-or-external semantic interface.

TraitSymbol::signature Return this definition's checked interface. Local and external representations dispatch separately.

TraitSymbol::items Return member identities or kind-specific member descriptions.

ImplSymbol

Kind-specific local-or-external semantic interface.

ImplSymbol::signature Return this definition's checked interface. Local and external representations dispatch separately.

ImplSymbol::items Return member identities or kind-specific member descriptions.

StructSymbol

Kind-specific local-or-external semantic interface.

StructSymbol::signature Return this definition's checked interface. Local and external representations dispatch separately.

StructSymbol::value Return fields, alias value, or declared value type as appropriate to this kind.

EnumSymbol

Kind-specific local-or-external semantic interface.

EnumSymbol::signature Return this definition's checked interface. Local and external representations dispatch separately.

EnumSymbol::items Return member identities or kind-specific member descriptions.

LocalFnSym

Source-backed definition. Identity detail here is a review abstraction; inspect the linked Rust declaration for the exact per-kind fields. {anchor}`local_identity` A local symbol's identity fields identify its definition. Independently tracked CST, spans, signatures, members, and bodies do not become part of that identity. Detail-only changes preserve the symbol, and consumers of unchanged sibling facts remain reusable; genuine identity changes are distinguishable. {anchor}`associated_identity` A trait or impl function, type, or constant has its own stable symbol tied to its associated owner. Repeated requests and movement among siblings preserve that owner and the associated item identity.

LocalFnSym::signature Check the declaration in its defining scope; preserve generic identities, binder, predicates, and unsupported eligibility. For associated functions inherit the owner generics and Self before method generics. This models local_syms/fns.rs::sig. {anchor}`associated_interfaces` Checking an associated signature reuses its owner interface and never reads a sibling associated body.

LocalFnSym::body Import this signature, bind parameters and Self, and set the solver environment and return type. Check the body in a fresh InferCtx, finalize obligations, then finish the typed tree. A missing body produces the existing recovery representation. {anchor}`body_interfaces` Checking and elaborating one function may read its own source and signature plus demanded signatures, fields, associated items, impl headers, metadata facts, and solver results. It must not read a callee or sibling body; a callee-body-only edit must not change or reexecute the caller's completed body.

ExternalFn

Logical external branch of the kind wrapper; Rust uses SymExt rather than a separate struct for each kind. {anchor}`external_identity` An external symbol identifies a dependency definition by crate number and definition index, independently of the metadata facts requested about it. Metadata adapters supply one consistent definition kind for that identity. {anchor}`external_fact_queries` Sage imports external facts through owned, definition-keyed queries. A metadata provider neither resolves Sage-local names nor performs Sage trait proof or normalization; those operations execute on the imported Sage values.

ExternalFn::signature Read one external signature fact and lower owned metadata into Sage types and binders.

LocalTraitSym

Source-backed definition. Identity detail here is a review abstraction; inspect the linked Rust declaration for the exact per-kind fields.

LocalTraitSym::signature Check the declaration in its defining scope; preserve generic identities, binder, predicates, and unsupported eligibility.

LocalTraitSym::items Read member syntax and produce stable member identities. Trait/impl semantic items also open the owner signature. Enum variants have their own tracked symbols. Aggregate and keyed associated lookups share producers.

ExternalTrait

Logical external branch of the kind wrapper; Rust uses SymExt rather than a separate struct for each kind.

ExternalTrait::signature Read one external signature fact and lower owned metadata into Sage types and binders.

ExternalTrait::items Import external member metadata into typed symbol identities.

LocalImplSym

Source-backed definition. Identity detail here is a review abstraction; inspect the linked Rust declaration for the exact per-kind fields.

LocalImplSym::signature Check the declaration in its defining scope; preserve generic identities, binder, predicates, and unsupported eligibility.

LocalImplSym::items Read member syntax and produce stable member identities. Trait/impl semantic items also open the owner signature. Enum variants have their own tracked symbols. Aggregate and keyed associated lookups share producers.

LocalImplSym::associated_type_value Find the keyed associated type item and lower only its value under the impl binder; do not enumerate sibling values.

ExternalImpl

Logical external branch of the kind wrapper; Rust uses SymExt rather than a separate struct for each kind.

ExternalImpl::signature Read one external signature fact and lower owned metadata into Sage types and binders.

ExternalImpl::items Import external member metadata into typed symbol identities.

LocalStructSym

Source-backed definition. Identity detail here is a review abstraction; inspect the linked Rust declaration for the exact per-kind fields.

LocalStructSym::signature Check the declaration in its defining scope; preserve generic identities, binder, predicates, and unsupported eligibility.

LocalStructSym::value Check the kind-specific field types, alias value, or declared type in its binder; this is an architectural grouping of the narrower Rust operations.

ExternalStruct

Logical external branch of the kind wrapper; Rust uses SymExt rather than a separate struct for each kind.

ExternalStruct::signature Read one external signature fact and lower owned metadata into Sage types and binders.

ExternalStruct::value Import the represented external value or type fact. Unsupported metadata remains unavailable rather than a semantic proof.

LocalEnumSym

Source-backed definition. Identity detail here is a review abstraction; inspect the linked Rust declaration for the exact per-kind fields.

LocalEnumSym::signature Check the declaration in its defining scope; preserve generic identities, binder, predicates, and unsupported eligibility.

LocalEnumSym::items Read member syntax and produce stable member identities. Trait/impl semantic items also open the owner signature. Enum variants have their own tracked symbols. Aggregate and keyed associated lookups share producers.

ExternalEnum

Logical external branch of the kind wrapper; Rust uses SymExt rather than a separate struct for each kind.

ExternalEnum::signature Read one external signature fact and lower owned metadata into Sage types and binders.

ExternalEnum::items Import external member metadata into typed symbol identities.

LocalTypeAliasSym

Source-backed identity and syntax. Semantic operations not uniformly available as symbol methods; inspect local_syms for current per-kind support.

LocalConstSym

Source-backed identity and syntax. Semantic operations not uniformly available as symbol methods; inspect local_syms for current per-kind support.

LocalStaticSym

Source-backed identity and syntax. Semantic operations not uniformly available as symbol methods; inspect local_syms for current per-kind support.

LocalUseSym

Source-backed identity and syntax. Semantic operations not uniformly available as symbol methods; inspect local_syms for current per-kind support.

LocalMacroDefSym

Source-backed identity and syntax. Semantic operations not uniformly available as symbol methods; inspect local_syms for current per-kind support.

LocalMacroInvocationSym

Source-backed identity and syntax. Semantic operations not uniformly available as symbol methods; inspect local_syms for current per-kind support.

LocalVariantSym

Enum variant identity is its parent enum and name; syntax, span, and tuple shape are tracked detail.

LocalVariantCtorSym

Tuple variant constructor identity is distinct from the type-namespace variant.