src/smt/theory_jobscheduler.cpp
/**
     * bind a job to one of the resources it can run on.
     */
bind a job to one of the resources it can run on.
bind a job to one of the resources it can run on .
bool theory_jobscheduler::split_job2resource(unsigned j) {
        job_info const& ji = m_jobs[j];
        context& ctx = get_context();
        if (ji.m_is_bound) return false;
        auto const& jrs = ji.m_resources;
        for (job_resource const& jr : jrs) {
            unsigned r = jr.m_resource_id;
            res_info const& ri = m_resources[r];
            enode* e1 = ji.m_job2resource;
            enode* e2 = ri.m_resource;
            if (ctx.is_diseq(e1, e2))
                continue;
            literal eq = mk_eq_lit(e1, e2);
            if (m.has_trace_stream()) {
                app_ref body(m);
                body = m.mk_or(ctx.bool_var2expr(eq.var()), m.mk_not(ctx.bool_var2expr(eq.var())));
                log_axiom_instantiation(body);
                m.trace_stream() << "[end-of-instance]\n";
            }
            if (ctx.get_assignment(eq) != l_false) {
                ctx.mark_as_relevant(eq);
                if (assume_eq(e1, e2)) {
                    return true;
                }
            }
        }
        literal_vector lits;
        expr_ref_vector exprs(m);
        for (job_resource const& jr : jrs) {
            unsigned r = jr.m_resource_id;
            res_info const& ri = m_resources[r];
            enode* e1 = ji.m_job2resource;
            enode* e2 = ri.m_resource;
            literal eq = mk_eq_lit(e1, e2);
            lits.push_back(eq);
            exprs.push_back(ctx.bool_var2expr(eq.var()));
        }
        if (m.has_trace_stream()) {
            app_ref body(m);
            body = m.mk_or(exprs.size(), exprs.c_ptr());
            log_axiom_instantiation(body);
        }
        ctx.mk_th_axiom(get_id(), lits.size(), lits.c_ptr());
        if (m.has_trace_stream()) m.trace_stream() << "[end-of-instance]\n";
        return true;
    }
bool theory_jobscheduler :: split_job2resource ( unsigned j ) { job_info const & ji = m_jobs [ j ] ; context & ctx = get_context ( ) ; if ( ji . m_is_bound ) return false ; auto const & jrs = ji . m_resources ; for ( job_resource const & jr : jrs ) { unsigned r = jr . m_resource_id ; res_info const & ri = m_resources [ r ] ; enode * e1 = ji . m_job2resource ; enode * e2 = ri . m_resource ; if ( ctx . is_diseq ( e1 , e2 ) ) continue ; literal eq = mk_eq_lit ( e1 , e2 ) ; if ( m . has_trace_stream ( ) ) { app_ref body ( m ) ; body = m . mk_or ( ctx . bool_var2expr ( eq . var ( ) ) , m . mk_not ( ctx . bool_var2expr ( eq . var ( ) ) ) ) ; log_axiom_instantiation ( body ) ; m . trace_stream ( ) << " \n " ; } if ( ctx . get_assignment ( eq ) != l_false ) { ctx . mark_as_relevant ( eq ) ; if ( assume_eq ( e1 , e2 ) ) { return true ; } } } literal_vector lits ; expr_ref_vector exprs ( m ) ; for ( job_resource const & jr : jrs ) { unsigned r = jr . m_resource_id ; res_info const & ri = m_resources [ r ] ; enode * e1 = ji . m_job2resource ; enode * e2 = ri . m_resource ; literal eq = mk_eq_lit ( e1 , e2 ) ; lits . push_back ( eq ) ; exprs . push_back ( ctx . bool_var2expr ( eq . var ( ) ) ) ; } if ( m . has_trace_stream ( ) ) { app_ref body ( m ) ; body = m . mk_or ( exprs . size ( ) , exprs . c_ptr ( ) ) ; log_axiom_instantiation ( body ) ; } ctx . mk_th_axiom ( get_id ( ) , lits . size ( ) , lits . c_ptr ( ) ) ; if ( m . has_trace_stream ( ) ) m . trace_stream ( ) << " \n " ; return true ; }
bind a job to one of the resources it can run on.
bind a job to one of the resources it can run on .