pub struct Store { /* private fields */ }Expand description
The persistent store.
Implementations§
Source§impl Store
impl Store
Sourcepub fn new(hashcons: bool) -> Self
pub fn new(hashcons: bool) -> Self
A new store. hashcons: false is the -hashcons ablation: every
intern inserts a fresh node, and equality must be structural.
Sourcepub fn with_string_order(hashcons: bool, order: StringOrder) -> Self
pub fn with_string_order(hashcons: bool, order: StringOrder) -> Self
A new store whose strings compare in order (--compat=tlc uses
StringOrder::Token). The order is fixed for the store’s life,
because sets are kept sorted in it.
Sourcepub fn with_semantics(hashcons: bool, semantics: Semantics) -> Self
pub fn with_semantics(hashcons: bool, semantics: Semantics) -> Self
A new store with the run’s value semantics, so that constant folding, the search and trace replay all compute alike.
Sourcepub fn set_printer(&self, printer: Printer)
pub fn set_printer(&self, printer: Printer)
Sets the model’s name table and value semantics, which printing
(ToString, Print) converts values with (print.rs). The first
call wins.
Sourcepub fn note_lazy_sets(&self)
pub fn note_lazy_sets(&self)
Records that the plan may build a value TLC keeps as an interval or
a lazy set (a..b, DOMAIN, SUBSET, [S -> T], [a : S],
S \X T), which the core may enumerate: printing then refuses the
enumerated sets TLC could print otherwise (print.rs). Set while
compiling, before any search.
Sourcepub fn lazy_sets(&self) -> bool
pub fn lazy_sets(&self) -> bool
Whether Store::note_lazy_sets was called.
Sourcepub fn set_draws(&self, draws: Arc<dyn Draws>)
pub fn set_draws(&self, draws: Arc<dyn Draws>)
Sets the run’s random streams (RandomElement). The first call
wins.
Sourcepub fn set_registers(&self, registers: Arc<dyn Registers>)
pub fn set_registers(&self, registers: Arc<dyn Registers>)
Sets the run’s TLCSet/TLCGet registers. The first call wins.
Sourcepub fn stats(&self) -> StoreStats
pub fn stats(&self) -> StoreStats
Intern statistics, summed over the shards.
Sourcepub fn memory_usage(&self) -> StoreMemory
pub fn memory_usage(&self) -> StoreMemory
Measures known requested retained bytes and capacities, including tables still held by readers after index growth. Dead retirement records are collected before reporting; their vector’s spare capacity still counts.
This read takes shard locks, without changing interning identities or
hit/miss counters. It is intended for phase boundaries, not the hot path.
See StoreMemory for opaque allocations and snapshot limitations.
let store = dive_core::Store::default();
let memory = store.memory_usage();
assert!(memory.fixed_bytes > 0);
assert_eq!(memory.slab_bytes, 0);
assert!(memory.known_retained_bytes().is_some());