Shift scheduling (SMT-LIB2)
Input
{
"produce_model": true,
"produce_unsat_core": false,
"smtlib2": "(set-logic QF_LIA)\n; shifts: 0 early, 1 late, 2 night\n(declare-const w1 Int)\n(declare-const w2 Int)\n(declare-const w3 Int)\n(declare-const w4 Int)\n(define-fun shift ((s Int)) Bool (and (>= s 0) (<= s 2)))\n(define-fun covered ((k Int)) Bool (or (= w1 k) (= w2 k) (= w3 k) (= w4 k)))\n(assert (and (shift w1) (shift w2) (shift w3) (shift w4)))\n(assert (and (covered 0) (covered 1) (covered 2)))\n(assert (distinct w1 w2))\n(assert (not (= w3 2)))\n(assert (< w4 w1))\n(check-sat)\n(get-model)\n(exit)\n",
"timeout_ms": 3000
}Output
Build-time verified. stats.elapsed_ms normalized to 0.
{
"model": {
"w1": 1,
"w2": 2,
"w3": 0,
"w4": 0
},
"objective_values": null,
"stats": {
"elapsed_ms": 0,
"timed_out": false
},
"unsat_core": null,
"verdict": "sat",
"verified": true
}Request
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/smt -H 'Content-Type: application/json' --data-raw '{"smtlib2":"(set-logic QF_LIA)\n; shifts: 0 early, 1 late, 2 night\n(declare-const w1 Int)\n(declare-const w2 Int)\n(declare-const w3 Int)\n(declare-const w4 Int)\n(define-fun shift ((s Int)) Bool (and (>= s 0) (<= s 2)))\n(define-fun covered ((k Int)) Bool (or (= w1 k) (= w2 k) (= w3 k) (= w4 k)))\n(assert (and (shift w1) (shift w2) (shift w3) (shift w4)))\n(assert (and (covered 0) (covered 1) (covered 2)))\n(assert (distinct w1 w2))\n(assert (not (= w3 2)))\n(assert (< w4 w1))\n(check-sat)\n(get-model)\n(exit)\n","produce_model":true,"produce_unsat_core":false,"timeout_ms":3000}'