CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cegis_evaluator.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Evaluate if an expression is consistent with examples
4
5Author: Qinheping Hu
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_GOTO_SYNTHESIZER_CEGIS_EVALUATOR_H
13#define CPROVER_GOTO_SYNTHESIZER_CEGIS_EVALUATOR_H
14
15#include "cegis_verifier.h"
16
20{
21public:
22 cegis_evaluatort(const exprt &expr, const std::vector<cext> &cexs)
23 : checked_expr(expr), cexs(cexs)
24 {
25 }
26
27 // Evaluate if the expression `checked_expr` is consistent with `cexs`.
28 // Return true if `checked_expr` is consistent with all examples.
29 bool evaluate();
30
31protected:
32 // Recursively evaluate boolean expressions on `cex`.
33 // If `is_positive` is set, evaluate on the positive example in `cex`.
34 // The positive example is the test collected from the first iteration of
35 // loop---the loop_entry valuation.
36 bool
37 evaluate_rec_bool(const exprt &expr, const cext &cex, const bool is_positive);
38
39 // Recursively evaluate integer expressions on `cex`.
40 // If `is_positive` is set, evaluate on the positive example in `cex`.
41 // The positive example is the test collected from the first iteration of
42 // loop---the loop_entry valuation.
44 evaluate_rec_int(const exprt &expr, const cext &cex, const bool is_positive);
45
49 const std::vector<cext> &cexs;
50};
51
52#endif // CPROVER_GOTO_SYNTHESIZER_CEGIS_EVALUATOR_H
Verifier for Counterexample-Guided Synthesis.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
Evaluator for checking if an expression is consistent with a given set of test cases (positive exampl...
const std::vector< cext > & cexs
The set of examples evaluated against.
const exprt & checked_expr
The expression being evaluated.
bool evaluate_rec_bool(const exprt &expr, const cext &cex, const bool is_positive)
mp_integer evaluate_rec_int(const exprt &expr, const cext &cex, const bool is_positive)
cegis_evaluatort(const exprt &expr, const std::vector< cext > &cexs)
Formatted counterexample.
Base class for all expressions.
Definition expr.h:56
BigInt mp_integer
Definition smt_terms.h:17
exprt is_positive(const exprt &x)