Skip to content

Commit 0e5070b

Browse files
committed
Extended CEGIS refactorig processor factory interface.
1 parent 5fd6f6e commit 0e5070b

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

src/cegis/instrument/literals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define CEGIS_EXECUTE "__CPROVER_danger_execute"
1818
#define CEGIS_RESULT_OPS "__CPROVER_cegis_RESULT_OPS"
1919
#define CEGIS_MODULE "<builtin-library-cegis>"
20-
#define CEGIS_PREFIX "__CPROVER_cegis_"
20+
#define CEGIS_PREFIX CPROVER_PREFIX "cegis_"
2121
#define CEGIS_TMP_PREFIX CEGIS_PREFIX "tmp_"
2222
#define CEGIS_PRIME_SUFFIX "_prime"
2323
#define CEGIS_CONSTANT_PREFIX "CEGIS_CONSTANT_"

src/cegis/refactor/instructionset/create_cegis_processor.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <cegis/instrument/literals.h>
2+
13
#include <cegis/refactor/instructionset/create_cegis_processor.h>
24

35
namespace
@@ -24,9 +26,12 @@ std::set<typet> collect_context_types(const goto_ranget &range)
2426
return collector.types;
2527
}
2628

27-
void create_cegis_processor(const std::set<typet> &state_types,
29+
#define CEGIS_PROCESSOR_FUNCTION_PREFIX CEGIS_PREFIX "processor_"
30+
31+
std::string create_cegis_processor(const std::set<typet> &state_types,
2832
const size_t var_slots_per_state_type, const std::set<typet> &context_types)
2933
{
34+
std::string processor_name(CEGIS_PROCESSOR_FUNCTION_PREFIX);
3035
// TODO: Implement
3136
assert(false);
3237
}

src/cegis/refactor/instructionset/create_cegis_processor.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,17 @@ std::set<typet> collect_context_types(const goto_ranget &range);
3232
*
3333
* @details
3434
*
35+
* @param st
36+
* @param gf
3537
* @param state_types
3638
* @param var_slots_per_state_type
3739
* @param context_types
40+
*
41+
* @return
3842
*/
39-
void create_cegis_processor(
43+
std::string create_cegis_processor(
44+
symbol_tablet &st,
45+
goto_functionst &gf,
4046
const std::set<typet> &state_types,
4147
size_t var_slots_per_state_type,
4248
const std::set<typet> &context_types);

src/cegis/refactor/options/refactor_program.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class refactor_programt
4747
goto_ranget spec_range;
4848
std::set<irep_idt> state_vars;
4949
std::set<typet> types;
50+
std::string processor_function;
5051
};
5152

5253
/**

src/cegis/refactor/preprocessing/refactor_preprocessing.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ void refactor_preprocessingt::operator()()
3030
break;
3131
}
3232
for (refactor_programt::sketcht &s : original_program.sketches)
33+
{
3334
s.state_vars=collect_state_vars(s.spec_range.first, s.spec_range.second);
35+
// TODO: construct_instruction_set(original_program); // Multiple?
36+
}
3437
// TODO: Insert extern programs.
35-
// TODO: construct_instruction_set(original_program); // Multiple?
3638
switch (type)
3739
{
3840
case refactoring_typet::NULL_OBJECT:

0 commit comments

Comments
 (0)