1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! Generic incremental query calculation for SIM runtime libraries.
//!
//! `sim-incremental-core` records dependencies from actual query execution. A
//! query can read another query through its [`QueryFrame`], observe external
//! stamps, and return any hashable Rust value. The engine keeps memoized values,
//! reverse dependency edges, cycle paths, typed budget failures, continuation
//! tokens, and bounded graph snapshots without depending on SIM expressions,
//! codecs, Table/Dir storage, web surfaces, or expression-tree records.
//!
//! # Dataflow reuse and cycle boundary
//!
//! Dataflow extensions reuse this crate's existing ownership ledger instead of
//! defining parallel protocol types:
//!
//! - fingerprint: [`ValueFingerprint`]
//! - observation: [`Observation`]
//! - revision: [`Revision`]
//! - budget: [`QueryBudgets`]
//! - continuation: [`ContinuationToken`]
//! - snapshot: [`GraphSnapshot`]
//!
//! A cycle in a dataflow graph is valid when its edges carry monotone lattice
//! facts: repeatedly joining those facts must converge at a fixed point. That
//! worklist-level feedback does not recursively enter query callbacks. By
//! contrast, a query dependency cycle occurs when a [`QueryFrame::read`] tries
//! to re-enter a query already on the active query stack. It is a programming
//! error reported as [`IncrementalError::Cycle`], not a fixed-point request.
//!
//! # Examples
//!
//! ```
//! use sim_incremental_core::{IncrementalEngine, QueryResult};
//!
//! let mut engine = IncrementalEngine::<&'static str, i64>::new();
//! engine.register_fn("a", |_, _| Ok(1));
//! engine.register_fn("b", |_, frame| {
//! let a = frame.read("a")?;
//! Ok(a + 1)
//! });
//!
//! let value: QueryResult<_, _> = engine.verify("b");
//! assert_eq!(value.unwrap(), 2);
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;