Skip to main content

Module ipld_codec

Module ipld_codec 

Source
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§

FactIpld
IPLD representation of a ground fact
KnowledgeBaseIpld
Snapshot of a complete knowledge base as an IPLD node
RuleIpld
IPLD representation of a TensorLogic Rule (Horn clause)

Enums§

TermIpld
IPLD representation of a TensorLogic Term

Functions§

block_to_fact
Deserialize a Block into a FactIpld.
block_to_kb
Deserialize a Block into a KnowledgeBaseIpld.
block_to_rule
Deserialize a Block into a RuleIpld.
fact_cid
Compute the content-addressed Cid for a FactIpld without storing it.
fact_ipld_to_predicate
Convert a FactIpld back to an IR Predicate.
fact_to_block
Serialize a FactIpld to a Block.
kb_to_block
Serialize a KnowledgeBaseIpld snapshot to a Block.
predicate_to_fact_ipld
Convert an IR Predicate (ground fact) to a FactIpld.
predicate_to_term_ipld
Convert an IR Predicate to an IPLD TermIpld::Compound.
rule_cid
Compute the content-addressed Cid for a RuleIpld without storing it.
rule_ipld_to_rule
Convert a RuleIpld back to an IR Rule.
rule_to_block
Serialize a RuleIpld to a DAG-CBOR–stamped Block.
rule_to_rule_ipld
Convert an IR Rule to a RuleIpld.
term_ipld_to_predicate
Convert a TermIpld::Compound back to an IR Predicate.