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
/*!
The context --- to which formulas are added and within which solves take place, etc.
Strictly, a [GenericContext] and a [Context].
The generic context is designed to be generic over various parameters.
Though, for the moment this is limited to the source of randomness.
Still, this helps distinguish generic context methods against those intended for external use or a particular application.
In particular, [from_config](Context::from_config) is implemented for a context rather than a generic context to avoid requiring a source of randomness to be supplied alongside a config.
# Example
```rust
# use otter_sat::context::Context;
# use otter_sat::config::Config;
# use otter_sat::reports::Report;
# use otter_sat::structures::literal::{CLiteral, Literal};
let mut the_context = Context::from_config(Config::default());
let p = the_context.fresh_or_max_atom();
let q = the_context.fresh_or_max_atom();
let p_q_clause = vec![CLiteral::new(p, true), CLiteral::new(q, true)];
assert!(the_context.add_clause(p_q_clause).is_ok());
let not_p = CLiteral::new(p, false);
assert!(the_context.add_clause(not_p).is_ok());
assert!(the_context.solve().is_ok());
assert_eq!(the_context.report(), Report::Satisfiable);
assert_eq!(the_context.atom_db.value_of(p), Some(false));
assert_eq!(the_context.atom_db.value_of(q), Some(true));
```
*/
pub use Counters;
pub use GenericContext;
pub use Context;
use crateClauseKey;
/// The state of a context.
/// These states correspond to the states defined in the IPASIR2 specification.