Expand description
IPLD codec for TensorLogic IR
Serializes TensorLogic terms, predicates, rules and facts as DAG-CBOR IPLD nodes with content-addressed CIDs. Enables:
- Rule sharing via Bitswap (rules are immutable, CID-identified)
- IPLD path resolution: /rule/<cid>/head/args/0
- Cross-node deduplication: identical rules share one CID
Structs§
- Fact
Ipld - IPLD representation of a ground fact
- Knowledge
Base Ipld - Snapshot of a complete knowledge base as an IPLD node
- Rule
Ipld - IPLD representation of a TensorLogic Rule (Horn clause)
Enums§
- Term
Ipld - IPLD representation of a TensorLogic Term
Functions§
- block_
to_ fact - Deserialize a
Blockinto aFactIpld. - block_
to_ kb - Deserialize a
Blockinto aKnowledgeBaseIpld. - block_
to_ rule - Deserialize a
Blockinto aRuleIpld. - fact_
cid - Compute the content-addressed
Cidfor aFactIpldwithout storing it. - fact_
ipld_ to_ predicate - Convert a
FactIpldback to an IRPredicate. - fact_
to_ block - Serialize a
FactIpldto aBlock. - kb_
to_ block - Serialize a
KnowledgeBaseIpldsnapshot to aBlock. - predicate_
to_ fact_ ipld - Convert an IR
Predicate(ground fact) to aFactIpld. - predicate_
to_ term_ ipld - Convert an IR
Predicateto an IPLDTermIpld::Compound. - rule_
cid - Compute the content-addressed
Cidfor aRuleIpldwithout storing it. - rule_
ipld_ to_ rule - Convert a
RuleIpldback to an IRRule. - rule_
to_ block - Serialize a
RuleIpldto a DAG-CBOR–stampedBlock. - rule_
to_ rule_ ipld - Convert an IR
Ruleto aRuleIpld. - term_
ipld_ to_ predicate - Convert a
TermIpld::Compoundback to an IRPredicate.