本文整理汇总了C++中prop_convt::l_get方法的典型用法代码示例。如果您正苦于以下问题:C++ prop_convt::l_get方法的具体用法?C++ prop_convt::l_get怎么用?C++ prop_convt::l_get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prop_convt
的用法示例。
在下文中一共展示了prop_convt::l_get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
symex_target_equationt::SSA_stepst::const_iterator
counterexample_beautificationt::get_failed_property(
const prop_convt &prop_conv,
const symex_target_equationt &equation)
{
// find failed property
for(symex_target_equationt::SSA_stepst::const_iterator
it=equation.SSA_steps.begin();
it!=equation.SSA_steps.end(); it++)
if(it->is_assert() &&
prop_conv.l_get(it->guard_literal).is_true() &&
prop_conv.l_get(it->cond_literal).is_false())
return it;
assert(false);
return equation.SSA_steps.end();
}
示例2: get_minimization_list
void counterexample_beautificationt::get_minimization_list(
prop_convt &prop_conv,
const symex_target_equationt &equation,
minimization_listt &minimization_list)
{
// ignore the ones that are assigned under false guards
for(symex_target_equationt::SSA_stepst::const_iterator
it=equation.SSA_steps.begin();
it!=equation.SSA_steps.end(); it++)
{
if(it->is_assignment() &&
it->assignment_type==symex_targett::assignment_typet::STATE)
{
if(!prop_conv.l_get(it->guard_literal).is_false())
{
const typet &type=it->ssa_lhs.type();
if(type!=bool_typet())
{
// we minimize the absolute value, if applicable
if(type.id()==ID_signedbv ||
type.id()==ID_fixedbv ||
type.id()==ID_floatbv)
{
abs_exprt abs_expr(it->ssa_lhs);
minimization_list.insert(abs_expr);
}
else
minimization_list.insert(it->ssa_lhs);
}
}
}
// reached failed assertion?
if(it==failed)
break;
}
}
示例3: build_goto_trace
void build_goto_trace(
const symex_target_equationt &target,
symex_target_equationt::SSA_stepst::const_iterator end_step,
const prop_convt &prop_conv,
const namespacet &ns,
goto_tracet &goto_trace)
{
// We need to re-sort the steps according to their clock.
// Furthermore, read-events need to occur before write
// events with the same clock.
typedef std::map<mp_integer, goto_tracet::stepst> time_mapt;
time_mapt time_map;
mp_integer current_time=0;
for(symex_target_equationt::SSA_stepst::const_iterator
it=target.SSA_steps.begin();
it!=end_step;
it++)
{
const symex_target_equationt::SSA_stept &SSA_step=*it;
if(prop_conv.l_get(SSA_step.guard_literal)!=tvt(true))
continue;
if(it->is_constraint() ||
it->is_spawn())
continue;
else if(it->is_atomic_begin())
{
// for atomic sections the timing can only be determined once we see
// a shared read or write (if there is none, the time will be
// reverted to the time before entering the atomic section); we thus
// use a temporary negative time slot to gather all events
current_time*=-1;
continue;
}
else if(it->is_shared_read() || it->is_shared_write() ||
it->is_atomic_end())
{
mp_integer time_before=current_time;
if(it->is_shared_read() || it->is_shared_write())
{
// these are just used to get the time stamp
exprt clock_value=prop_conv.get(
symbol_exprt(partial_order_concurrencyt::rw_clock_id(it)));
to_integer(clock_value, current_time);
}
else if(it->is_atomic_end() && current_time<0)
current_time*=-1;
assert(current_time>=0);
// move any steps gathered in an atomic section
if(time_before<0)
{
time_mapt::iterator entry=
time_map.insert(std::make_pair(
current_time,
goto_tracet::stepst())).first;
entry->second.splice(entry->second.end(), time_map[time_before]);
time_map.erase(time_before);
}
continue;
}
// drop PHI and GUARD assignments altogether
if(it->is_assignment() &&
(SSA_step.assignment_type==symex_target_equationt::PHI ||
SSA_step.assignment_type==symex_target_equationt::GUARD))
continue;
goto_tracet::stepst &steps=time_map[current_time];
steps.push_back(goto_trace_stept());
goto_trace_stept &goto_trace_step=steps.back();
goto_trace_step.thread_nr=SSA_step.source.thread_nr;
goto_trace_step.pc=SSA_step.source.pc;
goto_trace_step.comment=SSA_step.comment;
if(SSA_step.ssa_lhs.is_not_nil())
goto_trace_step.lhs_object=ssa_exprt(SSA_step.ssa_lhs.get_original_expr());
else
goto_trace_step.lhs_object.make_nil();
goto_trace_step.type=SSA_step.type;
goto_trace_step.hidden=SSA_step.hidden;
goto_trace_step.format_string=SSA_step.format_string;
goto_trace_step.io_id=SSA_step.io_id;
goto_trace_step.formatted=SSA_step.formatted;
goto_trace_step.identifier=SSA_step.identifier;
goto_trace_step.assignment_type=
(it->is_assignment()&&
(SSA_step.assignment_type==symex_targett::VISIBLE_ACTUAL_PARAMETER ||
SSA_step.assignment_type==symex_targett::HIDDEN_ACTUAL_PARAMETER))?
goto_trace_stept::ACTUAL_PARAMETER:
goto_trace_stept::STATE;
//.........这里部分代码省略.........
示例4: build_goto_trace
void build_goto_trace(
const symex_target_equationt &target,
const prop_convt &prop_conv,
const namespacet &ns,
goto_tracet &goto_trace)
{
// We need to re-sort the steps according to their clock.
// Furthermore, read-events need to occur before write
// events with the same clock.
typedef std::map<mp_integer, goto_tracet::stepst> time_mapt;
time_mapt time_map;
mp_integer current_time=0;
for(symex_target_equationt::SSA_stepst::const_iterator
it=target.SSA_steps.begin();
it!=target.SSA_steps.end();
it++)
{
const symex_target_equationt::SSA_stept &SSA_step=*it;
if(prop_conv.l_get(SSA_step.guard_literal)!=tvt(true))
continue;
if(it->is_constraint() ||
it->is_spawn())
continue;
else if(it->is_atomic_begin())
{
// for atomic sections the timing can only be determined once we see
// a shared read or write (if there is none, the time will be
// reverted to the time before entering the atomic section); we thus
// use a temporary negative time slot to gather all events
current_time*=-1;
continue;
}
else if(it->is_shared_read() || it->is_shared_write() ||
it->is_atomic_end())
{
mp_integer time_before=current_time;
if(it->is_shared_read() || it->is_shared_write())
{
// these are just used to get the time stamp
exprt clock_value=prop_conv.get(
symbol_exprt(partial_order_concurrencyt::rw_clock_id(it)));
to_integer(clock_value, current_time);
}
else if(it->is_atomic_end() && current_time<0)
current_time*=-1;
assert(current_time>=0);
// move any steps gathered in an atomic section
if(time_before<0)
{
time_mapt::iterator entry=
time_map.insert(std::make_pair(
current_time,
goto_tracet::stepst())).first;
entry->second.splice(entry->second.end(), time_map[time_before]);
time_map.erase(time_before);
}
continue;
}
// drop PHI and GUARD assignments altogether
if(it->is_assignment() &&
(SSA_step.assignment_type==symex_target_equationt::PHI ||
SSA_step.assignment_type==symex_target_equationt::GUARD))
continue;
goto_tracet::stepst &steps=time_map[current_time];
steps.push_back(goto_trace_stept());
goto_trace_stept &goto_trace_step=steps.back();
goto_trace_step.thread_nr=SSA_step.source.thread_nr;
goto_trace_step.pc=SSA_step.source.pc;
goto_trace_step.comment=SSA_step.comment;
goto_trace_step.lhs_object=SSA_step.original_lhs_object;
goto_trace_step.type=SSA_step.type;
goto_trace_step.hidden=SSA_step.hidden;
goto_trace_step.format_string=SSA_step.format_string;
goto_trace_step.io_id=SSA_step.io_id;
goto_trace_step.formatted=SSA_step.formatted;
goto_trace_step.identifier=SSA_step.identifier;
goto_trace_step.assignment_type=
(SSA_step.assignment_type==symex_targett::VISIBLE_ACTUAL_PARAMETER ||
SSA_step.assignment_type==symex_targett::HIDDEN_ACTUAL_PARAMETER)?
goto_trace_stept::ACTUAL_PARAMETER:
goto_trace_stept::STATE;
if(SSA_step.original_full_lhs.is_not_nil())
goto_trace_step.full_lhs=
build_full_lhs_rec(
prop_conv, ns, SSA_step.original_full_lhs, SSA_step.ssa_full_lhs);
//.........这里部分代码省略.........