本文整理汇总了C++中statet::data_w方法的典型用法代码示例。如果您正苦于以下问题:C++ statet::data_w方法的具体用法?C++ statet::data_w怎么用?C++ statet::data_w使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类statet
的用法示例。
在下文中一共展示了statet::data_w方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute_assume
void simulator_ctt::execute_assume(
statet &state,
const program_formulat::formula_goto_programt::instructiont &instruction)
{
formulat condition=
instantiate(state, 0, instruction.guard);
if(condition.is_true()) return;
// just add it to the guard
state.data_w().guard=
formula_container.gen_and(state.data_w().guard, condition);
}
示例2: execute_assign
void simulator_ctt::execute_assign(
statet &state,
const program_formulat::formula_goto_programt::instructiont &instruction)
{
statet new_state(state);
new_state.detatch();
for(program_formulat::assignst::const_iterator
it=instruction.code.assigns.begin();
it!=instruction.code.assigns.end();
it++)
if(it->in_use)
{
assert(it->variable<program_formula.variables.size());
new_state.data_w().set_var(
it->variable,
0,
instantiate(state, 0, it->value));
}
// do constraint
formulat instantiated_constraint=
instantiate(
state,
new_state,
0,
instruction.code.constraint);
new_state.data_w().guard=
formula_container.gen_and(
state.data_w().guard,
instantiated_constraint);
state.swap(new_state);
}
示例3: execute_assert
void simulator_ctt::execute_assert(
statet &state,
const program_formulat::formula_goto_programt::instructiont &instruction)
{
std::cout << "CHECKING ASSERTION\n";
formulat condition=
instantiate(state, 0, instruction.guard);
formulat property=
formula_container.gen_and(
state.data().guard,
formula_container.gen_not(condition));
// see if it is reachable
if(!property.is_false() &&
is_satisfiable(property))
{
tracet trace;
compute_trace(state, trace, true);
dump_trace(trace, instruction);
std::cout << "Assertion violated" << std::endl;
std::cout << std::endl;
error_state_found=true;
}
#if 0
else
{
// otherwise, treat this like an assumption
state.data_w().guard=
formula_container.gen_and(state.data().guard, condition);
}
#endif
}
示例4: execute_instruction
void simulator_ctt::execute_instruction(
statet &state,
const program_formulat::formula_goto_programt::instructiont &instruction)
{
switch(instruction.type)
{
case GOTO:
assert(false);
// done somewhere else
break;
case ASSUME:
execute_assume(state, instruction);
break;
case ASSERT:
execute_assert(state, instruction);
break;
case ASSIGN:
execute_assign(state, instruction);
break;
case FUNCTION_CALL:
assert(false); // done somewhere else
break;
case OTHER:
assert(false);
break;
case SKIP:
case LOCATION:
case END_FUNCTION:
// do nothing
break;
case START_THREAD:
throw "start_thread is not supported";
break;
case END_THREAD:
assert(false);
break;
case ATOMIC_BEGIN:
state.data_w().in_atomic_section=true;
break;
case ATOMIC_END:
state.data_w().in_atomic_section=false;
break;
case DEAD:
break;
case RETURN:
assert(false); // done somewhere else
break;
default:
std::cerr << instruction.type << std::endl;
assert(false);
}
}