spot 2.16
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
spot::trival Class Reference

A class implementing Kleene's three-valued logic. More...

#include <spot/misc/trival.hh>

Collaboration diagram for spot::trival:

Public Types

enum  value_t : repr_t { no_value = -1 , maybe_value = 0 , yes_value = 1 }
 The three possible logical values. More...
 
typedef signed char repr_t
 

Public Member Functions

constexpr trival (bool v) noexcept
 Construct from a bool: false maps to no, true to yes.
 
constexpr trival (value_t v)
 Construct from a value_t enumerator.
 
constexpr bool is_known () const
 Is true or false, but not maybe.
 
constexpr bool is_maybe () const
 Return true iff the value is maybe.
 
constexpr bool is_true () const
 Return true iff the logical value is yes.
 
constexpr bool is_false () const
 Return true iff the logical value is no.
 
constexpr value_t val () const
 Return the raw value_t enumerator.
 
constexpr operator bool () const
 Return true iff the value is yes.
 
constexpr trival operator! () const
 Return the three-valued logical negation.
 

Static Public Member Functions

static trival from_repr_t (repr_t v)
 Construct from a raw repr_t value.
 
static constexpr trival maybe () noexcept
 Return a trival representing the maybe (unknown) value.
 

Detailed Description

A class implementing Kleene's three-valued logic.

https://en.wikipedia.org/wiki/Three-valued_logic#Kleene_and_Priest_logics

Member Typedef Documentation

◆ repr_t

typedef signed char spot::trival::repr_t

Underlying integer representation type.

Member Enumeration Documentation

◆ value_t

The three possible logical values.

Constructor & Destructor Documentation

◆ trival() [1/2]

constexpr spot::trival::trival ( bool  v)
inlineconstexprnoexcept

Construct from a bool: false maps to no, true to yes.

◆ trival() [2/2]

constexpr spot::trival::trival ( value_t  v)
inlineexplicitconstexpr

Construct from a value_t enumerator.

Member Function Documentation

◆ from_repr_t()

static trival spot::trival::from_repr_t ( repr_t  v)
inlinestatic

Construct from a raw repr_t value.

◆ is_false()

constexpr bool spot::trival::is_false ( ) const
inlineconstexpr

Return true iff the logical value is no.

◆ is_known()

constexpr bool spot::trival::is_known ( ) const
inlineconstexpr

Is true or false, but not maybe.

◆ is_maybe()

constexpr bool spot::trival::is_maybe ( ) const
inlineconstexpr

Return true iff the value is maybe.

◆ is_true()

constexpr bool spot::trival::is_true ( ) const
inlineconstexpr

Return true iff the logical value is yes.

◆ maybe()

static constexpr trival spot::trival::maybe ( )
inlinestaticconstexprnoexcept

Return a trival representing the maybe (unknown) value.

Referenced by spot::operator&&(), and spot::operator||().

◆ operator bool()

constexpr spot::trival::operator bool ( ) const
inlineexplicitconstexpr

Return true iff the value is yes.

◆ operator!()

constexpr trival spot::trival::operator! ( ) const
inlineconstexpr

Return the three-valued logical negation.

◆ val()

constexpr value_t spot::trival::val ( ) const
inlineconstexpr

The documentation for this class was generated from the following file:

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.8