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