I'm attempting to express rules more formally than plain English sentences and was hoping for some direction in using a propositional approach and some sort of binary decision tree for illustration of the rules.
Suppose that objects outside a specified zone are required to be in a particular state (say redState
) in order to be considered safe
. Expressed as a plain English sentences;
if object is outside of ZoneA and is in a RedState, then it is Safe,
However, in some instances objects may be exempt from this restriction:
if object is outside of ZoneA, is not in a RedState and is Exempt, then it is Safe.
if object is outside of ZoneA, is not in a RedState and is not Exempt, then it is not Safe.
Whether or not an object in zone A is in a red state is unimportant. The remaining rule is:
if an object is contained in zone A, then it is safe.
Using a propositional formulation, I thought these rules could be expressed as
¬
InZoneA
∧RedState
⇒Safe
¬
InZoneA
∧ ¬RedState
∧Exempt
⇒Safe
¬
InZoneA
∧ ¬RedState
∧ ¬Exempt
⇒ ¬Safe
InZoneA ⇒
Safe
I've consulted system specification approaches (such as Z) but am more interested in conveying a concise conceptual idea of the rules and less so in ensuring their functioning within a larger system. I therefore thought to represent them as a type of binary decision tree (diagram). I've read some notes on the subject but am a little unsure as to whether their use is the best approach or if I am butchering them. The representation I arrive at for these rules is presented in the figure, where solid lines indicate True
and dashed lines indicate False
.
I would greatly appreciate your input as to whether or not this representation is correct or if my approach/thinking is flawed. Many Thanks!
What you have shown is fine, as far as I can tell.
However, there are some other things you might want to consider.
For example, if the Exempt is available at any level, it might want to be evaluated before anything else, it depends on nothing, and nothing depends on it. This would save you time by not having to evaluate any other properties that will not affect the outcome.