Example #1
0
void danger_learn_configt::process(const counterexamplest &ces,
    const size_t max_sz)
{
  program=original_program;
  var_ids.clear();
  num_consts=get_invariant_variable_ids(program.st, var_ids);
  const size_t num_vars=var_ids.size();
  null_message_handlert msg;
  const std::string name(DANGER_EXECUTE);
  add_invariant_library(program, msg, num_vars, num_consts, max_sz, name);
  link_user_program_variables(program, var_ids);
  link_meta_variables(program, var_ids.size(), max_sz);
  danger_add_programs_to_learn(program, max_sz);
  danger_add_x0_placeholders(program);
  invariant_add_learned_counterexamples(program, ces, create_danger_constraint,
      true);
  program.gf.update();
}
Example #2
0
void danger_learn_configt::process(const counterexamplest &ces,
    const size_t max_sz)
{
  program=original_program;
  var_ids.clear();
  num_consts=get_invariant_variable_ids(program.st, var_ids);
  const size_t num_vars=var_ids.size();
  null_message_handlert msg;
  const std::string name(DANGER_EXECUTE);
  symbol_tablet &st=program.st;
  goto_functionst &gf=program.gf;
  add_cegis_library(st, gf, msg, num_vars, num_consts, max_sz, name);
  link_user_program_variables(program, var_ids);
  link_meta_variables(program, var_ids.size(), max_sz);
  danger_add_programs_to_learn(program, max_sz);
  danger_add_x0_placeholders(program);
  const danger_constraint constr(program.use_ranking);
  invariant_add_learned_counterexamples(program, ces, std::cref(constr), true);
  gf.update();
}