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
//! Compile and run [Probl](https://github.com/garlab/probl) programs from Rust.
//!
//! Probl is a small language for explicit random choices and weighted worlds:
//! a draw explores its outcomes, each in a world of its own, weighted by how
//! likely it is, and a `report` collects what the worlds say. This crate is
//! its supported API; the command line (`probl-cli`) and the playground are
//! built on it.
//!
//! ```
//! let source = "let a ~ d6\nlet b ~ d6\nreport a + b >= 10 as \"ten or more\"";
//! let program = probl::compile("dice.probl", source)?;
//! let outcome = program.run(&probl::Options::new())?;
//!
//! let ten = outcome.report("ten or more").unwrap().groups()[0].probability().unwrap();
//! assert!((ten.point().unwrap() - 6.0 / 36.0).abs() < 1e-12);
//! assert!(ten.is_complete());
//! assert_eq!(outcome.text(), "enumerated\n\nten or more 16.67%\n");
//! # Ok::<(), probl::Error>(())
//! ```
//!
//! A run's [`Outcome`] has its [`text`](Outcome::text), as `probl run` prints
//! it, and each report's numbers, with what's known about their accuracy:
//! whether unresolved weight affects them, their bounds, and when sampling,
//! their Monte Carlo error. A program that reads data has it loaded first,
//! with [`Program::load`], from [`Files`] the host chooses.
//!
//! The crates `probl-syntax`, `probl-sema` and `probl-engine` are internal:
//! their APIs change with every release.
pub use ;
pub use LocalFiles;
pub use ;
pub use ;
pub use ;
pub use ;
/// This version of Probl.
pub const VERSION: &str = env!;