本文整理汇总了C++中goto_functionst::compute_loop_numbers方法的典型用法代码示例。如果您正苦于以下问题:C++ goto_functionst::compute_loop_numbers方法的具体用法?C++ goto_functionst::compute_loop_numbers怎么用?C++ goto_functionst::compute_loop_numbers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类goto_functionst
的用法示例。
在下文中一共展示了goto_functionst::compute_loop_numbers方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add_cegis_library
void add_cegis_library(symbol_tablet &st, goto_functionst &gf,
message_handlert &msg, const size_t num_vars, const size_t num_consts,
const size_t max_solution_size, const std::string &func_name)
{
add_execute_placeholder(st, func_name, cegis_execute_type());
std::set<irep_idt> functions;
functions.insert(func_name);
const std::string library_src(
get_cegis_library_text(num_vars, num_consts, max_solution_size,
func_name));
add_library(library_src, st, msg);
goto_convert(func_name, st, gf, msg);
gf.compute_loop_numbers();
gf.update();
set_init_values(st, gf);
}
示例2: process_goto_program
bool symex_parseoptionst::process_goto_program(
const optionst &options,
goto_functionst &goto_functions)
{
try
{
namespacet ns(symbol_table);
// do partial inlining
status() << "Partial Inlining" << eom;
goto_partial_inline(goto_functions, ns, ui_message_handler);
// add generic checks
status() << "Generic Property Instrumentation" << eom;
goto_check(ns, options, goto_functions);
// recalculate numbers, etc.
goto_functions.update();
// add loop ids
goto_functions.compute_loop_numbers();
// if we aim to cover, replace
// all assertions by false to prevent simplification
if(cmdline.isset("cover-assertions"))
make_assertions_false(goto_functions);
// show it?
if(cmdline.isset("show-loops"))
{
show_loop_ids(get_ui(), goto_functions);
return true;
}
// show it?
if(cmdline.isset("show-goto-functions"))
{
goto_functions.output(ns, std::cout);
return true;
}
}
catch(const char *e)
{
error(e);
return true;
}
catch(const std::string e)
{
error(e);
return true;
}
catch(int)
{
return true;
}
catch(std::bad_alloc)
{
error() << "Out of memory" << eom;
return true;
}
return false;
}
示例3: process_goto_program
bool cbmc_parseoptionst::process_goto_program(
const optionst &options,
goto_functionst &goto_functions)
{
try
{
namespacet ns(context);
if(cmdline.isset("string-abstraction"))
string_instrumentation(
context, get_message_handler(), goto_functions);
status("Function Pointer Removal");
remove_function_pointers(ns, goto_functions,
cmdline.isset("pointer-check"));
status("Partial Inlining");
// do partial inlining
goto_partial_inline(goto_functions, ns, ui_message_handler);
status("Generic Property Instrumentation");
// add generic checks
goto_check(ns, options, goto_functions);
if(cmdline.isset("string-abstraction"))
{
status("String Abstraction");
string_abstraction(context,
get_message_handler(), goto_functions);
}
// add failed symbols
// needs to be done before pointer analysis
add_failed_symbols(context);
if(cmdline.isset("pointer-check") ||
cmdline.isset("show-value-sets"))
{
status("Pointer Analysis");
value_set_analysist value_set_analysis(ns);
value_set_analysis(goto_functions);
// show it?
if(cmdline.isset("show-value-sets"))
{
show_value_sets(get_ui(), goto_functions, value_set_analysis);
return true;
}
status("Adding Pointer Checks");
// add pointer checks
pointer_checks(
goto_functions, context, options, value_set_analysis);
}
// recalculate numbers, etc.
goto_functions.update();
// add loop ids
goto_functions.compute_loop_numbers();
// if we aim to cover, replace
// all assertions by false to prevent simplification
if(cmdline.isset("cover-assertions"))
make_assertions_false(goto_functions);
// show it?
if(cmdline.isset("show-loops"))
{
show_loop_numbers(get_ui(), goto_functions);
return true;
}
// show it?
if(cmdline.isset("show-goto-functions"))
{
goto_functions.output(ns, std::cout);
return true;
}
}
catch(const char *e)
{
error(e);
return true;
}
catch(const std::string e)
{
error(e);
return true;
}
catch(int)
{
return true;
}
//.........这里部分代码省略.........
示例4: process_goto_program
bool cbmc_parse_optionst::process_goto_program(
const optionst &options,
goto_functionst &goto_functions)
{
try
{
namespacet ns(symbol_table);
// Remove inline assembler; this needs to happen before
// adding the library.
remove_asm(symbol_table, goto_functions);
// add the library
status() << "Adding CPROVER library ("
<< config.ansi_c.arch << ")" << eom;
link_to_library(symbol_table, goto_functions, ui_message_handler);
if(cmdline.isset("string-abstraction"))
string_instrumentation(
symbol_table, get_message_handler(), goto_functions);
// remove function pointers
status() << "Function Pointer Removal" << eom;
remove_function_pointers(symbol_table, goto_functions,
cmdline.isset("pointer-check"));
// full slice?
if(cmdline.isset("full-slice"))
{
status() << "Performing a full slice" << eom;
full_slicer(goto_functions, ns);
}
// do partial inlining
status() << "Partial Inlining" << eom;
goto_partial_inline(goto_functions, ns, ui_message_handler);
// remove returns, gcc vectors, complex
remove_returns(symbol_table, goto_functions);
remove_vector(symbol_table, goto_functions);
remove_complex(symbol_table, goto_functions);
// add generic checks
status() << "Generic Property Instrumentation" << eom;
goto_check(ns, options, goto_functions);
if(cmdline.isset("string-abstraction"))
{
status() << "String Abstraction" << eom;
string_abstraction(symbol_table,
get_message_handler(), goto_functions);
}
// add failed symbols
// needs to be done before pointer analysis
add_failed_symbols(symbol_table);
// recalculate numbers, etc.
goto_functions.update();
// add loop ids
goto_functions.compute_loop_numbers();
// if we aim to cover assertions, replace
// all assertions by false to prevent simplification
if(cmdline.isset("cover") &&
cmdline.get_value("cover")=="assertions")
make_assertions_false(goto_functions);
// show it?
if(cmdline.isset("show-loops"))
{
show_loop_ids(get_ui(), goto_functions);
return true;
}
// show it?
if(cmdline.isset("show-goto-functions"))
{
goto_functions.output(ns, std::cout);
return true;
}
}
catch(const char *e)
{
error() << e << eom;
return true;
}
catch(const std::string e)
{
error() << e << eom;
return true;
}
catch(int)
{
return true;
//.........这里部分代码省略.........
示例5: instrument_goto_program
//.........这里部分代码省略.........
inst_strategy=min_interference;
else if(cmdline.isset("read-first"))
inst_strategy=read_first;
else if(cmdline.isset("write-first"))
inst_strategy=write_first;
else if(cmdline.isset("my-events"))
inst_strategy=my_events;
else
/* default: instruments all unsafe pairs */
inst_strategy=all;
const unsigned unwind_loops =
cmdline.isset("unwind") ?
unsafe_string2unsigned(cmdline.get_value("unwind")) : 0;
const unsigned max_var =
cmdline.isset("max-var") ?
unsafe_string2unsigned(cmdline.get_value("max-var")) : 0;
const unsigned max_po_trans =
cmdline.isset("max-po-trans") ?
unsafe_string2unsigned(cmdline.get_value("max-po-trans")) : 0;
if(mm=="tso")
{
status() << "Adding weak memory (TSO) Instrumentation" << eom;
model=TSO;
}
else if(mm=="pso")
{
status() << "Adding weak memory (PSO) Instrumentation" << eom;
model=PSO;
}
else if(mm=="rmo")
{
status() << "Adding weak memory (RMO) Instrumentation" << eom;
model=RMO;
}
else if(mm=="power")
{
status() << "Adding weak memory (Power) Instrumentation" << eom;
model=Power;
}
else
{
status/*error*/() << "Unknown weak memory model" << eom;
model=Unknown;
}
/* inference mode */
infer_modet infer_mode=INFER;
if(cmdline.isset("userdef"))
infer_mode=USER_DEF;
loop_strategyt loops=arrays_only;
if(cmdline.isset("force-loop-duplication"))
loops=all_loops;
if(cmdline.isset("no-loop-duplication"))
loops=no_loop;
/*if(model!=Unknown)*/
fence_weak_memory(
model,
value_set_analysis,
symbol_table,
goto_functions,
cmdline.isset("scc"),
inst_strategy,
unwind_loops,
!cmdline.isset("cfg-kill"),
cmdline.isset("no-dependencies"),
loops,
max_var,
max_po_trans,
!cmdline.isset("no-po-rendering"),
cmdline.isset("render-cluster-file"),
cmdline.isset("render-cluster-function"),
cmdline.isset("cav11"),
cmdline.isset("hide-internals"),
cmdline.isset("print-graph"),
infer_mode,
get_message_handler(),
cmdline.isset("ignore-arrays"));
}
}
// add failed symbols
add_failed_symbols(symbol_table);
// recalculate numbers, etc.
goto_functions.update();
// add loop ids
goto_functions.compute_loop_numbers();
// label the assertions
label_properties(goto_functions);
}