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
//! Elinvar: find the holes in a design before you build it.
//!
//! A relational model finder: given bounds on relations and a formula,
//! `run` finds an instance and `check` finds a counterexample, through a
//! boolean circuit and a SAT solver. Every instance is refereed by the
//! evaluator of `elinvar-logic` before it is returned (AGENTS.md law 13).
//!
//! This crate is the one to depend on and to install: it re-exports the
//! engine (`elinvar-engine`), the Alloy reader as [`als`], and the logic as
//! [`logic`], and `cargo install elinvar` builds the `elinvar` command line
//! (DESIGN.md section 5.3).
//!
//! ```
//! use elinvar::prelude::*;
//!
//! let mut m = Model::new();
//! let person = m.set("Person");
//! let knows = m.field("knows", &person, &person);
//!
//! // Nobody knows themselves: broken by a self-loop.
//! let no_self = knows.intersection(&Expr::iden()).no();
//! let report = m.check(&no_self).named("NoSelf").scope(3).report();
//! assert_eq!(report.verdict, Some(Verdict::Counterexample));
//!
//! // Add the missing rule and check again.
//! m.fact(no_self.clone());
//! let report = m.check(&no_self).named("NoSelf").scope(3).report();
//! assert_eq!(report.verdict, Some(Verdict::Holds));
//! ```
pub use elinvar_als as als;
pub use *;
// The command line and the MCP server, public only for the binary, `xtask`,
// and the integration tests; not part of the stable Rust API.