pev_verify.h
Go to the documentation of this file.
1#ifndef FAUDES_PEV_VERIFY_PRIORITY_H
2#define FAUDES_PEV_VERIFY_PRIORITY_H
3
4
5#include "corefaudes.h"
6
7namespace faudes {
8
10public:
11 CompVerify(void){}
14 CompVerify(GeneratorVector& gvoi, const EventSet& pevs);
15 virtual ~CompVerify(void);
16
17 // counter example owns state attribute of the set of state indices matching the corresponding automata
18 class StateRef : public AttributeVoid{
19 FAUDES_TYPE_DECLARATION(Void,StateRef,AttribiteVoid)
20 public:
22 StateRef(const StateRef& rSrcAttr) : AttributeVoid() {mref=rSrcAttr.mref;}
23 virtual ~StateRef(void) {}
24
25 // find state idx set begin via candidate
26 Idx FindState(Candidate* cand){return mref.find(cand)->second;}
27 void InsertStateRef(Candidate* cand,Idx state) {mref.insert({cand,state});}
28 void DeleteStateRef(Candidate* cand){mref.erase(mref.find(cand));}
29 void ClearStateRef(){mref.clear();}
30 std::map<Candidate*, Idx>::iterator StateRefBegin(){return mref.begin();}
31 std::map<Candidate*, Idx>::iterator StateRefEnd(){return mref.end();}
32 protected:
33 /*!
34 * \brief mref
35 * This map links a candidate to a state index.
36 * Generally, we do not really know to which candidate automaton (i.e. raw, hidden, merged, etc)
37 * does the state index refer. However, as each step of the ce refinement do have a certain map
38 * from which type of candiate automaton to which, thus it shall not cause ambiguity.
39 * For Example, after each refinement iteration, state indices are referred to raw automata,
40 * which are further extracted to result (e.g. merged) automaton of the successive iteration
41 */
42 std::map<Candidate*,Idx> mref;
43 };
44
46
47 // convenient func for last state of a ce
48 static StateSet::Iterator LastState (CounterExample& ce);
50 virtual void VerifyAll(Generator& trace);
51 virtual bool IsNonconflicting();
53
54 /*!
55 * Generate trace to bad states, i.e. some root in a blocking scc.
56 *
57 * @param rGen
58 * the blocking automaton
59 */
60 virtual void GenerateTrace(const Generator& rGen);
61
62 /*!
63 * Generate the shortest path between given start and end state
64 * in a given automaton
65 *
66 * @param rGen
67 * the given automaton
68 * @param rRes
69 * the shortest path
70 * @param begin
71 * index of begin state
72 * @param end
73 * index of end state
74 * @return
75 * true if there exists a path between begin and end state
76 */
77 virtual bool ShortestPath(const Generator& rGen, Generator& rRes, Idx begin, Idx end);
78
79
80
81 /*! counter example re-generation algorithm */
82
83 /*!
84 * Clear all state attributes of a counter example. Intended for initialization
85 * @param rCE
86 * counter example
87 */
88 virtual void ClearAttribute (CounterExample& rCE);
89
90 /*!
91 * Extract state attributes from composed automaton to its original automata
92 * @param cand
93 * the composed camp, i.e. with mMap
94 * @param rCE
95 * the counter example
96 * @exception
97 * 599: candidate not composed
98 */
99 virtual void ExtractParallel (Candidate* cand,CounterExample& rCE);
100
101 /*!
102 * Expand counter example from state merging abstraction
103 *
104 * @param synchCands
105 * candidates (i.e. generators with their silentevs)
106 * @param cand
107 * the candidate which is abstracted
108 * @param rCE
109 * counter example, which is abstract at begin and shall be
110 * expanded to concrete finally w.r.t. cand
111 * @exception
112 * 500: concrete bad state can not be reached
113 * (this is theoretically impossible. Will only occur
114 * in case of implementation bugs)
115 */
116 virtual void StateMergingExpansion (
117 SynchCandidates* synchCands,
118 Candidate* cand,
119 CounterExample& rCE
120 );
121
122
123 /*!
124 * wrapper for counter example generation
125 */
126 virtual void CounterExampleRefinement();
127
128protected:
129 Generator mGenFinal; //result of final abstraction
130 CounterExample mCounterExp; // resulting trace if conflicting
131 std::stack<SynchCandidates*> mAllCandidates;
134};
135
136
137
138
139} // namespace
140
141#endif // VERIFY_PRIORITY_H
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
Definition cfl_types.h:918
StateRef(const StateRef &rSrcAttr)
Definition pev_verify.h:22
std::map< Candidate *, Idx >::iterator StateRefEnd()
Definition pev_verify.h:31
std::map< Candidate *, Idx > mref
mref This map links a candidate to a state index. Generally, we do not really know to which candidate...
Definition pev_verify.h:42
void DeleteStateRef(Candidate *cand)
Definition pev_verify.h:28
Idx FindState(Candidate *cand)
Definition pev_verify.h:26
std::map< Candidate *, Idx >::iterator StateRefBegin()
Definition pev_verify.h:30
void InsertStateRef(Candidate *cand, Idx state)
Definition pev_verify.h:27
virtual bool IsNonconflicting()
static StateSet::Iterator LastState(CounterExample &ce)
TaGenerator< AttributeVoid, StateRef, AttributeVoid, AttributeVoid > CounterExample
Definition pev_verify.h:45
std::stack< SynchCandidates * > mAllCandidates
Definition pev_verify.h:131
virtual ~CompVerify(void)
Generator mGenFinal
Definition pev_verify.h:129
virtual void CounterExampleRefinement()
EventSet AllPevs()
Definition pev_verify.h:49
CounterExample mCounterExp
Definition pev_verify.h:130
virtual void ExtractParallel(Candidate *cand, CounterExample &rCE)
virtual void StateMergingExpansion(SynchCandidates *synchCands, Candidate *cand, CounterExample &rCE)
virtual void ClearAttribute(CounterExample &rCE)
virtual bool ShortestPath(const Generator &rGen, Generator &rRes, Idx begin, Idx end)
virtual void GenerateTrace(const Generator &rGen)
virtual void VerifyAll(Generator &trace)
uint32_t Idx

libFAUDES 2.34d --- 2026.03.11 --- c++ api documentaion by doxygen