Formatting, initial state encoding
This commit is contained in:
3
mc.cc
3
mc.cc
@@ -7,7 +7,6 @@ ModelChecker::ModelChecker(SymRS *srs, Options *opts)
|
||||
|
||||
cuddMgr = srs->getCuddMgr();
|
||||
|
||||
if (!srs->usingContextAutomaton())
|
||||
initStates = srs->getEncInitStates();
|
||||
|
||||
totalStateVars = srs->getTotalStateVars();
|
||||
@@ -35,7 +34,7 @@ ModelChecker::ModelChecker(SymRS *srs, Options *opts)
|
||||
|
||||
if (srs->usingContextAutomaton())
|
||||
{
|
||||
ca_init_state = srs->getEncCtxAutInitState();
|
||||
// ca_init_state = srs->getEncCtxAutInitState();
|
||||
pv_ca = srs->getEncCtxAutPV();
|
||||
pv_ca_succ = srs->getEncCtxAutPVsucc();
|
||||
ca_tr = srs->getEncCtxAutTrans();
|
||||
|
||||
4
mc.hh
4
mc.hh
@@ -31,10 +31,10 @@ class ModelChecker
|
||||
BDD *trm;
|
||||
|
||||
// Context Automaton
|
||||
BDD *ca_init_state;
|
||||
vector<BDD> *pv_ca;
|
||||
vector<BDD> *pv_ca_succ;
|
||||
BDD *ca_tr;
|
||||
// BDD *ca_tr;
|
||||
// BDD *ca_init_state;
|
||||
|
||||
unsigned int trp_size;
|
||||
unsigned int totalStateVars;
|
||||
|
||||
35
symrs.cc
35
symrs.cc
@@ -337,8 +337,33 @@ BDD SymRS::encNoContext(void)
|
||||
|
||||
void SymRS::encodeInitStates(void)
|
||||
{
|
||||
VERB("Encoding initial states");
|
||||
if (usingContextAutomaton())
|
||||
{
|
||||
VERB("Encoding initial states (using context automaton)");
|
||||
encodeInitStatesForCtxAut();
|
||||
}
|
||||
else
|
||||
{
|
||||
VERB("Encoding initial states (for the action entities method -- no CA)");
|
||||
encodeInitStatesNoCtxAut();
|
||||
}
|
||||
VERB("Initial states encoded");
|
||||
}
|
||||
|
||||
void SymRS::encodeInitStatesForCtxAut(void)
|
||||
{
|
||||
initStates = new BDD(BDD_TRUE);
|
||||
|
||||
for (unsigned int i = 0; i < totalStateVars; ++i)
|
||||
{
|
||||
*initStates *= !(*pv)[i];
|
||||
}
|
||||
|
||||
*initStates *= getEncCtxAutInitState();
|
||||
}
|
||||
|
||||
void SymRS::encodeInitStatesNoCtxAut(void)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
if (opts->part_tr_rel)
|
||||
assert(partTrans != nullptr);
|
||||
@@ -370,8 +395,6 @@ void SymRS::encodeInitStates(void)
|
||||
|
||||
*initStates += q;
|
||||
}
|
||||
|
||||
VERB("Initial states encoded");
|
||||
}
|
||||
|
||||
void SymRS::mapStateToAct(void)
|
||||
@@ -487,15 +510,13 @@ BDD SymRS::encCtxAutState_raw(State state_id, bool succ) const
|
||||
return r;
|
||||
}
|
||||
|
||||
BDD *SymRS::getEncCtxAutInitState(void)
|
||||
BDD SymRS::getEncCtxAutInitState(void)
|
||||
{
|
||||
VERB_LN(2, "Encoding context automaton's initial state");
|
||||
|
||||
State state = rs->ctx_aut->getInitState();
|
||||
|
||||
BDD *r = new BDD(encCtxAutState(state));
|
||||
|
||||
return r;
|
||||
return encCtxAutState(state);
|
||||
}
|
||||
|
||||
BDD *SymRS::getEncCtxAutTrans(void)
|
||||
|
||||
4
symrs.hh
4
symrs.hh
@@ -113,6 +113,8 @@ class SymRS
|
||||
void encodeTransitions(void);
|
||||
void encodeTransitions_old(void);
|
||||
void encodeInitStates(void);
|
||||
void encodeInitStatesForCtxAut(void);
|
||||
void encodeInitStatesNoCtxAut(void);
|
||||
void mapStateToAct(void);
|
||||
void encode(void);
|
||||
|
||||
@@ -175,7 +177,7 @@ public:
|
||||
*
|
||||
* @return Returns the encoded state(s)
|
||||
*/
|
||||
BDD *getEncCtxAutInitState(void);
|
||||
BDD getEncCtxAutInitState(void);
|
||||
|
||||
/**
|
||||
* @brief Getter for context automaton's state variables (predecessor/non-primed)
|
||||
|
||||
Reference in New Issue
Block a user