replicode
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
r_exec::MDLController Class Referenceabstract

#include <mdl_controller.h>

Inheritance diagram for r_exec::MDLController:
Inheritance graph
Collaboration diagram for r_exec::MDLController:
Collaboration graph

Classes

class  RCache
 
class  REntry
 

Public Member Functions

void add_monitor (PMonitor *m)
 
void remove_monitor (PMonitor *m)
 
_Factget_lhs () const
 
_Factget_rhs () const
 
Factget_f_ihlp (HLPBindingMap *bindings, bool wr_enabled) const
 
virtual void store_requirement (_Fact *f_p_f_imdl, MDLController *controller, bool chaining_was_allowed, bool simulation)=0
 
ChainingStatus retrieve_imdl_fwd (HLPBindingMap *bm, Fact *f_imdl, RequirementsPair &r_p, Fact *&ground, MDLController *req_controller, bool &wr_enabled)
 
ChainingStatus retrieve_imdl_bwd (HLPBindingMap *bm, Fact *f_imdl, Fact *&ground)
 
ChainingStatus retrieve_simulated_imdl_fwd (HLPBindingMap *bm, Fact *f_imdl, Controller *root)
 
ChainingStatus retrieve_simulated_imdl_bwd (HLPBindingMap *bm, Fact *f_imdl, Controller *root)
 
virtual void predict (HLPBindingMap *bm, _Fact *input, Fact *f_imdl, bool chaining_was_allowed, RequirementsPair &r_p, Fact *ground)=0
 
virtual void register_pred_outcome (Fact *f_pred, bool success, _Fact *evidence, double confidence, bool rate_failures)=0
 
virtual void register_req_outcome (Fact *f_pred, bool success, bool rate_failures)=0
 
void add_requirement_to_rhs ()
 
void remove_requirement_from_rhs ()
 
bool is_requirement () const
 
bool is_reuse () const
 
bool is_cmd () const
 
void register_requirement (_Fact *f_pred, RequirementsPair &r_p)
 
- Public Member Functions inherited from r_exec::HLPController
virtual ~HLPController ()
 
void invalidate ()
 
Codeget_core_object () const
 
Codeget_unpacked_object () const
 
void add_requirement (bool strong)
 
void remove_requirement (bool strong)
 
uint64_t get_requirement_count (uint64_t &weak_requirement_count, uint64_t &strong_requirement_count)
 
uint64_t get_requirement_count ()
 
void store_evidence (_Fact *evidence)
 
void store_predicted_evidence (_Fact *evidence)
 
uint16_t get_out_group_count () const
 
Codeget_out_group (uint16_t i) const
 
Groupget_host () const
 
bool has_tpl_args () const
 
void inject_prediction (Fact *prediction, double confidence) const
 
- Public Member Functions inherited from r_exec::OController
virtual ~OController ()
 
- Public Member Functions inherited from r_exec::Controller
virtual ~Controller ()
 
uint64_t get_tsc ()
 
bool is_invalidated ()
 
void activate (bool a)
 
bool is_activated () const
 
bool is_alive () const
 
r_code::CodegetObject () const
 
r_exec::ViewgetView () const
 
void _take_input (r_exec::View *input)
 
virtual void gain_activation ()
 
virtual void lose_activation ()
 
void set_view (View *view)
 
void debug (View *input)
 
- Public Member Functions inherited from core::_Object
virtual ~_Object ()
 
void incRef ()
 
virtual void decRef ()
 

Static Public Member Functions

static MDLControllerNew (View *view, bool &inject_in_secondary_group)
 

Protected Types

enum  RType { NaR = 0, WR = 1, SR = 2 }
 

Protected Member Functions

void _store_requirement (r_code::list< REntry > *cache, REntry &e)
 
float get_cfd () const
 
template<class C >
void reduce_cache (Fact *f_p_f_imdl, MDLController *controller)
 
template<class E >
void reduce_cache (Cache< E > *cache, Fact *f_p_f_imdl, MDLController *controller)
 
