Raven Core  3.0.0
P2P Digital Currency
Public Types | Static Public Member Functions | Static Private Member Functions | List of all members
LibBoolEE Class Reference

Class able to resolve any logical function in propositional logic. More...

#include <LibBoolEE.h>

Public Types

typedef std::map< std::string, bool > Vals
 Valuation of atomic propositions. More...
 
typedef std::pair< std::string, bool > Val
 A single proposition valuation. More...
 

Static Public Member Functions

static bool resolve (const std::string &source, const Vals &valuation)
 
static std::string removeWhitespaces (const std::string &source)
 
static std::string removeCharacter (const std::string &source, const char ch)
 

Static Private Member Functions

static std::vector< std::string > singleParse (const std::string &formula, const char op)
 
static bool belongsToName (const char ch)
 
static bool resolveRec (const std::string &source, const Vals &valuation)
 
static std::string trim (const std::string &source)
 

Detailed Description

Class able to resolve any logical function in propositional logic.

This is a static helper class able of resolving any preposition logic formula. Formula construction:

  1. $tt$ (true) and $ff$ (false) are formulas representing true and false respectively,
    1. any variable is a formula,
  2. for $\varphi$ formula is $!\varphi$ formula,
  3. for $\psi, \varphi$ formulas are $(\psi|\varphi)$, $(\psi\&\varphi)$ formulas representing logical disjunction and conjunction respectively,
  4. nothing else is a formula,
  5. whitespaces are ignored.

Definition at line 40 of file LibBoolEE.h.

Member Typedef Documentation

◆ Val

typedef std::pair<std::string, bool> LibBoolEE::Val

A single proposition valuation.

Definition at line 43 of file LibBoolEE.h.

◆ Vals

typedef std::map<std::string, bool> LibBoolEE::Vals

Valuation of atomic propositions.

Definition at line 42 of file LibBoolEE.h.

Member Function Documentation

◆ belongsToName()

bool LibBoolEE::belongsToName ( const char  ch)
staticprivate

Definition at line 127 of file LibBoolEE.cpp.

Here is the caller graph for this function:

◆ removeCharacter()

std::string LibBoolEE::removeCharacter ( const std::string &  source,
const char  ch 
)
static

Definition at line 141 of file LibBoolEE.cpp.

Here is the caller graph for this function:

◆ removeWhitespaces()

std::string LibBoolEE::removeWhitespaces ( const std::string &  source)
static

Definition at line 131 of file LibBoolEE.cpp.

Here is the caller graph for this function:

◆ resolve()

bool LibBoolEE::resolve ( const std::string &  source,
const Vals valuation 
)
static

Definition at line 59 of file LibBoolEE.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolveRec()

bool LibBoolEE::resolveRec ( const std::string &  source,
const Vals valuation 
)
staticprivate

Definition at line 63 of file LibBoolEE.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ singleParse()

std::vector< std::string > LibBoolEE::singleParse ( const std::string &  formula,
const char  op 
)
staticprivate

Definition at line 19 of file LibBoolEE.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trim()

std::string LibBoolEE::trim ( const std::string &  source)
staticprivate

Definition at line 121 of file LibBoolEE.cpp.


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