Skip to content

Commit 327c2cd

Browse files
committed
Added additional CEGIS control solution type
Additional solution type, to be configured for CAV paper.
1 parent 76af25a commit 327c2cd

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include <goto-programs/goto_trace.h>
2+
3+
#include <cegis/control/value/control_vars.h>
4+
#include <cegis/control/learn/nondet_solution.h>
5+
#include <cegis/control/facade/rational_solution_configuration.h>
6+
7+
void nondeterminise_solution_configuration(symbol_tablet &st,
8+
goto_functionst &gf)
9+
{
10+
nondet_control_solution(st, gf);
11+
}
12+
13+
namespace
14+
{
15+
const struct_exprt &find_solution(const goto_tracet &trace)
16+
{
17+
for (const goto_trace_stept &step : trace.steps)
18+
{
19+
const exprt &lhs=step.full_lhs;
20+
if (ID_symbol != lhs.id()) continue;
21+
const std::string &id=id2string(to_symbol_expr(lhs).get_identifier());
22+
if (CEGIS_CONTROL_SOLUTION_VAR_NAME != id) continue;
23+
return to_struct_expr(step.full_lhs_value);
24+
}
25+
assert(!"Control solution not found in trace.");
26+
}
27+
}
28+
29+
void convert(control_solutiont &current_candidate, const goto_tracet &trace)
30+
{
31+
}
32+
33+
void show_candidate(messaget::mstreamt &os, const control_solutiont &candidate)
34+
{
35+
36+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*******************************************************************
2+
3+
Module: Counterexample-Guided Inductive Synthesis
4+
5+
Author: Daniel Kroening, [email protected]
6+
Pascal Kesseli, [email protected]
7+
8+
\*******************************************************************/
9+
10+
#ifndef CEGIS_CONTROL_FACADE_RATIONAL_SOLUTION_CONFIGURATION_H_
11+
#define CEGIS_CONTROL_FACADE_RATIONAL_SOLUTION_CONFIGURATION_H_
12+
13+
#include <util/message.h>
14+
15+
/**
16+
* @brief
17+
*
18+
* @details
19+
*/
20+
class rational_solution_configurationt
21+
{
22+
public:
23+
/**
24+
* @brief
25+
*
26+
* @details
27+
*
28+
* @param st
29+
* @param gf
30+
*/
31+
static void nondeterminise_solution_configuration(class symbol_tablet &st, class goto_functionst &gf);
32+
33+
/**
34+
* @brief
35+
*
36+
* @details
37+
*
38+
* @param current_candidate
39+
* @param trace
40+
*/
41+
static void convert(class control_solutiont &current_candidate, const class goto_tracet &trace);
42+
43+
/**
44+
* @brief
45+
*
46+
* @details
47+
*
48+
* @param os
49+
* @param candidate
50+
*/
51+
static void show_candidate(messaget::mstreamt &os, const control_solutiont &candidate);
52+
};
53+
54+
#endif /* CEGIS_CONTROL_FACADE_RATIONAL_SOLUTION_CONFIGURATION_H_ */

0 commit comments

Comments
 (0)