5 #ifndef ILANG_ILA_MNGR_V_EQ_CHECK_REFINEMENT_H__
6 #define ILANG_ILA_MNGR_V_EQ_CHECK_REFINEMENT_H__
24 typedef std::shared_ptr<RefinementMap>
RefPtr;
44 inline const int&
step_appl()
const {
return step_appl_; }
46 inline const int&
step_orig()
const {
return step_orig_; }
50 inline size_t inv_num()
const {
return invs_.size(); }
52 inline ExprPtr inv(
const size_t& i)
const {
return invs_.at(i); }
87 ExprPtr cmpl_ = asthub::BoolConst(
true);
93 std::vector<ExprPtr> invs_;
105 typedef std::shared_ptr<RelationMap>
RelPtr;
127 ExprPtr acc_ = asthub::BoolConst(
true);
143 typedef std::shared_ptr<CompRefRel>
CrrPtr;
192 bool EqCheck(
const int& max = 10);
198 bool IncEqCheck(
const int& min = 0,
const int& max = 10,
const int& step = 1);
200 bool IncCheck(
const int& min = 0,
const int& max = 10,
const int& step = 1);
215 enum UID { A_OLD, A_NEW, B_OLD, B_NEW };
220 } uu_a_old_, uu_a_new_, uu_b_old_, uu_b_new_;
230 Unroll& GetUnrl(
const UID& uid);
235 RefPtr GetRefine(
const UID& uid);
236 UnrlUnit& GetUnrlUnit(
const UID& uid);
237 const ExprSet& GetStts(
const UID& uid);
239 z3::expr GetZ3IncFlsh(
const UID& uid);
240 z3::expr GetZ3IncCmpl(
const UID& uid);
243 static const std::string k_suff_old_;
244 static const std::string k_suff_new_;
245 static const std::string k_suff_apl_;
250 z3::expr GetZ3ApplInstr(
const ExprSet& stts,
const RefPtr ref);
251 z3::expr GetZ3Assm();
252 z3::expr GetZ3Prop();
254 const int& end)
const;
256 const int& length,
const ExprSet& stts)
const;
257 bool CheckCmpl(z3::solver& s, z3::expr& cmpl_expr)
const;
260 static const std::string k_suff_orig_;
261 static const std::string k_suff_appl_;
266 bool SanityCheckRefinement(
const RefPtr ref);
270 int DetStepOrig(
const RefPtr ref,
const int& max);
271 int DetStepAppl(
const RefPtr ref,
const int& max);
272 bool CheckStepOrig(
const RefPtr ref,
const int& k);
273 bool CheckStepAppl(
const RefPtr ref,
const int& k);
275 z3::expr GenInit(
const RefPtr ref);
276 z3::expr GenTranRel(
const RefPtr ref,
const int& k_orig,
const int& k_appl);
281 const int& start,
const int& end)
const;
283 const int& start,
const int& end)
const;
284 z3::expr UnrollFlush(
MonoUnroll& unroller,
const RefPtr ref,
const int& base,
285 const int& length,
const int& start);
291 #endif // ILANG_ILA_MNGR_V_EQ_CHECK_REFINEMENT_H__
~CommDiag()
Default destructor.
bool IncEqCheck(const int &min=0, const int &max=10, const int &step=1)
Incrementally checking equivalence between two models based on the refinement relation up to the give...
void set_step_orig(const int &step)
Specify the number of steps required for flushing original path.
std::shared_ptr< CompRefRel > CrrPtr
Pointer type for passing around the compositional relation mapping.
Definition: v_eq_check_refinement.h:143
ExprPtr flush() const
Return the constraint for flushing (stall).
Definition: v_eq_check_refinement.h:40
static RelPtr New()
Create a new relation mapping. Used for hiding implementation specific type details.
size_t inv_num() const
Return the number of invariant.
Definition: v_eq_check_refinement.h:50
Expr::ExprPtr ExprPtr
Pointer type for normal use of Expr.
Definition: expr.h:138
CompRefRel(const RefPtr ref_a, const RefPtr ref_b, const RelPtr rel)
Default constructor.
RelPtr relation() const
Return the relation (state mapping) between model A and B.
Definition: v_eq_check_refinement.h:156
RelationMap()
Default constructor.
~CompRefRel()
Default destructor.
Application class for unrolling the ILA as a monolithic transition system.
Definition: u_unroller.h:232
ExprPtr cmpl() const
Return the constraint for completion indicator.
Definition: v_eq_check_refinement.h:42
CompRefRel::CrrPtr CrrPtr
Pointer type for passing around the compositional relation mapping.
Definition: v_eq_check_refinement.h:177
RefinementMap()
Default constructor.
std::unordered_set< ExprPtr, ExprHash > ExprSet
Type for storing a set of Expr.
Definition: expr.h:153
void set_tgt(const InstrLvlAbsPtr &tgt)
Define the target ILA (source for coi).
bool EqCheck(const int &max=10)
Check equivalence between two models based on the refinement relation up to the given unrolling bound...
RefinementMap::RefPtr RefPtr
Pointer type for passing around the refinement mapping.
Definition: v_eq_check_refinement.h:98
Relation mapping defines how arch states of two models are mapped, i.e., state mapping.
Definition: v_eq_check_refinement.h:102
Instr::InstrPtr InstrPtr
Pointer type for normal use of Instr.
Definition: instr.h:132
ExprPtr inv(const size_t &i) const
Access the i-th invariant.
Definition: v_eq_check_refinement.h:52
static RefPtr New()
Create a new refinement mapping. Used for hiding implementation specific type details.
Refinement mapping defines how to map micro-architectural states to architectural states for comparis...
Definition: v_eq_check_refinement.h:21
const int & step() const
Return the number of steps required for flushing. XXX.
Definition: v_eq_check_refinement.h:48
~RefinementMap()
Default destructor.
InstrLvlAbsPtr ila() const
Return the target (top-ILA).
Definition: v_eq_check_refinement.h:36
InstrLvlAbsPtr coi() const
Return the target (top-ILA containing the COI).
Definition: v_eq_check_refinement.h:34
InstrLvlAbs::InstrLvlAbsPtr InstrLvlAbsPtr
Pointer type for normal use of InstrLvlAbs.
Definition: instr_lvl_abs.h:326
void add_inv(const ExprPtr &inv)
Add an invariant.
const int & step_appl() const
Return the number of steps required for flushing apply path.
Definition: v_eq_check_refinement.h:44
RefPtr refine_b() const
Return the refinement for model B.
Definition: v_eq_check_refinement.h:154
void add(const ExprPtr &rel)
Add one relation.
~RelationMap()
Default destructor.
Compositional refinement relation defines a unit (element for the composition) of refinement relation...
Definition: v_eq_check_refinement.h:139
void set_step_appl(const int &step)
Specify the number of steps required for flushing apply path.
const int & step_orig() const
Return the number of steps required for flushing original path.
Definition: v_eq_check_refinement.h:46
std::shared_ptr< RelationMap > RelPtr
Pointer type for passing around the relation mapping.
Definition: v_eq_check_refinement.h:105
ExprPtr appl() const
Return the apply function.
Definition: v_eq_check_refinement.h:38
static CrrPtr New(const RefPtr ref_a=RefinementMap::New(), const RefPtr ref_b=RefinementMap::New(), const RelPtr rel=RelationMap::New())
Create a new CRR object. Used for hiding implementation specific type details.
RelationMap::RelPtr RelPtr
Pointer type for passing around the relation mapping.
Definition: v_eq_check_refinement.h:132
Generator for commutating diagram-based equivalence checking.
Definition: v_eq_check_refinement.h:180
RefPtr refine_a() const
Return the refinement for model A.
Definition: v_eq_check_refinement.h:152
void set_flush(const ExprPtr &flush)
Define the flushing function.
std::shared_ptr< RefinementMap > RefPtr
Pointer type for passing around the refinement mapping.
Definition: v_eq_check_refinement.h:24
void set_cmpl(const ExprPtr &cmpl)
Define the completion scenario (e.g. dummy end).
CommDiag(z3::context &ctx, const CrrPtr crr)
Default constructor.
void set_appl(const ExprPtr &appl)
Define the apply function.
void set_step(const int &step)
Specify the number of steps required for flushing. XXX.
Definition: v_eq_check_refinement.h:65