37 typedef signed char repr_t;
38 enum value_t : repr_t { no_value = -1, maybe_value = 0, yes_value = 1 };
42 constexpr trival() noexcept
47 constexpr trival(
bool v) noexcept
48 : val_(v ? yes_value : no_value)
55 static trival from_repr_t(repr_t v)
57 return trival(
static_cast<value_t
>(v));
61 constexpr explicit trival(value_t v)
66 static constexpr trival maybe()
noexcept
74 return val_ != maybe_value;
77 constexpr bool is_maybe()
const
79 return val_ == maybe_value;
82 constexpr bool is_true()
const
84 return val_ == yes_value;
87 constexpr bool is_false()
const
89 return val_ == no_value;
92 constexpr value_t val()
const
101 explicit operator bool()
const
103 return val_ == yes_value;
106 constexpr trival operator!()
const
108 return trival((val_ == yes_value) ? no_value :
109 (val_ == no_value) ? yes_value :
124 return a.val() == b.val();
136 (a.val() == trival::no_value || b.val() == trival::no_value)
138 : (a.val() ==
trival::maybe_value || b.val() ==
trival::maybe_value)
156 (a.val() == trival::yes_value || b.val() == trival::yes_value)
158 : (a.val() ==
trival::maybe_value || b.val() ==
trival::maybe_value)
173 inline std::ostream& operator<<(std::ostream& os,
trival v)
175 return os << ((v.val() == trival::no_value) ?
"no"
176 : (v.val() == trival::maybe_value) ?
"maybe"
A class implementing Kleene's three-valued logic.
Definition trival.hh:33
constexpr bool is_known() const
Is true or false, but not maybe.
Definition trival.hh:72
Definition automata.hh:26
Please direct any
question,
comment, or
bug report to the Spot mailing list at
spot@lrde.epita.fr.
Generated on for spot by
1.15.0