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
79
80
81
82
//! # Temporal control
//!
//! Simple temporal networks with uncertainty: dynamic controllability checking and dispatchable
//! execution for `no_std` targets.
//!
//! ## Scope
//!
//! - Simple Temporal Networks ([`Stn`]): consistency checking with a negative-cycle explanation,
//! minimal networks (all pairs, or the constrained pairs only with P³C), incremental consistency ([`IncrementalStn`]) and filtered dispatchable
//! networks ([`Stn::dispatchable`]).
//! - STNs with Uncertainty ([`Stnu`]): dynamic controllability by independent checkers
//! ([`Stnu::dispatchable`], which also yields an extended dispatchable network with waits;
//! [`Stnu::check_controllability`], Morris's `O(n^3)` algorithm; and the others in
//! [`DcAlgorithm`]). A negative verdict carries a [`SemiReducibleCycle`] naming the
//! requirements and contingent extremes that conflict.
//! - An onboard [`Dispatcher`] with fixed capacity that needs no `alloc`, loads in place from
//! a `const` [`Dispatcher::EMPTY`], and stores handles in a chosen [`Index`] type.
//! - A compact, versioned, CRC-32-checked encoding of dispatchable networks
//! ([`dispatch::encoding`]) that the dispatcher validates and loads directly from the bytes.
//!
//! Everything except [`Dispatcher`], the encoding and their input types needs the default
//! `alloc` feature.
//!
//! All time values are integer [`Ticks`]. All arithmetic is checked, and every algorithm runs
//! under an explicit [`Budget`]. Exhausting a budget yields [`Error::BudgetExhausted`], never a
//! verdict. See `docs/design.md` in the repository for the formal semantics.
//!
//! ## Example
//!
//! ```
//! # #[cfg(feature = "alloc")] {
//! use temporal_control::{Budget, Stn, Ticks, Verdict};
//!
//! let mut stn = Stn::new();
//! let warmup = stn.add_time_point().expect("fits usize");
//! let analysis = stn.add_time_point().expect("fits usize");
//! // 5 <= t_analysis - t_warmup <= 15
//! stn.add_constraint(warmup, analysis, Some(Ticks(5)), Some(Ticks(15)))
//! .expect("time points exist");
//!
//! let verdict = stn.check_consistency(&Budget::UNLIMITED).expect("within budget");
//! assert!(matches!(verdict, Verdict::Consistent(_)));
//! # }
//! ```
//!
//! Repository: <https://github.com/sunsided/temporal-control>
extern crate alloc;
pub use Budget;
pub use DispatchableNetwork;
pub use ;
pub use Error;
pub use ;
pub use ;
pub use Ticks;
pub use TimePoint;