bool monitor_predictions (_Fact *input)
 predictions are admissible inputs (for checking predicted counter-evidences). More...
 
 MDLController (r_code::View *view)
 
- Protected Member Functions inherited from r_exec::HLPController
template<class E >
void _store_evidence (Cache< E > *cache, _Fact *evidence)
 
bool evaluate_bwd_guards (HLPBindingMap *bm)
 
MatchResult check_evidences (_Fact *target, _Fact *&evidence)
 
MatchResult check_predicted_evidences (_Fact *target, _Fact *&evidence)
 
bool is_orphan ()
 
bool become_invalidated ()
 
virtual void kill_views ()
 
virtual void check_last_match_time (bool match)=0
 
 HLPController (r_code::View *view)
 
- Protected Member Functions inherited from r_exec::OController
 OController (r_code::View *view)
 
- Protected Member Functions inherited from r_exec::Controller
virtual void take_input (r_exec::View *input)
 
template<class C >
void __take_input (r_exec::View *input)
 
 Controller (r_code::View *view)
 
- Protected Member Functions inherited from core::_Object
 _Object ()
 

Protected Attributes

RCache requirements
 
RCache simulated_requirements
 
std::mutex m_monitorMutex
 
r_code::list< P< PMonitor > > p_monitors
 
P< Codelhs
 
P< Coderhs
 
RType _is_requirement
 
bool _is_reuse
 
bool _is_cmd
 
std::mutex m_activeRequirementsMutex
 
std::unordered_map< P< _Fact >, RequirementsPair, PHash< _Fact > > active_requirements
 
- Protected Attributes inherited from r_exec::HLPController
Cache< EEntryevidences
 
Cache< PEEntrypredicted_evidences
 
P< HLPBindingMapbindings
 
bool _has_tpl_args
 
uint64_t ref_count
 
std::vector< P< HLPController > > controllers
 
uint64_t last_match_time
 
- Protected Attributes inherited from r_exec::OController
r_code::list< P< Overlay > > overlays
 
- Protected Attributes inherited from r_exec::Controller
volatile uint64_t invalidated
 
volatile uint64_t activated
 
uint64_t tsc
 
r_code::Viewview
 
std::mutex m_reductionMutex
 
- Protected Attributes inherited from core::_Object
std::atomic_int_fast64_t refCount
 

Static Protected Attributes

static const uint64_t LHSController = 0
 
static const uint64_t RHSController = 1
 

Member Enumeration Documentation

Enumerator
NaR 
WR 
SR 

Constructor & Destructor Documentation

r_exec::MDLController::MDLController ( r_code::View view)
protected

Here is the call graph for this function:

Member Function Documentation

void r_exec::MDLController::_store_requirement ( r_code::list< REntry > *  cache,
REntry e 
)
protected

Here is the call graph for this function:

Here is the caller graph for this function:

void r_exec::MDLController::add_monitor ( PMonitor m)

Here is the caller graph for this function:

void r_exec::MDLController::add_requirement_to_rhs ( )

Here is the call graph for this function:

Here is the caller graph for this function:

float r_exec::MDLController::get_cfd ( ) const
protected

Here is the call graph for this function:

Here is the caller graph for this function:

Fact * r_exec::MDLController::get_f_ihlp ( HLPBindingMap bindings,
bool  wr_enabled 
) const
inlinevirtual

Implements r_exec::HLPController.

Here is the call graph for this function:

Here is the caller graph for this function:

_Fact * r_exec::MDLController::get_lhs ( ) const
inline

Here is the caller graph for this function:

_Fact * r_exec::MDLController::get_rhs ( ) const
inline
bool r_exec::MDLController::is_cmd ( ) const
inline

Here is the caller graph for this function:

bool r_exec::MDLController::is_requirement ( ) const
inline

Here is the caller graph for this function:

bool r_exec::MDLController::is_reuse ( ) const
inline

Here is the caller graph for this function:

