Exemple #1
0
// Returns preemption cost for task 'this_task'
double PC(int this_task){
	int hp_task;
	if (this_task >= 2){
		for(hp_task = this_task-1; hp_task >= 1; hp_task--){
			nnp_max[hp_task][this_task] = calc_nnp_max(hp_task, this_task);
			nnp_min[hp_task][this_task] = calc_nnp_min(hp_task, this_task);
		}
		// Define constraints
		return solve_constraints(this_task);
	}
	else return 0;
}
Exemple #2
0
tactic whnf_tactic(bool relax_main_opaque) {
    return tactic01([=](environment const & env, io_state const & ios, proof_state const & ps) {
            goals const & gs = ps.get_goals();
            if (empty(gs))
                return none_proof_state();
            name_generator ngen = ps.get_ngen();
            auto tc             = mk_type_checker(env, ngen.mk_child(), relax_main_opaque);
            goal  g             = head(gs);
            goals tail_gs       = tail(gs);
            expr  type          = g.get_type();
            auto t_cs           = tc->whnf(type);
            goals new_gs(goal(g.get_meta(), t_cs.first), tail_gs);
            proof_state new_ps(ps, new_gs, ngen);
            if (solve_constraints(env, ios, new_ps, t_cs.second)) {
                return some_proof_state(new_ps);
            } else {
                return none_proof_state();
            }
        });
}