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
/*!
This module provides an extension to allow for guarded transitions.
In some cases it is desirable to model conditions that will enable/disable a transition beyond the required set of input
tokens. To accomplish this we add a guard function \\(G\\) to our net definition.
$$\tag{Guarded Net} N = \left\langle P,T,A,G \right\rangle$$
This function maps the set of transitions and a *particular marking* to a truth value.
$$\tag{Guard Function} G: T \times M_n \mapsto \left \mathbb{B}$$
This function is called from within the existing enable check as follows.
$$\tag{Guarded enabled} enabled\left(t \in T, M_n \right) = \forall p \in {}^{\bullet}t: min(A(p,t)) \land G(t, M_n)$$
*/
use crateTransition;
use crate;
// ------------------------------------------------------------------------------------------------
// Public Types
// ------------------------------------------------------------------------------------------------
///
/// This trait determines whether a particular transition has an associated guard, and can evaluate
/// such a guard.
///
/// Note that calling evaluate when no guard is present **should** be free, and return
/// `false`.
///