bool r_exec::MDLController::monitor_predictions ( _Fact input)
protected

predictions are admissible inputs (for checking predicted counter-evidences).

Here is the call graph for this function:

Here is the caller graph for this function:

MDLController * r_exec::MDLController::New ( View view,
bool &  inject_in_secondary_group 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void r_exec::MDLController::predict ( HLPBindingMap bm,
_Fact input,
Fact f_imdl,
bool  chaining_was_allowed,
RequirementsPair r_p,
Fact ground 
)
pure virtual
template<class C >
void r_exec::MDLController::reduce_cache ( Fact f_p_f_imdl,
MDLController controller 
)
inlineprotected

Here is the call graph for this function:

template<class E >
void r_exec::MDLController::reduce_cache ( Cache< E > *  cache,
Fact f_p_f_imdl,
MDLController controller 
)
inlineprotected

Here is the call graph for this function:

virtual void r_exec::MDLController::register_pred_outcome ( Fact f_pred,
bool  success,
_Fact evidence,
double  confidence,
bool  rate_failures 
)
pure virtual

Implemented in r_exec::SecondaryMDLController, r_exec::PrimaryMDLController, and r_exec::TopLevelMDLController.

Here is the caller graph for this function:

virtual void r_exec::MDLController::register_req_outcome ( Fact f_pred,
bool  success,
bool  rate_failures 
)
pure virtual

Implemented in r_exec::SecondaryMDLController, r_exec::PrimaryMDLController, and r_exec::TopLevelMDLController.

Here is the caller graph for this function:

void r_exec::MDLController::register_requirement ( _Fact f_pred,
RequirementsPair r_p 
)

Here is the caller graph for this function:

void r_exec::MDLController::remove_monitor ( PMonitor m)

Here is the caller graph for this function:

void r_exec::MDLController::remove_requirement_from_rhs ( )

Here is the call graph for this function:

Here is the caller graph for this function:

ChainingStatus r_exec::MDLController::retrieve_imdl_bwd ( HLPBindingMap bm,
Fact f_imdl,
Fact *&  ground 
)

Here is the call graph for this function:

Here is the caller graph for this function:

ChainingStatus r_exec::MDLController::retrieve_imdl_fwd ( HLPBindingMap bm,
Fact f_imdl,
RequirementsPair r_p,
Fact *&  ground,
MDLController req_controller,
bool &  wr_enabled 
)

Here is the call graph for this function:

ChainingStatus r_exec::MDLController::retrieve_simulated_imdl_bwd ( HLPBindingMap bm,
Fact f_imdl,
Controller root 
)

Here is the call graph for this function:

Here is the caller graph for this function:

ChainingStatus r_exec::MDLController::retrieve_simulated_imdl_fwd ( HLPBindingMap bm,
Fact f_imdl,
Controller root 
)

Here is the call graph for this function:

virtual void r_exec::MDLController::store_requirement ( _Fact f_p_f_imdl,
MDLController controller,
bool  chaining_was_allowed,
bool  simulation 
)
pure virtual

Member Data Documentation

bool r_exec::MDLController::_is_cmd
protected
RType r_exec::MDLController::_is_requirement
protected
bool r_exec::MDLController::_is_reuse
protected
std::unordered_map<P<_Fact>, RequirementsPair, PHash<_Fact> > r_exec::MDLController::active_requirements
protected
P<Code> r_exec::MDLController::lhs
protected
const uint64_t r_exec::MDLController::LHSController = 0
staticprotected
std::mutex r_exec::MDLController::m_activeRequirementsMutex
protected
std::mutex r_exec::MDLController::m_monitorMutex
protected
r_code::list<P<PMonitor> > r_exec::MDLController::p_monitors
protected
RCache r_exec::MDLController::requirements
protected
P<Code> r_exec::MDLController::rhs
protected
const uint64_t r_exec::MDLController::RHSController = 1
staticprotected
RCache r_exec::MDLController::simulated_requirements
protected

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