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
67
68
69
70
71
72
73
74
75
76
77
78
//! `dive-value`: TLA+ values with TLC's canonical ordering, equality, printing and
//! fingerprints; model values; lazy and enumerable sets.
//!
//! The crate has no dependencies on other dive crates. The design records behind it
//! are in the repository's [decision records](https://github.com/Chelis-Lang/dive/tree/main/docs/decisions).
//!
//! # Overview
//!
//! - [`Value`]: an immutable, 16-byte, `Send + Sync` value; compound values are shared
//! behind `Arc`s, so cloning is cheap.
//! - [`Ctx`]: the semantics of a run: [`IntMode`] (TLC's 32-bit integers or
//! arbitrary precision) and [`ValueOrder`] (TLC's intern order or dive's canonical
//! order). Defaults are dive's; [`Ctx::tlc`] is `--compat=tlc`.
//! - [`Interner`]: the run's table of names (strings, model values, record fields).
//! - [`tlc`]: TLC's checked equality, comparison and membership, with TLC's errors.
//! - [`mod@print`]: TLC's value printing and pretty-printer.
//! - [`fp64`]: TLC's FP64 fingerprints.
//! - [`json`]: TLC's JSON form of values.
//! - [`codec`]: compact, deterministic byte encodings of values for state storage.
//!
//! ```
//! use dive_value::{Ctx, Interner, Value, print::print_value, tlc};
//!
//! let ctx = Ctx::tlc();
//! let names = Interner::new();
//! let s = Value::set(
//! vec![Value::string(&names, "b"), Value::string(&names, "a")],
//! ctx,
//! )?;
//! // TLC orders strings by intern order: "b" was interned first.
//! assert_eq!(print_value(&s, ctx)?, r#"{"b", "a"}"#);
//!
//! // TLC refuses to compare an integer with a string.
//! let err = tlc::equals(&Value::from(1), &Value::string(&names, "a"), ctx).unwrap_err();
//! assert_eq!(err.message(), "Attempted to check equality of integer 1 with non-integer:\n\"a\"");
//! # Ok::<(), dive_value::ValueError>(())
//! ```
pub use ConstructionError;
pub use ;
pub use ;
pub use ;
pub use MAX_ENUMERATION;
pub use ;
pub use Int;
pub use NameError;
pub use ;
pub use ;
pub use ;
/// An owned incremental stream of set elements, with no complete output buffer.
/// See [`Set::concrete_element_stream`] for construction and a bounded example.
pub type SetElementStream = ;