# Constraint Oracle

## Endpoints

MCP: https://oracles.burgeonads.com/mcp (Streamable HTTP, stateless JSON). REST: POST JSON. No API key or account required. Zero-logging execution.

- [OpenAPI 3.1](https://oracles.burgeonads.com/openapi.json)
- [Worked Examples](https://oracles.burgeonads.com/examples/)

### MCP Resources

oracle://docs/schema-compat, oracle://docs/overview, oracle://docs/constraint-oracle, oracle://docs/verification-oracles, oracle://docs/full, oracle://examples, oracle://examples/{slug}. Read-only; no compute slot.

### MCP Prompts

check_schema_compat(), diff_regex(), check_state_machine(), verify_rules(), model_schedule(engine), debug_unsat(tool), optimize_linear(), optimize_allocation(pattern, sense). All arguments optional.

Solver tool annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false. submit_feedback: readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=false. outputSchema: verified result or error envelope.

## Limits

Request: 65536 bytes. Response: 262144 bytes. timeout_ms: 100..5000, default 3000. Compute slots: 3. Queue wait: 500 ms. Unknown JSON fields rejected. Strict JSON types; no coercion.

## Verification

solve_lp_mip: exact rational checks of bounds, integrality, rows and objective; continuous optimality by exact dual certificate. SMT-LIB2: each assertion evaluated against the model. Unsat cores deletion-minimized and re-solved. CP-SAT: variable bounds, constraints and objective independently checked; cumulative load is swept at every interval start, circuit degrees and single-cycle connectivity are traced. SMT optimality is checked by fresh no-better feasibility queries for each lexicographic prefix. CP-SAT optimality and best_bound remain solver-reported; assignment verification does not independently prove CP-SAT optimality. No unverified model, solution or unsat_core is returned. CP-SAT cores are re-solved infeasible with the same engine; minimality has independently checked feasible witnesses for each single deletion, not a separate infeasibility proof certificate.

## solve_smt

POST /v1/solve/smt. One check-sat, or solve at end of script. Declarations and assertions must precede check-sat. push/pop resolve scopes. set-logic is validated then removed. Trailing get-model, get-value, get-unsat-core and exit are stripped. set-info metadata and get-info/get-objectives queries are stripped. Harmless set-option flags :produce-models, :produce-unsat-cores and :print-success accept true/false and are ignored; JSON output flags take precedence. :opt.priority lex is accepted. Other options, get-option, echo, reset, reset-assertions and check-sat-assuming are rejected.

Allowed commands: set-logic, declare-sort, define-sort, declare-const, declare-fun, define-fun, define-fun-rec, declare-datatype, declare-datatypes, assert, minimize, maximize, define-const, check-sat, push, pop. smtlib2: 1..32768 UTF-8 bytes. produce_model defaults to true. produce_unsat_core defaults to false; requires named assertions for a verified core.

minimize/maximize: Int or Real objectives in script order, lexicographic priority. All objectives must precede check-sat. optimal returns objective_values in the original senses, as exact integers or rational strings, even with produce_model=false. Unbounded objectives, unattained real infima/suprema and incomplete verification return unknown or timeout without a model or objective_values. Bitvector objectives are unsupported; convert explicitly with bv2int. Parse errors use static diagnostic categories and original line/column positions, never raw solver messages. Verdicts: sat, optimal, unsat, unknown, timeout. Model: nullary constants only; function interpretations omitted. Reals: exact strings "p" or "p/q". Bitvectors: hexadecimal strings. Assertions that cannot be evaluated produce unknown without a model. Unsat re-check timeout produces verified=false without a core. No core requested: unsat may have verified=false. Unknown and timeout carry verified=false.

## solve_cpsat

POST /v1/solve/cpsat. variables: 1..500 unique names, integer bounds -1000000000..1000000000, min <= max. constraints: 1..2000. All variable references must exist. Expression magnitude must not exceed 2^62. objective: optional minimize/maximize weighted sum. Optional objective, timeout_ms and produce_unsat_core accept explicit null; null means their default (none, 3000, false).

linear: weighted terms, op <=, ==, >=, <, >, !=, integer rhs. all_different: distinct variable values. no_overlap: intervals conflict iff start_a < start_b + duration_b and start_b < start_a + duration_a; zero durations conflict only strictly inside another interval. implication: if_var compared to if_eq using if_op (default ==) implies then linear constraint; if_op accepts all linear comparisons. Alternatively use if_all or if_any, a nonempty list of up to 100 linear comparisons, for conjunction or disjunction guards. Supply exactly one guard form; then is always linear. Unused guard forms may be null. element: values[index_var] == target_var; index must be in range. min_max: {type: min_max, op: min or max, target_var, vars} equates target_var to min/max of 1..500 variable values. abs: {type: abs, target_var, var} equates target_var to abs(var).

cumulative: 1..200 intervals with start_var, duration and demand, plus capacity; duration, demand and capacity >= 0. At every interval start t, the summed demand of intervals with start <= t < start + duration must be <= capacity.

circuit: 1..500 arcs with tail, head and var. Node indices 0..999; every index 0..N-1 must appear, where N = max index + 1. Arc variables need bounds within 0..1. Duplicate (tail, head) arcs are rejected. Arcs with var = 1 form one cycle through every node except skipped nodes. A node is skipped iff its self-loop arc (tail == head) has var = 1; a skipped node has no other active arc. All nodes skipped is valid.

allowed_assignments: 1..20 vars and 1..500 tuples, each tuple of length len(vars). The values of vars, in order, must equal one tuple. bool_or: at least one literal holds. exactly_one: exactly one literal holds. Literal: {var, eq} holds iff var == eq; 1..100 literals.

Verdicts: optimal, feasible, infeasible, unknown, timeout. No objective: feasible. verified=true requires a checked solution or a verified minimal conflict core. Set produce_unsat_core=true to debug infeasible models. unsat_core contains sorted zero-based indices into constraints; variable domains stay fixed background and the objective is omitted. The subset is freshly re-solved infeasible and every single deletion has a feasible witness checked against the original semantics. Minimal means subset-minimal, not minimum cardinality. All core work shares timeout_ms; incomplete checks return infeasible with verified=false and unsat_core=null, and stats.timed_out=true if the deadline expired. Without a requested core, infeasible remains verified=false. unknown and timeout carry verified=false. objective_value is independently recomputed; best_bound is solver-reported.

## solve_lp_mip

POST /v1/solve/lp-mip. MCP: solve_lp_mip. Linear programs over continuous variables, or mixed-integer programs when any variable has type integer. Use it for fractional allocations, budget splits, flows and blends; use solve_cpsat for integer-only models with global constraints. Continuous models use a simplex engine; mixed-integer models use branch-and-bound. One engine thread; results reached at a time limit can vary between runs.

variables: 1..1000 unique names, type continuous or integer, finite bounds min and max within -1000000000..1000000000, min <= max; integer bounds must be integral. Every variable is bounded, so no unbounded verdict exists. constraints: 1..2000 rows {terms, op, rhs}; op is <=, == or >=; rhs within -1000000000000..1000000000000. terms: 1..1000 {var, coeff} per row; coefficient magnitude <= 1000000 and either 0 or >= 0.000001; a repeated variable in one row is summed; at most 20000 terms in total. objective: optional {sense: minimize or maximize, terms}. Optional objective and timeout_ms accept explicit null. Numbers are JSON numbers read as binary64 values; booleans, NaN and Infinity are rejected.

Verification: every returned solution is checked independently in exact rational arithmetic. Integer variables are integral, every value lies within its bounds exactly, and each row holds within tolerance: violation <= 0.000001 * max(1, |rhs|, sum of |coeff * value|). max_violation is the largest absolute row violation. objective_value is recomputed exactly from the returned values; the engine's own objective must agree. A failed check returns unknown without a solution. Solutions come from double-precision engines, so an exactly infeasible model can still have a tolerance-feasible solution.

best_bound is a lower bound on the optimum when minimizing and an upper bound when maximizing. bound_verified=true means an exact weak-duality certificate from row multipliers proves the bound for every exactly feasible point; it is rounded outward. Continuous optimal requires that certificate to close the gap: objective_value and best_bound differ by at most 0.000001 * max(1, |objective_value|). Mixed-integer best_bound is the branch-and-bound bound with bound_verified=false, unless the exact continuous relaxation certificate, rounded up for integral objectives, is at least as tight. Mixed-integer optimal without a verified bound is engine-proven, not independently certified.

infeasible with verified=true: exact row multipliers prove that no point within the bounds satisfies every row exactly, even with integrality relaxed. infeasible with verified=false: integer infeasibility proved by the engine only, or no certificate within timeout_ms. Verdicts: optimal, feasible, infeasible, unknown, timeout. No objective: feasible. feasible with an objective: a verified solution whose gap is not closed, including a mixed-integer incumbent at timeout with stats.timed_out=true. timeout and unknown carry no solution and verified=false. One timeout_ms budget covers solving and certificates.

## JSON Schemas

### solve_smt request

```json
{
  "additionalProperties": false,
  "properties": {
    "produce_model": {
      "default": true,
      "type": "boolean"
    },
    "produce_unsat_core": {
      "default": false,
      "type": "boolean"
    },
    "smtlib2": {
      "maxLength": 32768,
      "minLength": 1,
      "type": "string"
    },
    "timeout_ms": {
      "default": 3000,
      "maximum": 5000,
      "minimum": 100,
      "type": "integer"
    }
  },
  "required": [
    "smtlib2"
  ],
  "type": "object"
}
```

### solve_smt response

```json
{
  "$defs": {
    "Stats": {
      "additionalProperties": false,
      "properties": {
        "elapsed_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "timed_out": {
          "type": "boolean"
        }
      },
      "required": [
        "elapsed_ms",
        "timed_out"
      ],
      "type": "object"
    },
    "Witness": {
      "additionalProperties": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "model": {
      "anyOf": [
        {
          "$ref": "#/$defs/Witness"
        },
        {
          "type": "null"
        }
      ]
    },
    "objective_values": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "$ref": "#/$defs/Stats"
    },
    "unsat_core": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ]
    },
    "verdict": {
      "enum": [
        "sat",
        "optimal",
        "unsat",
        "unknown",
        "timeout"
      ],
      "type": "string"
    },
    "verified": {
      "type": "boolean"
    }
  },
  "required": [
    "verdict",
    "verified",
    "stats"
  ],
  "type": "object"
}
```

### solve_cpsat request

```json
{
  "$defs": {
    "Abs": {
      "additionalProperties": false,
      "properties": {
        "target_var": {
          "$ref": "#/$defs/VarName"
        },
        "type": {
          "const": "abs",
          "type": "string"
        },
        "var": {
          "$ref": "#/$defs/VarName"
        }
      },
      "required": [
        "type",
        "target_var",
        "var"
      ],
      "type": "object"
    },
    "AllDifferent": {
      "additionalProperties": false,
      "properties": {
        "type": {
          "const": "all_different",
          "type": "string"
        },
        "vars": {
          "items": {
            "$ref": "#/$defs/VarName"
          },
          "maxItems": 500,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "type",
        "vars"
      ],
      "type": "object"
    },
    "AllowedAssignments": {
      "additionalProperties": false,
      "properties": {
        "tuples": {
          "items": {
            "items": {
              "$ref": "#/$defs/Int"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          },
          "maxItems": 500,
          "minItems": 1,
          "type": "array"
        },
        "type": {
          "const": "allowed_assignments",
          "type": "string"
        },
        "vars": {
          "items": {
            "$ref": "#/$defs/VarName"
          },
          "maxItems": 20,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "type",
        "vars",
        "tuples"
      ],
      "type": "object"
    },
    "Arc": {
      "additionalProperties": false,
      "properties": {
        "head": {
          "maximum": 999,
          "minimum": 0,
          "type": "integer"
        },
        "tail": {
          "maximum": 999,
          "minimum": 0,
          "type": "integer"
        },
        "var": {
          "$ref": "#/$defs/VarName"
        }
      },
      "required": [
        "tail",
        "head",
        "var"
      ],
      "type": "object"
    },
    "BoolLiteral": {
      "additionalProperties": false,
      "properties": {
        "eq": {
          "$ref": "#/$defs/Int"
        },
        "var": {
          "$ref": "#/$defs/VarName"
        }
      },
      "required": [
        "var",
        "eq"
      ],
      "type": "object"
    },
    "BoolOr": {
      "additionalProperties": false,
      "properties": {
        "literals": {
          "items": {
            "$ref": "#/$defs/BoolLiteral"
          },
          "maxItems": 100,
          "minItems": 1,
          "type": "array"
        },
        "type": {
          "const": "bool_or",
          "type": "string"
        }
      },
      "required": [
        "type",
        "literals"
      ],
      "type": "object"
    },
    "Circuit": {
      "additionalProperties": false,
      "properties": {
        "arcs": {
          "items": {
            "$ref": "#/$defs/Arc"
          },
          "maxItems": 500,
          "minItems": 1,
          "type": "array"
        },
        "type": {
          "const": "circuit",
          "type": "string"
        }
      },
      "required": [
        "type",
        "arcs"
      ],
      "type": "object"
    },
    "Cumulative": {
      "additionalProperties": false,
      "properties": {
        "capacity": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer"
        },
        "intervals": {
          "items": {
            "$ref": "#/$defs/CumulativeInterval"
          },
          "maxItems": 200,
          "minItems": 1,
          "type": "array"
        },
        "type": {
          "const": "cumulative",
          "type": "string"
        }
      },
      "required": [
        "type",
        "intervals",
        "capacity"
      ],
      "type": "object"
    },
    "CumulativeInterval": {
      "additionalProperties": false,
      "properties": {
        "demand": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer"
        },
        "duration": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer"
        },
        "start_var": {
          "$ref": "#/$defs/VarName"
        }
      },
      "required": [
        "start_var",
        "duration",
        "demand"
      ],
      "type": "object"
    },
    "Element": {
      "additionalProperties": false,
      "properties": {
        "index_var": {
          "$ref": "#/$defs/VarName"
        },
        "target_var": {
          "$ref": "#/$defs/VarName"
        },
        "type": {
          "const": "element",
          "type": "string"
        },
        "values": {
          "items": {
            "$ref": "#/$defs/Int"
          },
          "maxItems": 1000,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "type",
        "index_var",
        "values",
        "target_var"
      ],
      "type": "object"
    },
    "ExactlyOne": {
      "additionalProperties": false,
      "properties": {
        "literals": {
          "items": {
            "$ref": "#/$defs/BoolLiteral"
          },
          "maxItems": 100,
          "minItems": 1,
          "type": "array"
        },
        "type": {
          "const": "exactly_one",
          "type": "string"
        }
      },
      "required": [
        "type",
        "literals"
      ],
      "type": "object"
    },
    "Implication": {
      "additionalProperties": false,
      "properties": {
        "if_all": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/LinearConstraint"
              },
              "maxItems": 100,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ]
        },
        "if_any": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/LinearConstraint"
              },
              "maxItems": 100,
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ]
        },
        "if_eq": {
          "anyOf": [
            {
              "$ref": "#/$defs/Int"
            },
            {
              "type": "null"
            }
          ]
        },
        "if_op": {
          "anyOf": [
            {
              "$ref": "#/$defs/LinearOp"
            },
            {
              "type": "null"
            }
          ],
          "default": "=="
        },
        "if_var": {
          "anyOf": [
            {
              "$ref": "#/$defs/VarName"
            },
            {
              "type": "null"
            }
          ]
        },
        "then": {
          "$ref": "#/$defs/LinearConstraint"
        },
        "type": {
          "const": "implication",
          "type": "string"
        }
      },
      "required": [
        "type",
        "then"
      ],
      "type": "object"
    },
    "Int": {
      "maximum": 1000000000,
      "minimum": -1000000000,
      "type": "integer"
    },
    "Interval": {
      "additionalProperties": false,
      "properties": {
        "duration": {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer"
        },
        "start_var": {
          "$ref": "#/$defs/VarName"
        }
      },
      "required": [
        "start_var",
        "duration"
      ],
      "type": "object"
    },
    "LinearConstraint": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "$ref": "#/$defs/LinearOp"
        },
        "rhs": {
          "maximum": 1000000000000000000,
          "minimum": -1000000000000000000,
          "type": "integer"
        },
        "terms": {
          "$ref": "#/$defs/Terms"
        },
        "type": {
          "const": "linear",
          "default": "linear",
          "type": "string"
        }
      },
      "required": [
        "terms",
        "op",
        "rhs"
      ],
      "type": "object"
    },
    "LinearOp": {
      "enum": [
        "<=",
        "==",
        ">=",
        "<",
        ">",
        "!="
      ],
      "type": "string"
    },
    "MinMax": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "enum": [
            "min",
            "max"
          ],
          "type": "string"
        },
        "target_var": {
          "$ref": "#/$defs/VarName"
        },
        "type": {
          "const": "min_max",
          "type": "string"
        },
        "vars": {
          "items": {
            "$ref": "#/$defs/VarName"
          },
          "maxItems": 500,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "type",
        "op",
        "target_var",
        "vars"
      ],
      "type": "object"
    },
    "NoOverlap": {
      "additionalProperties": false,
      "properties": {
        "intervals": {
          "items": {
            "$ref": "#/$defs/Interval"
          },
          "maxItems": 500,
          "minItems": 1,
          "type": "array"
        },
        "type": {
          "const": "no_overlap",
          "type": "string"
        }
      },
      "required": [
        "type",
        "intervals"
      ],
      "type": "object"
    },
    "Objective": {
      "additionalProperties": false,
      "properties": {
        "sense": {
          "enum": [
            "minimize",
            "maximize"
          ],
          "type": "string"
        },
        "terms": {
          "$ref": "#/$defs/Terms"
        }
      },
      "required": [
        "sense",
        "terms"
      ],
      "type": "object"
    },
    "Term": {
      "additionalProperties": false,
      "properties": {
        "coeff": {
          "$ref": "#/$defs/Int"
        },
        "var": {
          "$ref": "#/$defs/VarName"
        }
      },
      "required": [
        "var",
        "coeff"
      ],
      "type": "object"
    },
    "Terms": {
      "items": {
        "$ref": "#/$defs/Term"
      },
      "maxItems": 1000,
      "minItems": 1,
      "type": "array"
    },
    "VarName": {
      "maxLength": 64,
      "minLength": 1,
      "pattern": "^[A-Za-z_][A-Za-z0-9_.\\-\\[\\]]*$",
      "type": "string"
    },
    "Variable": {
      "additionalProperties": false,
      "properties": {
        "max": {
          "$ref": "#/$defs/Int"
        },
        "min": {
          "$ref": "#/$defs/Int"
        },
        "name": {
          "$ref": "#/$defs/VarName"
        }
      },
      "required": [
        "name",
        "min",
        "max"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "constraints": {
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/LinearConstraint"
          },
          {
            "$ref": "#/$defs/AllDifferent"
          },
          {
            "$ref": "#/$defs/NoOverlap"
          },
          {
            "$ref": "#/$defs/Implication"
          },
          {
            "$ref": "#/$defs/Element"
          },
          {
            "$ref": "#/$defs/Cumulative"
          },
          {
            "$ref": "#/$defs/Circuit"
          },
          {
            "$ref": "#/$defs/AllowedAssignments"
          },
          {
            "$ref": "#/$defs/BoolOr"
          },
          {
            "$ref": "#/$defs/ExactlyOne"
          },
          {
            "$ref": "#/$defs/MinMax"
          },
          {
            "$ref": "#/$defs/Abs"
          }
        ]
      },
      "maxItems": 2000,
      "minItems": 1,
      "type": "array"
    },
    "objective": {
      "anyOf": [
        {
          "$ref": "#/$defs/Objective"
        },
        {
          "type": "null"
        }
      ]
    },
    "produce_unsat_core": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false
    },
    "timeout_ms": {
      "anyOf": [
        {
          "maximum": 5000,
          "minimum": 100,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 3000
    },
    "variables": {
      "items": {
        "$ref": "#/$defs/Variable"
      },
      "maxItems": 500,
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "variables",
    "constraints"
  ],
  "type": "object"
}
```

### solve_cpsat response

```json
{
  "$defs": {
    "Stats": {
      "additionalProperties": false,
      "properties": {
        "elapsed_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "timed_out": {
          "type": "boolean"
        }
      },
      "required": [
        "elapsed_ms",
        "timed_out"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "best_bound": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "objective_value": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "solution": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "$ref": "#/$defs/Stats"
    },
    "unsat_core": {
      "anyOf": [
        {
          "items": {
            "minimum": 0,
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ]
    },
    "verdict": {
      "enum": [
        "optimal",
        "feasible",
        "infeasible",
        "unknown",
        "timeout"
      ],
      "type": "string"
    },
    "verified": {
      "type": "boolean"
    }
  },
  "required": [
    "verdict",
    "verified",
    "stats"
  ],
  "type": "object"
}
```

### solve_lp_mip request

```json
{
  "$defs": {
    "LpConstraint": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "enum": [
            "<=",
            "==",
            ">="
          ],
          "type": "string"
        },
        "rhs": {
          "maximum": 1000000000000,
          "minimum": -1000000000000,
          "type": "number"
        },
        "terms": {
          "items": {
            "$ref": "#/$defs/LpTerm"
          },
          "maxItems": 1000,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "terms",
        "op",
        "rhs"
      ],
      "type": "object"
    },
    "LpObjective": {
      "additionalProperties": false,
      "properties": {
        "sense": {
          "enum": [
            "minimize",
            "maximize"
          ],
          "type": "string"
        },
        "terms": {
          "items": {
            "$ref": "#/$defs/LpTerm"
          },
          "maxItems": 1000,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "sense",
        "terms"
      ],
      "type": "object"
    },
    "LpTerm": {
      "additionalProperties": false,
      "properties": {
        "coeff": {
          "maximum": 1000000,
          "minimum": -1000000,
          "type": "number"
        },
        "var": {
          "$ref": "#/$defs/VarName"
        }
      },
      "required": [
        "var",
        "coeff"
      ],
      "type": "object"
    },
    "LpVariable": {
      "additionalProperties": false,
      "properties": {
        "max": {
          "maximum": 1000000000,
          "minimum": -1000000000,
          "type": "number"
        },
        "min": {
          "maximum": 1000000000,
          "minimum": -1000000000,
          "type": "number"
        },
        "name": {
          "$ref": "#/$defs/VarName"
        },
        "type": {
          "enum": [
            "continuous",
            "integer"
          ],
          "type": "string"
        }
      },
      "required": [
        "name",
        "type",
        "min",
        "max"
      ],
      "type": "object"
    },
    "VarName": {
      "maxLength": 64,
      "minLength": 1,
      "pattern": "^[A-Za-z_][A-Za-z0-9_.\\-\\[\\]]*$",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "properties": {
    "constraints": {
      "items": {
        "$ref": "#/$defs/LpConstraint"
      },
      "maxItems": 2000,
      "minItems": 1,
      "type": "array"
    },
    "objective": {
      "anyOf": [
        {
          "$ref": "#/$defs/LpObjective"
        },
        {
          "type": "null"
        }
      ]
    },
    "timeout_ms": {
      "anyOf": [
        {
          "maximum": 5000,
          "minimum": 100,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 3000
    },
    "variables": {
      "items": {
        "$ref": "#/$defs/LpVariable"
      },
      "maxItems": 1000,
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "variables",
    "constraints"
  ],
  "type": "object"
}
```

### solve_lp_mip response

```json
{
  "$defs": {
    "Stats": {
      "additionalProperties": false,
      "properties": {
        "elapsed_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "timed_out": {
          "type": "boolean"
        }
      },
      "required": [
        "elapsed_ms",
        "timed_out"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "best_bound": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "bound_verified": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "max_violation": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "objective_value": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "solution": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "$ref": "#/$defs/Stats"
    },
    "verdict": {
      "enum": [
        "optimal",
        "feasible",
        "infeasible",
        "unknown",
        "timeout"
      ],
      "type": "string"
    },
    "verified": {
      "type": "boolean"
    }
  },
  "required": [
    "verdict",
    "verified",
    "stats"
  ],
  "type": "object"
}
```

## Errors

Errors contain static code, message, docs_url, example_url, the matching MCP resources docs_resource and example_resource, and optional structural details. Raw input is never echoed.

```json
{
  "error": {
    "code": "INVALID_INPUT",
    "docs_resource": "oracle://docs/constraint-oracle",
    "docs_url": "https://oracles.burgeonads.com/docs/constraint-oracle.md",
    "example_resource": "oracle://examples/cpsat-bin-packing",
    "example_url": "https://oracles.burgeonads.com/examples/cpsat-bin-packing.json",
    "message": "Schema validation failed."
  }
}
```

INVALID_INPUT: HTTP 400 or 422. Schema validation failed.

PAYLOAD_TOO_LARGE: HTTP 413. Request body exceeds 65536 bytes.

UNSUPPORTED_FEATURE: HTTP 400. Input uses an unsupported feature.

TIMEOUT: HTTP 200 solver timeout; 408 transport timeout. Request timed out.

RESOURCE_LIMIT_EXCEEDED: HTTP 422. Resource limit exceeded.

OVERLOADED: HTTP 503. All compute slots are busy. Retry shortly. Retry-After: 2.

BANDWIDTH_CAP_REACHED: HTTP 503. Monthly bandwidth cap reached. Retry-After: 3600.

RATE_LIMITED: HTTP 429. Feedback rate limit reached. Retry later. Retry-After: 3600. submit_feedback only.

INTERNAL_ERROR: HTTP 500. Internal error. No unverified result was returned.

## Feedback

POST /v1/feedback. MCP: submit_feedback. Opt-in bug reports, feature requests, schema friction notes and positive feedback from people or agents. Not read-only and not idempotent: each accepted call stores one entry. Separate from solver execution: solver payloads are never stored, and feedback never enters aggregate metrics beyond a request count.

Do not include personal data, secrets, credentials or proprietary inputs; messages are stored as plain text and read by the operator. Never paste solver inputs. Only category, tool, message and the UTC hour are stored. The newest 200 entries are kept; older entries are deleted.

Limits: message 1..1000 characters, no control or invisible format characters except newline and tab. Global admission: 10 per UTC hour and 50 per UTC day; beyond that RATE_LIMITED with Retry-After: 3600. The message is never echoed in responses or errors.

```json
{
  "category": "schema_friction",
  "message": "<your note>",
  "no_sensitive_data": true,
  "tool": "solve_cpsat"
}
```

### submit_feedback request

```json
{
  "additionalProperties": false,
  "properties": {
    "category": {
      "enum": [
        "bug_report",
        "feature_request",
        "schema_friction",
        "positive"
      ],
      "type": "string"
    },
    "message": {
      "description": "Plain text, stored for the operator. No personal data, secrets, credentials or proprietary inputs.",
      "maxLength": 1000,
      "minLength": 1,
      "type": "string"
    },
    "no_sensitive_data": {
      "const": true,
      "description": "Required opt-in confirmation that message has no sensitive data.",
      "type": "boolean"
    },
    "tool": {
      "enum": [
        "solve_smt",
        "solve_cpsat",
        "solve_lp_mip",
        "analyze_rules",
        "verify_state_machine",
        "analyze_regex",
        "check_schema_compat"
      ],
      "type": "string"
    }
  },
  "required": [
    "category",
    "message",
    "no_sensitive_data"
  ],
  "type": "object"
}
```

### submit_feedback response

```json
{
  "additionalProperties": false,
  "properties": {
    "status": {
      "const": "received",
      "type": "string"
    }
  },
  "required": [
    "status"
  ],
  "type": "object"
}
```

## Worked Examples

- [Shift scheduling (SMT-LIB2)](https://oracles.burgeonads.com/examples/smt-scheduling-sat)
- [Over-constrained allocation with unsat core (SMT-LIB2)](https://oracles.burgeonads.com/examples/smt-unsat-core)
- [8-bit addition overflow counterexample (SMT-LIB2)](https://oracles.burgeonads.com/examples/smt-bitvector-bounds)
- [Capacitated bin packing (CP-SAT)](https://oracles.burgeonads.com/examples/cpsat-bin-packing)
- [Job shop makespan with no_overlap (CP-SAT)](https://oracles.burgeonads.com/examples/cpsat-job-shop)
- [Task assignment with all_different, element, implication (CP-SAT)](https://oracles.burgeonads.com/examples/cpsat-assignment-implication)
- [Crew-capacity scheduling with cumulative (CP-SAT)](https://oracles.burgeonads.com/examples/cpsat-cumulative-resources)
- [Single-route visit order with circuit and bool_or (CP-SAT)](https://oracles.burgeonads.com/examples/cpsat-circuit-routing)
- [Lexicographic integer optimization](https://oracles.burgeonads.com/examples/smt-optimization)
- [Min, max and absolute value](https://oracles.burgeonads.com/examples/cpsat-min-max-abs)
- [Minimal conflicting constraint set](https://oracles.burgeonads.com/examples/cpsat-conflict-core)
- [Fractional feed blend](https://oracles.burgeonads.com/examples/lp-blend-optimal)
- [Budget split with fixed channel costs](https://oracles.burgeonads.com/examples/lp-budget-split-mip)
- [Certified infeasible network flow](https://oracles.burgeonads.com/examples/lp-flow-infeasible)
- [Role policy gaps and overlaps](https://oracles.burgeonads.com/examples/rules-rbac-gap-overlap)
- [Decision table semantic difference](https://oracles.burgeonads.com/examples/rules-semantic-diff)
- [Lock acquisition deadlock](https://oracles.burgeonads.com/examples/fsm-lock-deadlock)
- [Order lifecycle safety](https://oracles.burgeonads.com/examples/fsm-order-lifecycle-safe)
- [Variable-to-variable rule comparisons](https://oracles.burgeonads.com/examples/rules-variable-comparison)
- [Retry loop livelock](https://oracles.burgeonads.com/examples/fsm-retry-livelock)
- [Bounded retry always terminates](https://oracles.burgeonads.com/examples/fsm-bounded-retry-progress)
- [Regex language difference](https://oracles.burgeonads.com/examples/regex-diff-witness)
- [Regex exponential ambiguity](https://oracles.burgeonads.com/examples/regex-redos-ambiguity)
- [Required property change](https://oracles.burgeonads.com/examples/schema-required-property)
- [String pattern widening](https://oracles.burgeonads.com/examples/schema-regex-widening)
- [Overlapping exclusive branches](https://oracles.burgeonads.com/examples/schema-exclusive-union)

Static outputs are build-time verified. stats.elapsed_ms is normalized to 0 in static examples. Live elapsed time varies.

### smt-scheduling-sat

```sh
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}'
```

### smt-unsat-core

```sh
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(declare-const cpu_a Int)\n(declare-const cpu_b Int)\n(declare-const cpu_c Int)\n(assert (! (>= cpu_a 2) :named min_a))\n(assert (! (>= cpu_b 3) :named min_b))\n(assert (! (>= cpu_c 1) :named min_c))\n(assert (! (<= cpu_a 4) :named max_a))\n(assert (! (<= (+ cpu_a cpu_b cpu_c) 5) :named capacity))\n(check-sat)\n(get-unsat-core)\n","produce_model":true,"produce_unsat_core":true,"timeout_ms":3000}'
```

### smt-bitvector-bounds

```sh
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_BV)\n(declare-const x (_ BitVec 8))\n(declare-const y (_ BitVec 8))\n; both operands in [100, 200], unsigned\n(assert (and (bvuge x #x64) (bvule x #xc8)))\n(assert (and (bvuge y #x64) (bvule y #xc8)))\n; the 8-bit sum wraps around\n(assert (bvult (bvadd x y) x))\n(check-sat)\n(get-model)\n","produce_model":true,"produce_unsat_core":false,"timeout_ms":3000}'
```

### cpsat-bin-packing

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/cpsat -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"x0_0","min":0,"max":1},{"name":"x0_1","min":0,"max":1},{"name":"x0_2","min":0,"max":1},{"name":"x1_0","min":0,"max":1},{"name":"x1_1","min":0,"max":1},{"name":"x1_2","min":0,"max":1},{"name":"x2_0","min":0,"max":1},{"name":"x2_1","min":0,"max":1},{"name":"x2_2","min":0,"max":1},{"name":"x3_0","min":0,"max":1},{"name":"x3_1","min":0,"max":1},{"name":"x3_2","min":0,"max":1},{"name":"x4_0","min":0,"max":1},{"name":"x4_1","min":0,"max":1},{"name":"x4_2","min":0,"max":1},{"name":"x5_0","min":0,"max":1},{"name":"x5_1","min":0,"max":1},{"name":"x5_2","min":0,"max":1},{"name":"used0","min":0,"max":1},{"name":"used1","min":0,"max":1},{"name":"used2","min":0,"max":1}],"constraints":[{"type":"linear","terms":[{"var":"x0_0","coeff":1},{"var":"x0_1","coeff":1},{"var":"x0_2","coeff":1}],"op":"==","rhs":1},{"type":"linear","terms":[{"var":"x1_0","coeff":1},{"var":"x1_1","coeff":1},{"var":"x1_2","coeff":1}],"op":"==","rhs":1},{"type":"linear","terms":[{"var":"x2_0","coeff":1},{"var":"x2_1","coeff":1},{"var":"x2_2","coeff":1}],"op":"==","rhs":1},{"type":"linear","terms":[{"var":"x3_0","coeff":1},{"var":"x3_1","coeff":1},{"var":"x3_2","coeff":1}],"op":"==","rhs":1},{"type":"linear","terms":[{"var":"x4_0","coeff":1},{"var":"x4_1","coeff":1},{"var":"x4_2","coeff":1}],"op":"==","rhs":1},{"type":"linear","terms":[{"var":"x5_0","coeff":1},{"var":"x5_1","coeff":1},{"var":"x5_2","coeff":1}],"op":"==","rhs":1},{"type":"linear","terms":[{"var":"x0_0","coeff":4},{"var":"x1_0","coeff":8},{"var":"x2_0","coeff":1},{"var":"x3_0","coeff":4},{"var":"x4_0","coeff":2},{"var":"x5_0","coeff":1},{"var":"used0","coeff":-10}],"op":"<=","rhs":0},{"type":"linear","terms":[{"var":"x0_1","coeff":4},{"var":"x1_1","coeff":8},{"var":"x2_1","coeff":1},{"var":"x3_1","coeff":4},{"var":"x4_1","coeff":2},{"var":"x5_1","coeff":1},{"var":"used1","coeff":-10}],"op":"<=","rhs":0},{"type":"linear","terms":[{"var":"x0_2","coeff":4},{"var":"x1_2","coeff":8},{"var":"x2_2","coeff":1},{"var":"x3_2","coeff":4},{"var":"x4_2","coeff":2},{"var":"x5_2","coeff":1},{"var":"used2","coeff":-10}],"op":"<=","rhs":0},{"type":"linear","terms":[{"var":"used0","coeff":1},{"var":"used1","coeff":-1}],"op":">=","rhs":0},{"type":"linear","terms":[{"var":"used1","coeff":1},{"var":"used2","coeff":-1}],"op":">=","rhs":0}],"objective":{"sense":"minimize","terms":[{"var":"used0","coeff":1},{"var":"used1","coeff":1},{"var":"used2","coeff":1}]},"timeout_ms":3000}'
```

### cpsat-job-shop

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/cpsat -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"s0_0","min":0,"max":16},{"name":"s0_1","min":0,"max":16},{"name":"s1_0","min":0,"max":16},{"name":"s1_1","min":0,"max":16},{"name":"s2_0","min":0,"max":16},{"name":"s2_1","min":0,"max":16},{"name":"makespan","min":0,"max":16}],"constraints":[{"type":"linear","terms":[{"var":"s0_1","coeff":1},{"var":"s0_0","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s0_1","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"s1_1","coeff":1},{"var":"s1_0","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s1_1","coeff":-1}],"op":">=","rhs":4},{"type":"linear","terms":[{"var":"s2_1","coeff":1},{"var":"s2_0","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s2_1","coeff":-1}],"op":">=","rhs":3},{"type":"no_overlap","intervals":[{"start_var":"s0_0","duration":3},{"start_var":"s1_1","duration":4},{"start_var":"s2_0","duration":2}]},{"type":"no_overlap","intervals":[{"start_var":"s0_1","duration":2},{"start_var":"s1_0","duration":2},{"start_var":"s2_1","duration":3}]}],"objective":{"sense":"minimize","terms":[{"var":"makespan","coeff":1}]},"timeout_ms":3000}'
```

### cpsat-assignment-implication

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/cpsat -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"worker_t0","min":0,"max":2},{"name":"worker_t1","min":0,"max":2},{"name":"worker_t2","min":0,"max":2},{"name":"cost_t0","min":0,"max":100},{"name":"cost_t1","min":0,"max":100},{"name":"cost_t2","min":0,"max":100}],"constraints":[{"type":"all_different","vars":["worker_t0","worker_t1","worker_t2"]},{"type":"element","index_var":"worker_t0","values":[4,1,8],"target_var":"cost_t0"},{"type":"element","index_var":"worker_t1","values":[4,3,5],"target_var":"cost_t1"},{"type":"element","index_var":"worker_t2","values":[3,2,7],"target_var":"cost_t2"},{"type":"implication","if_var":"worker_t0","if_eq":1,"then":{"type":"linear","terms":[{"var":"worker_t2","coeff":1}],"op":">=","rhs":2}}],"objective":{"sense":"minimize","terms":[{"var":"cost_t0","coeff":1},{"var":"cost_t1","coeff":1},{"var":"cost_t2","coeff":1}]},"timeout_ms":3000}'
```

### cpsat-cumulative-resources

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/cpsat -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"s_pour","min":0,"max":15},{"name":"s_frame","min":0,"max":15},{"name":"s_wire","min":0,"max":15},{"name":"s_plumb","min":0,"max":15},{"name":"s_roof","min":0,"max":15},{"name":"s_paint","min":0,"max":15},{"name":"makespan","min":0,"max":15}],"constraints":[{"type":"cumulative","intervals":[{"start_var":"s_pour","duration":3,"demand":2},{"start_var":"s_frame","duration":2,"demand":3},{"start_var":"s_wire","duration":4,"demand":1},{"start_var":"s_plumb","duration":2,"demand":3},{"start_var":"s_roof","duration":3,"demand":2},{"start_var":"s_paint","duration":1,"demand":3}],"capacity":4},{"type":"linear","terms":[{"var":"s_frame","coeff":1},{"var":"s_pour","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"s_roof","coeff":1},{"var":"s_frame","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"s_plumb","coeff":1},{"var":"s_pour","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"s_paint","coeff":1},{"var":"s_roof","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_pour","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_frame","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_wire","coeff":-1}],"op":">=","rhs":4},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_plumb","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_roof","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_paint","coeff":-1}],"op":">=","rhs":1}],"objective":{"sense":"minimize","terms":[{"var":"makespan","coeff":1}]},"timeout_ms":3000}'
```

### cpsat-circuit-routing

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/cpsat -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"x0_1","min":0,"max":1},{"name":"x0_2","min":0,"max":1},{"name":"x0_3","min":0,"max":1},{"name":"x0_4","min":0,"max":1},{"name":"x1_0","min":0,"max":1},{"name":"x1_2","min":0,"max":1},{"name":"x1_3","min":0,"max":1},{"name":"x1_4","min":0,"max":1},{"name":"x2_0","min":0,"max":1},{"name":"x2_1","min":0,"max":1},{"name":"x2_3","min":0,"max":1},{"name":"x2_4","min":0,"max":1},{"name":"x3_0","min":0,"max":1},{"name":"x3_1","min":0,"max":1},{"name":"x3_2","min":0,"max":1},{"name":"x3_4","min":0,"max":1},{"name":"x4_0","min":0,"max":1},{"name":"x4_1","min":0,"max":1},{"name":"x4_2","min":0,"max":1},{"name":"x4_3","min":0,"max":1}],"constraints":[{"type":"circuit","arcs":[{"tail":0,"head":1,"var":"x0_1"},{"tail":0,"head":2,"var":"x0_2"},{"tail":0,"head":3,"var":"x0_3"},{"tail":0,"head":4,"var":"x0_4"},{"tail":1,"head":0,"var":"x1_0"},{"tail":1,"head":2,"var":"x1_2"},{"tail":1,"head":3,"var":"x1_3"},{"tail":1,"head":4,"var":"x1_4"},{"tail":2,"head":0,"var":"x2_0"},{"tail":2,"head":1,"var":"x2_1"},{"tail":2,"head":3,"var":"x2_3"},{"tail":2,"head":4,"var":"x2_4"},{"tail":3,"head":0,"var":"x3_0"},{"tail":3,"head":1,"var":"x3_1"},{"tail":3,"head":2,"var":"x3_2"},{"tail":3,"head":4,"var":"x3_4"},{"tail":4,"head":0,"var":"x4_0"},{"tail":4,"head":1,"var":"x4_1"},{"tail":4,"head":2,"var":"x4_2"},{"tail":4,"head":3,"var":"x4_3"}]},{"type":"bool_or","literals":[{"var":"x3_2","eq":1},{"var":"x4_2","eq":1}]}],"objective":{"sense":"minimize","terms":[{"var":"x0_1","coeff":4},{"var":"x0_2","coeff":9},{"var":"x0_3","coeff":7},{"var":"x0_4","coeff":3},{"var":"x1_0","coeff":5},{"var":"x1_2","coeff":2},{"var":"x1_3","coeff":8},{"var":"x1_4","coeff":6},{"var":"x2_0","coeff":8},{"var":"x2_1","coeff":3},{"var":"x2_3","coeff":4},{"var":"x2_4","coeff":9},{"var":"x3_0","coeff":6},{"var":"x3_1","coeff":7},{"var":"x3_2","coeff":5},{"var":"x3_4","coeff":2},{"var":"x4_0","coeff":2},{"var":"x4_1","coeff":9},{"var":"x4_2","coeff":6},{"var":"x4_3","coeff":5}]},"timeout_ms":3000}'
```

### smt-optimization

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/smt -H 'Content-Type: application/json' --data-raw '{"smtlib2":"(set-info :source \"allocation\")(set-option :produce-models true)(declare-const x Int)(declare-const y Int)(assert (and (>= x 0) (<= x 10) (>= y 0) (<= y 10) (<= (+ x y) 12)))(maximize x)(minimize y)(check-sat)(get-objectives)"}'
```

### cpsat-min-max-abs

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/cpsat -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"x","min":-3,"max":-3},{"name":"y","min":2,"max":2},{"name":"a","min":0,"max":4},{"name":"lo","min":-4,"max":4},{"name":"hi","min":-4,"max":4}],"constraints":[{"type":"abs","var":"x","target_var":"a"},{"type":"min_max","op":"min","vars":["x","y"],"target_var":"lo"},{"type":"min_max","op":"max","vars":["x","y"],"target_var":"hi"},{"type":"implication","if_all":[{"type":"linear","terms":[{"var":"x","coeff":1}],"op":"<","rhs":0},{"type":"linear","terms":[{"var":"y","coeff":1}],"op":">","rhs":0}],"then":{"type":"linear","terms":[{"var":"a","coeff":1}],"op":">=","rhs":3}}],"objective":null,"timeout_ms":null}'
```

### cpsat-conflict-core

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/cpsat -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"x","min":-4,"max":4},{"name":"a","min":0,"max":4}],"constraints":[{"type":"abs","var":"x","target_var":"a"},{"type":"linear","terms":[{"var":"x","coeff":1}],"op":"==","rhs":-3},{"type":"linear","terms":[{"var":"a","coeff":1}],"op":"==","rhs":2},{"type":"linear","terms":[{"var":"x","coeff":1}],"op":"<=","rhs":4}],"produce_unsat_core":true}'
```

### lp-blend-optimal

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/lp-mip -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"corn_kg","type":"continuous","min":0,"max":1000},{"name":"soy_kg","type":"continuous","min":0,"max":1000}],"constraints":[{"terms":[{"var":"corn_kg","coeff":1},{"var":"soy_kg","coeff":1}],"op":">=","rhs":800},{"terms":[{"var":"corn_kg","coeff":0.21},{"var":"soy_kg","coeff":-0.3}],"op":"<=","rhs":0},{"terms":[{"var":"corn_kg","coeff":0.03},{"var":"soy_kg","coeff":-0.01}],"op":">=","rhs":0}],"objective":{"sense":"minimize","terms":[{"var":"corn_kg","coeff":0.3},{"var":"soy_kg","coeff":0.9}]}}'
```

### lp-budget-split-mip

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/lp-mip -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"spend_a","type":"continuous","min":0,"max":40000},{"name":"spend_b","type":"continuous","min":0,"max":30000},{"name":"spend_c","type":"continuous","min":0,"max":40000},{"name":"open_a","type":"integer","min":0,"max":1},{"name":"open_b","type":"integer","min":0,"max":1},{"name":"open_c","type":"integer","min":0,"max":1}],"constraints":[{"terms":[{"var":"spend_a","coeff":1},{"var":"spend_b","coeff":1},{"var":"spend_c","coeff":1},{"var":"open_a","coeff":5000},{"var":"open_b","coeff":20000},{"var":"open_c","coeff":2000}],"op":"<=","rhs":60000},{"terms":[{"var":"spend_a","coeff":1},{"var":"open_a","coeff":-40000}],"op":"<=","rhs":0},{"terms":[{"var":"spend_b","coeff":1},{"var":"open_b","coeff":-30000}],"op":"<=","rhs":0},{"terms":[{"var":"spend_c","coeff":1},{"var":"open_c","coeff":-40000}],"op":"<=","rhs":0}],"objective":{"sense":"maximize","terms":[{"var":"spend_a","coeff":1.2},{"var":"spend_b","coeff":1.5},{"var":"spend_c","coeff":1.1}]}}'
```

### lp-flow-infeasible

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/lp-mip -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"s_a","type":"continuous","min":0,"max":8},{"name":"s_b","type":"continuous","min":0,"max":4},{"name":"a_t","type":"continuous","min":0,"max":10},{"name":"b_t","type":"continuous","min":0,"max":10}],"constraints":[{"terms":[{"var":"s_a","coeff":1},{"var":"a_t","coeff":-1}],"op":"==","rhs":0},{"terms":[{"var":"s_b","coeff":1},{"var":"b_t","coeff":-1}],"op":"==","rhs":0},{"terms":[{"var":"a_t","coeff":1},{"var":"b_t","coeff":1}],"op":">=","rhs":15}]}'
```

# Verification Oracles

## analyze_rules

POST /v1/analyze/rules. MCP: analyze_rules. Ordered first-match rules over bool, bounded int and finite enum inputs. No API key or account required. Zero-logging execution.

- [OpenAPI](https://oracles.burgeonads.com/openapi.json)
- [Constraint reference](https://oracles.burgeonads.com/docs/constraint-oracle)
- [Examples](https://oracles.burgeonads.com/examples/)

## Input

variables: 1..64 unique names matching ^[a-zA-Z_][a-zA-Z0-9_]{0,47}$. bool: {name,type}. int: {name,type,min,max}, -1000000000 <= min <= max <= 1000000000. enum: {name,type,values}, 1..64 unique safe identifiers.

rules: 1..128 {id,when,action} records, unique IDs per version. IDs and actions: strings of 1..64 characters. First matching rule wins. Omitted default_action means an unmatched input has null output and counts as an uncovered gap. A default suppresses gaps. Explicit null on any optional field (default_action, compare_rules, compare_default_action, max_witnesses, timeout_ms) means omitted.

compare_rules: optional second ordered rule list using the same variables; compare_default_action defaults to no output. compare_default_action requires compare_rules. Semantic equality compares effective actions, including null for uncovered inputs; changing only rule IDs is equivalent. Diff witnesses include the exact selected rule IDs (null for default or uncovered).

## Expressions

RuleExpr: {op:"true"}, {op:"false"}, {op:"and",args:[...]}, {op:"or",args:[...]}, {op:"not",arg:...}, {op:"eq"|"ne",var,value}, {op:"lt"|"le"|"gt"|"ge",var,value}, {op:"in",var,values:[...]}. Boolean arrays and membership lists are non-empty. Ordering requires int; membership requires int or enum. Constants must match the declared type and domain; bool is distinct from int. A comparison value may be {var:"other"} to compare two variables of the same type: ordering needs two ints; enums compare by value name, so enums with different value lists are equal only on shared names.

Each rule expression: depth <=16 (root depth 1), <=256 AST nodes. Boolean arrays <=255 children; membership <=256 values. Unknown variables, fields and operators, duplicate declarations and out-of-domain constants fail with INVALID_INPUT and structural paths. Input values never appear in errors.

## Analysis

unreachable_rules: unsatisfiable guards or satisfiable guards shadowed by earlier rules. shadowed_by lists earlier intersecting rule IDs; their union covers the guard, and the list need not be minimal. overlaps: satisfiable guard pairs in source order, including shadowed rules; conflict is true exactly when actions differ. uncovered_gap: whether some input has no rule and no default, with a concrete witness.

diff: null without compare_rules; otherwise equivalent plus distinct diverging witnesses. max_witnesses: 1..20, default 10, separately caps overlap pairs and diff inputs. Lists are capped samples; complete means every required solver check finished within these caps, not that all witnesses or overlap pairs were enumerated.

## Verification and limits

Every returned witness is independently evaluated against the original JSON AST in pure code: exact variable domains, both overlap guards and conflict flag, uncovered gap, and first-match actions and rule IDs for diffs. verified=true requires verdict=complete and all witness checks passing. Unreachability, absence of gaps, and equivalence remain solver-reported proofs; witness replay does not independently prove negative claims. Any witness mismatch aborts with INTERNAL_ERROR.

verdict: complete, timeout or unknown. Timeout and unknown return verified=false and no findings or witnesses. One timeout_ms budget covers encoding, all queries and verification: 100..5000, default 3000. The supervisor kills and reaps the process group at timeout_ms + 500 ms. Request <=65536 bytes; response <=262144 bytes; compute slots 3. Execution uses the isolated no-egress worker. No input retention.

## Schemas

### analyze_rules request

```json
{
  "$defs": {
    "Int": {
      "maximum": 1000000000,
      "minimum": -1000000000,
      "type": "integer"
    },
    "Label": {
      "maxLength": 64,
      "minLength": 1,
      "type": "string"
    },
    "Name": {
      "maxLength": 48,
      "minLength": 1,
      "pattern": "^[a-zA-Z_][a-zA-Z0-9_]{0,47}$",
      "type": "string"
    },
    "Rule": {
      "additionalProperties": false,
      "properties": {
        "action": {
          "$ref": "#/$defs/Label"
        },
        "id": {
          "$ref": "#/$defs/Label"
        },
        "when": {
          "$ref": "#/$defs/RuleExpr"
        }
      },
      "required": [
        "id",
        "when",
        "action"
      ],
      "type": "object"
    },
    "RuleBoolVariable": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "const": "bool",
          "type": "string"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "type": "object"
    },
    "RuleBoolean": {
      "additionalProperties": false,
      "properties": {
        "args": {
          "items": {
            "$ref": "#/$defs/RuleExpr"
          },
          "maxItems": 255,
          "minItems": 1,
          "type": "array"
        },
        "op": {
          "enum": [
            "and",
            "or"
          ],
          "type": "string"
        }
      },
      "required": [
        "op",
        "args"
      ],
      "type": "object"
    },
    "RuleComparison": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "enum": [
            "eq",
            "ne",
            "lt",
            "le",
            "gt",
            "ge"
          ],
          "type": "string"
        },
        "value": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "$ref": "#/$defs/Int"
            },
            {
              "$ref": "#/$defs/Name"
            },
            {
              "$ref": "#/$defs/VarRef"
            }
          ]
        },
        "var": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "op",
        "var",
        "value"
      ],
      "type": "object"
    },
    "RuleConstant": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "enum": [
            "true",
            "false"
          ],
          "type": "string"
        }
      },
      "required": [
        "op"
      ],
      "type": "object"
    },
    "RuleEnumVariable": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "const": "enum",
          "type": "string"
        },
        "values": {
          "items": {
            "$ref": "#/$defs/Name"
          },
          "maxItems": 64,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "name",
        "type",
        "values"
      ],
      "type": "object"
    },
    "RuleExpr": {
      "oneOf": [
        {
          "$ref": "#/$defs/RuleConstant"
        },
        {
          "$ref": "#/$defs/RuleBoolean"
        },
        {
          "$ref": "#/$defs/RuleNot"
        },
        {
          "$ref": "#/$defs/RuleComparison"
        },
        {
          "$ref": "#/$defs/RuleMembership"
        }
      ]
    },
    "RuleIntVariable": {
      "additionalProperties": false,
      "properties": {
        "max": {
          "$ref": "#/$defs/Int"
        },
        "min": {
          "$ref": "#/$defs/Int"
        },
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "const": "int",
          "type": "string"
        }
      },
      "required": [
        "name",
        "type",
        "min",
        "max"
      ],
      "type": "object"
    },
    "RuleMembership": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "const": "in",
          "type": "string"
        },
        "values": {
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/Int"
              },
              {
                "$ref": "#/$defs/Name"
              }
            ]
          },
          "maxItems": 256,
          "minItems": 1,
          "type": "array"
        },
        "var": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "op",
        "var",
        "values"
      ],
      "type": "object"
    },
    "RuleNot": {
      "additionalProperties": false,
      "properties": {
        "arg": {
          "$ref": "#/$defs/RuleExpr"
        },
        "op": {
          "const": "not",
          "type": "string"
        }
      },
      "required": [
        "op",
        "arg"
      ],
      "type": "object"
    },
    "VarRef": {
      "additionalProperties": false,
      "properties": {
        "var": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "var"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "compare_default_action": {
      "anyOf": [
        {
          "$ref": "#/$defs/Label"
        },
        {
          "type": "null"
        }
      ]
    },
    "compare_rules": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Rule"
          },
          "maxItems": 128,
          "minItems": 1,
          "type": "array"
        },
        {
          "type": "null"
        }
      ]
    },
    "default_action": {
      "anyOf": [
        {
          "$ref": "#/$defs/Label"
        },
        {
          "type": "null"
        }
      ]
    },
    "max_witnesses": {
      "anyOf": [
        {
          "maximum": 20,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 10
    },
    "rules": {
      "items": {
        "$ref": "#/$defs/Rule"
      },
      "maxItems": 128,
      "minItems": 1,
      "type": "array"
    },
    "timeout_ms": {
      "anyOf": [
        {
          "maximum": 5000,
          "minimum": 100,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 3000
    },
    "variables": {
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/RuleBoolVariable"
          },
          {
            "$ref": "#/$defs/RuleIntVariable"
          },
          {
            "$ref": "#/$defs/RuleEnumVariable"
          }
        ]
      },
      "maxItems": 64,
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "variables",
    "rules"
  ],
  "type": "object"
}
```

### analyze_rules response

```json
{
  "$defs": {
    "Label": {
      "maxLength": 64,
      "minLength": 1,
      "type": "string"
    },
    "RuleDiff": {
      "additionalProperties": false,
      "properties": {
        "equivalent": {
          "type": "boolean"
        },
        "witnesses": {
          "items": {
            "$ref": "#/$defs/RuleDiffWitness"
          },
          "maxItems": 20,
          "type": "array"
        }
      },
      "required": [
        "equivalent",
        "witnesses"
      ],
      "type": "object"
    },
    "RuleDiffWitness": {
      "additionalProperties": false,
      "properties": {
        "input": {
          "$ref": "#/$defs/Witness"
        },
        "v1_action": {
          "anyOf": [
            {
              "$ref": "#/$defs/Label"
            },
            {
              "type": "null"
            }
          ]
        },
        "v1_rule": {
          "anyOf": [
            {
              "$ref": "#/$defs/Label"
            },
            {
              "type": "null"
            }
          ]
        },
        "v2_action": {
          "anyOf": [
            {
              "$ref": "#/$defs/Label"
            },
            {
              "type": "null"
            }
          ]
        },
        "v2_rule": {
          "anyOf": [
            {
              "$ref": "#/$defs/Label"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "input",
        "v1_action",
        "v2_action",
        "v1_rule",
        "v2_rule"
      ],
      "type": "object"
    },
    "RuleGap": {
      "additionalProperties": false,
      "properties": {
        "has_gap": {
          "type": "boolean"
        },
        "witness": {
          "anyOf": [
            {
              "$ref": "#/$defs/Witness"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "has_gap"
      ],
      "type": "object"
    },
    "RuleOverlap": {
      "additionalProperties": false,
      "properties": {
        "conflict": {
          "type": "boolean"
        },
        "rule_a": {
          "$ref": "#/$defs/Label"
        },
        "rule_b": {
          "$ref": "#/$defs/Label"
        },
        "witness": {
          "$ref": "#/$defs/Witness"
        }
      },
      "required": [
        "rule_a",
        "rule_b",
        "conflict",
        "witness"
      ],
      "type": "object"
    },
    "Stats": {
      "additionalProperties": false,
      "properties": {
        "elapsed_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "timed_out": {
          "type": "boolean"
        }
      },
      "required": [
        "elapsed_ms",
        "timed_out"
      ],
      "type": "object"
    },
    "UnreachableRule": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/$defs/Label"
        },
        "reason": {
          "enum": [
            "unsatisfiable",
            "shadowed"
          ],
          "type": "string"
        },
        "shadowed_by": {
          "items": {
            "$ref": "#/$defs/Label"
          },
          "type": "array"
        }
      },
      "required": [
        "id",
        "reason"
      ],
      "type": "object"
    },
    "Witness": {
      "additionalProperties": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "diff": {
      "anyOf": [
        {
          "$ref": "#/$defs/RuleDiff"
        },
        {
          "type": "null"
        }
      ]
    },
    "overlaps": {
      "items": {
        "$ref": "#/$defs/RuleOverlap"
      },
      "maxItems": 20,
      "type": "array"
    },
    "stats": {
      "$ref": "#/$defs/Stats"
    },
    "uncovered_gap": {
      "anyOf": [
        {
          "$ref": "#/$defs/RuleGap"
        },
        {
          "type": "null"
        }
      ]
    },
    "unreachable_rules": {
      "items": {
        "$ref": "#/$defs/UnreachableRule"
      },
      "maxItems": 128,
      "type": "array"
    },
    "verdict": {
      "enum": [
        "complete",
        "timeout",
        "unknown"
      ],
      "type": "string"
    },
    "verified": {
      "type": "boolean"
    }
  },
  "required": [
    "verdict",
    "verified",
    "stats"
  ],
  "type": "object"
}
```

## Errors

INVALID_INPUT: HTTP 422. INTERNAL_ERROR: HTTP 500 with no unverified witness. Other shared limits and errors are listed in the constraint reference.

```json
{
  "error": {
    "code": "INVALID_INPUT",
    "docs_resource": "oracle://docs/verification-oracles",
    "docs_url": "https://oracles.burgeonads.com/docs/verification-oracles.md",
    "example_resource": "oracle://examples/rules-rbac-gap-overlap",
    "example_url": "https://oracles.burgeonads.com/examples/rules-rbac-gap-overlap.json",
    "message": "Schema validation failed."
  }
}
```

## MCP Resources

oracle://docs/schema-compat, oracle://docs/overview, oracle://docs/constraint-oracle, oracle://docs/verification-oracles, oracle://docs/full, oracle://examples, oracle://examples/{slug}. Read-only; no compute slot.

## MCP Prompts

check_schema_compat(), diff_regex(), check_state_machine(), verify_rules(), model_schedule(engine), debug_unsat(tool), optimize_linear(), optimize_allocation(pattern, sense). All arguments optional.

Solver tool annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false. submit_feedback: readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=false. outputSchema: verified result or error envelope.

## verify_state_machine

POST /v1/verify/state-machine. MCP: verify_state_machine. Deterministic bounded BFS over finite state variables. Declared initial-state and transition order breaks shortest-trace ties.

### State variables and expressions

variables: 1..16 unique safe names. bool: {name,type}. int: {name,type,min,max}, -1000000 <= min <= max <= 1000000, max-min <=1000. enum: {name,type,values}, 1..32 unique safe identifiers. Names and enum values match ^[a-zA-Z_][a-zA-Z0-9_]{0,47}$. Exactly one of initial or initial_states (1..16 complete states). Values must match types and domains; bool is distinct from int. Explicit null on any optional field means omitted, so the unused initial form may be null.

transitions: 1..64 {name,guard,updates}, unique names. StateExpr extends RuleExpr: comparison value can be {var:"other"}, with matching types. Ordering requires int; membership requires int or enum. Guard constants must be in domain. UpdateExpr: {op:"const",value}, {op:"var",var}, {op:"add"|"sub",left,right}, {op:"clamp",arg,min,max}. Constants and clamp bounds are -1000000..1000000; arithmetic operands must be int. Every update reads the old state simultaneously; omitted variables retain their value. Any out-of-domain result is a domain_violation, never silently clamped.

Each guard, update, invariant, terminal condition or goal AST has depth <=16 and <=256 nodes. Boolean arrays have 1..255 children. Membership has 1..256 values. invariants: 0..32 {name,expr}; reachability: 0..16 {name,expr}; unique names in each list. Unknown fields, operators, variables and mistyped expressions return non-reflecting INVALID_INPUT errors.

### Exploration and replay

check_deadlocks defaults true. A deadlock has no enabled transitions and does not satisfy optional terminal_condition. Terminal states still obey invariants and may have outgoing transitions. BFS stops at the first shortest invariant, domain or deadlock counterexample; multiple failed invariants at that state share its trace. Domain traces include the invalid final state and name the first violated variable in declaration order.

Traces: [{step:0,transition:null,state:{...}}, ...]. Independent pure replay checks initial membership, step numbers, every guard, simultaneous updates, exact values and types, domains and the claimed final condition. Every returned goal witness is replayed too. verified_safe additionally requires an independent complete traversal proving finite closure, all invariants, deadlock freedom and negative reachability claims. Any mismatch returns INTERNAL_ERROR.

status: verified_safe requires exhaustive=true; counterexample_found carries verified=true only after replay. state_limit_reached and timeout have verified=false and exhaustive=false. state_limit_reached includes depth truncation. No unseen successor beyond a cap can produce a safety claim. Exact-cap closure and cycles may still be exhaustive.

### Livelocks

check_livelocks defaults false. When true, a livelock is a reachable cycle whose states, and the path to it, never satisfy terminal_condition: an infinite execution that never terminates. Without terminal_condition every reachable cycle is a livelock, including a self-loop transition that leaves the state unchanged. Cycles reachable only through a terminal state are not livelocks. No fairness is assumed: one enabled loop is enough.

livelock: {found, loop_start, trace}. trace is a lasso: steps 0..loop_start reach the loop, and the final state repeats trace[loop_start].state, so the loop repeats forever. The loop is a shortest cycle through the shallowest state of a cyclic component; the lasso is short, not necessarily globally shortest, and its transitions never exceed max_depth. Search runs after BFS on every explored edge, so a partial exploration may still return a verified livelock. Safety counterexamples found during BFS are returned first.

Replay checks the lasso like every trace, plus the repeated state and that no step satisfies terminal_condition. verified_safe with check_livelocks also requires an independent traversal and cycle elimination by in-degree proving that no reachable non-terminal cycle exists. With check_deadlocks too, verified_safe proves every execution eventually reaches terminal_condition. A livelock whose lasso exceeds max_depth gives state_limit_reached.

reachability records have goal, reachable and trace. reachable=true has a shortest witness; false means exhaustive unreachability; null means no witness was found before stopping. unreachable_transitions is populated only after exhaustive exploration. states_explored counts valid dequeued states; transitions_fired counts enabled updates evaluated, including repeats and depth-frontier checks. Incomplete exploration does not claim unreachable goals or transitions.

### Limits

max_states 1..20000, default 5000; max_depth 1..200, default 50, initial depth 0. timeout_ms 100..5000, default 3000, covers exploration and independent verification. Timeout discards partial findings. The supervisor kills and reaps the process group at timeout_ms +500 ms. Request <=65536 bytes; response <=262144 bytes, including MCP wrapping; oversized traces return RESOURCE_LIMIT_EXCEEDED. Same isolated worker, three compute slots, payment hook and aggregate-only telemetry as other tools.

### verify_state_machine schemas

### verify_state_machine request

```json
{
  "$defs": {
    "FsmEnumVariable": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "const": "enum",
          "type": "string"
        },
        "values": {
          "items": {
            "$ref": "#/$defs/Name"
          },
          "maxItems": 32,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "name",
        "type",
        "values"
      ],
      "type": "object"
    },
    "FsmIntVariable": {
      "additionalProperties": false,
      "properties": {
        "max": {
          "$ref": "#/$defs/StateInt"
        },
        "min": {
          "$ref": "#/$defs/StateInt"
        },
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "const": "int",
          "type": "string"
        }
      },
      "required": [
        "name",
        "type",
        "min",
        "max"
      ],
      "type": "object"
    },
    "FsmPredicate": {
      "additionalProperties": false,
      "properties": {
        "expr": {
          "$ref": "#/$defs/StateExpr"
        },
        "name": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "name",
        "expr"
      ],
      "type": "object"
    },
    "FsmState": {
      "maxProperties": 16,
      "patternProperties": {
        "^[a-zA-Z_][a-zA-Z0-9_]{0,47}$": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "integer"
            },
            {
              "$ref": "#/$defs/Name"
            }
          ]
        }
      },
      "propertyNames": {
        "maxLength": 48,
        "minLength": 1
      },
      "type": "object"
    },
    "FsmTransition": {
      "additionalProperties": false,
      "properties": {
        "guard": {
          "$ref": "#/$defs/StateExpr"
        },
        "name": {
          "$ref": "#/$defs/Name"
        },
        "updates": {
          "maxProperties": 16,
          "patternProperties": {
            "^[a-zA-Z_][a-zA-Z0-9_]{0,47}$": {
              "$ref": "#/$defs/UpdateExpr"
            }
          },
          "propertyNames": {
            "maxLength": 48,
            "minLength": 1
          },
          "type": "object"
        }
      },
      "required": [
        "name",
        "guard",
        "updates"
      ],
      "type": "object"
    },
    "Int": {
      "maximum": 1000000000,
      "minimum": -1000000000,
      "type": "integer"
    },
    "Name": {
      "maxLength": 48,
      "minLength": 1,
      "pattern": "^[a-zA-Z_][a-zA-Z0-9_]{0,47}$",
      "type": "string"
    },
    "RuleBoolVariable": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "const": "bool",
          "type": "string"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "type": "object"
    },
    "RuleConstant": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "enum": [
            "true",
            "false"
          ],
          "type": "string"
        }
      },
      "required": [
        "op"
      ],
      "type": "object"
    },
    "RuleMembership": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "const": "in",
          "type": "string"
        },
        "values": {
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/Int"
              },
              {
                "$ref": "#/$defs/Name"
              }
            ]
          },
          "maxItems": 256,
          "minItems": 1,
          "type": "array"
        },
        "var": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "op",
        "var",
        "values"
      ],
      "type": "object"
    },
    "StateBoolean": {
      "additionalProperties": false,
      "properties": {
        "args": {
          "items": {
            "$ref": "#/$defs/StateExpr"
          },
          "maxItems": 255,
          "minItems": 1,
          "type": "array"
        },
        "op": {
          "enum": [
            "and",
            "or"
          ],
          "type": "string"
        }
      },
      "required": [
        "op",
        "args"
      ],
      "type": "object"
    },
    "StateComparison": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "enum": [
            "eq",
            "ne",
            "lt",
            "le",
            "gt",
            "ge"
          ],
          "type": "string"
        },
        "value": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "$ref": "#/$defs/StateInt"
            },
            {
              "$ref": "#/$defs/Name"
            },
            {
              "$ref": "#/$defs/VarRef"
            }
          ]
        },
        "var": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "op",
        "var",
        "value"
      ],
      "type": "object"
    },
    "StateExpr": {
      "oneOf": [
        {
          "$ref": "#/$defs/RuleConstant"
        },
        {
          "$ref": "#/$defs/StateBoolean"
        },
        {
          "$ref": "#/$defs/StateNot"
        },
        {
          "$ref": "#/$defs/StateComparison"
        },
        {
          "$ref": "#/$defs/RuleMembership"
        }
      ]
    },
    "StateInt": {
      "maximum": 1000000,
      "minimum": -1000000,
      "type": "integer"
    },
    "StateNot": {
      "additionalProperties": false,
      "properties": {
        "arg": {
          "$ref": "#/$defs/StateExpr"
        },
        "op": {
          "const": "not",
          "type": "string"
        }
      },
      "required": [
        "op",
        "arg"
      ],
      "type": "object"
    },
    "UpdateArithmetic": {
      "additionalProperties": false,
      "properties": {
        "left": {
          "$ref": "#/$defs/UpdateExpr"
        },
        "op": {
          "enum": [
            "add",
            "sub"
          ],
          "type": "string"
        },
        "right": {
          "$ref": "#/$defs/UpdateExpr"
        }
      },
      "required": [
        "op",
        "left",
        "right"
      ],
      "type": "object"
    },
    "UpdateClamp": {
      "additionalProperties": false,
      "properties": {
        "arg": {
          "$ref": "#/$defs/UpdateExpr"
        },
        "max": {
          "$ref": "#/$defs/StateInt"
        },
        "min": {
          "$ref": "#/$defs/StateInt"
        },
        "op": {
          "const": "clamp",
          "type": "string"
        }
      },
      "required": [
        "op",
        "arg",
        "min",
        "max"
      ],
      "type": "object"
    },
    "UpdateConstant": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "const": "const",
          "type": "string"
        },
        "value": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "$ref": "#/$defs/StateInt"
            },
            {
              "$ref": "#/$defs/Name"
            }
          ]
        }
      },
      "required": [
        "op",
        "value"
      ],
      "type": "object"
    },
    "UpdateExpr": {
      "oneOf": [
        {
          "$ref": "#/$defs/UpdateConstant"
        },
        {
          "$ref": "#/$defs/UpdateReference"
        },
        {
          "$ref": "#/$defs/UpdateArithmetic"
        },
        {
          "$ref": "#/$defs/UpdateClamp"
        }
      ]
    },
    "UpdateReference": {
      "additionalProperties": false,
      "properties": {
        "op": {
          "const": "var",
          "type": "string"
        },
        "var": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "op",
        "var"
      ],
      "type": "object"
    },
    "VarRef": {
      "additionalProperties": false,
      "properties": {
        "var": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "var"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "initial"
      ]
    },
    {
      "required": [
        "initial_states"
      ]
    }
  ],
  "properties": {
    "check_deadlocks": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": true
    },
    "check_livelocks": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false
    },
    "initial": {
      "anyOf": [
        {
          "$ref": "#/$defs/FsmState"
        },
        {
          "type": "null"
        }
      ]
    },
    "initial_states": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/FsmState"
          },
          "maxItems": 16,
          "minItems": 1,
          "type": "array"
        },
        {
          "type": "null"
        }
      ]
    },
    "invariants": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/FsmPredicate"
          },
          "maxItems": 32,
          "type": "array"
        },
        {
          "type": "null"
        }
      ]
    },
    "max_depth": {
      "anyOf": [
        {
          "maximum": 200,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 50
    },
    "max_states": {
      "anyOf": [
        {
          "maximum": 20000,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 5000
    },
    "reachability": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/FsmPredicate"
          },
          "maxItems": 16,
          "type": "array"
        },
        {
          "type": "null"
        }
      ]
    },
    "terminal_condition": {
      "anyOf": [
        {
          "$ref": "#/$defs/StateExpr"
        },
        {
          "type": "null"
        }
      ]
    },
    "timeout_ms": {
      "anyOf": [
        {
          "maximum": 5000,
          "minimum": 100,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 3000
    },
    "transitions": {
      "items": {
        "$ref": "#/$defs/FsmTransition"
      },
      "maxItems": 64,
      "minItems": 1,
      "type": "array"
    },
    "variables": {
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/RuleBoolVariable"
          },
          {
            "$ref": "#/$defs/FsmIntVariable"
          },
          {
            "$ref": "#/$defs/FsmEnumVariable"
          }
        ]
      },
      "maxItems": 16,
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "variables",
    "transitions"
  ],
  "type": "object"
}
```

### verify_state_machine response

```json
{
  "$defs": {
    "FsmDeadlock": {
      "additionalProperties": false,
      "properties": {
        "found": {
          "default": false,
          "type": "boolean"
        },
        "trace": {
          "anyOf": [
            {
              "$ref": "#/$defs/Trace"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object"
    },
    "FsmDomainViolation": {
      "additionalProperties": false,
      "properties": {
        "trace": {
          "$ref": "#/$defs/Trace"
        },
        "variable": {
          "$ref": "#/$defs/Name"
        }
      },
      "required": [
        "variable",
        "trace"
      ],
      "type": "object"
    },
    "FsmInvariantViolation": {
      "additionalProperties": false,
      "properties": {
        "invariant": {
          "$ref": "#/$defs/Name"
        },
        "trace": {
          "$ref": "#/$defs/Trace"
        }
      },
      "required": [
        "invariant",
        "trace"
      ],
      "type": "object"
    },
    "FsmLivelock": {
      "additionalProperties": false,
      "properties": {
        "found": {
          "default": false,
          "type": "boolean"
        },
        "loop_start": {
          "anyOf": [
            {
              "maximum": 199,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "trace": {
          "anyOf": [
            {
              "$ref": "#/$defs/Trace"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object"
    },
    "FsmReachability": {
      "additionalProperties": false,
      "properties": {
        "goal": {
          "$ref": "#/$defs/Name"
        },
        "reachable": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "trace": {
          "anyOf": [
            {
              "$ref": "#/$defs/Trace"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "goal",
        "reachable"
      ],
      "type": "object"
    },
    "FsmState": {
      "maxProperties": 16,
      "patternProperties": {
        "^[a-zA-Z_][a-zA-Z0-9_]{0,47}$": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "integer"
            },
            {
              "$ref": "#/$defs/Name"
            }
          ]
        }
      },
      "propertyNames": {
        "maxLength": 48,
        "minLength": 1
      },
      "type": "object"
    },
    "FsmStep": {
      "additionalProperties": false,
      "properties": {
        "state": {
          "$ref": "#/$defs/FsmState"
        },
        "step": {
          "maximum": 200,
          "minimum": 0,
          "type": "integer"
        },
        "transition": {
          "anyOf": [
            {
              "$ref": "#/$defs/Name"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "step",
        "transition",
        "state"
      ],
      "type": "object"
    },
    "Name": {
      "maxLength": 48,
      "minLength": 1,
      "pattern": "^[a-zA-Z_][a-zA-Z0-9_]{0,47}$",
      "type": "string"
    },
    "Stats": {
      "additionalProperties": false,
      "properties": {
        "elapsed_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "timed_out": {
          "type": "boolean"
        }
      },
      "required": [
        "elapsed_ms",
        "timed_out"
      ],
      "type": "object"
    },
    "Trace": {
      "items": {
        "$ref": "#/$defs/FsmStep"
      },
      "maxItems": 201,
      "minItems": 1,
      "type": "array"
    }
  },
  "additionalProperties": false,
  "properties": {
    "deadlock": {
      "$ref": "#/$defs/FsmDeadlock"
    },
    "domain_violations": {
      "items": {
        "$ref": "#/$defs/FsmDomainViolation"
      },
      "maxItems": 1,
      "type": "array"
    },
    "exhaustive": {
      "default": false,
      "type": "boolean"
    },
    "invariant_violations": {
      "items": {
        "$ref": "#/$defs/FsmInvariantViolation"
      },
      "maxItems": 32,
      "type": "array"
    },
    "livelock": {
      "$ref": "#/$defs/FsmLivelock"
    },
    "reachability": {
      "items": {
        "$ref": "#/$defs/FsmReachability"
      },
      "maxItems": 16,
      "type": "array"
    },
    "states_explored": {
      "default": 0,
      "maximum": 20000,
      "minimum": 0,
      "type": "integer"
    },
    "stats": {
      "$ref": "#/$defs/Stats"
    },
    "status": {
      "enum": [
        "verified_safe",
        "counterexample_found",
        "state_limit_reached",
        "timeout"
      ],
      "type": "string"
    },
    "transitions_fired": {
      "default": 0,
      "maximum": 1280000,
      "minimum": 0,
      "type": "integer"
    },
    "unreachable_transitions": {
      "items": {
        "$ref": "#/$defs/Name"
      },
      "maxItems": 64,
      "type": "array"
    },
    "verified": {
      "type": "boolean"
    }
  },
  "required": [
    "status",
    "verified",
    "stats"
  ],
  "type": "object"
}
```

## analyze_regex

POST /v1/analyze/regex. MCP: analyze_regex. Exact full-string regular-language analysis over printable ASCII plus tab, newline and carriage return (98 characters). No backtracking matching is used.

### Regular subset

Literals, escaped literals, \d \w \s and their uppercase negations, \t \n \r, \xHH, dot (excludes newline), character classes with ranges and negation, groups, non-capturing groups, alternation, *, +, ?, {m}, {m,}, {m,n}. Boundary ^ and $ are redundant full-string anchors; internal anchors are rejected. Character classes and negations are relative to the character domain; \w is ASCII letters, digits and underscore. Lazy quantifiers preserve the same path set.

Backreferences, lookarounds, atomic groups, possessive quantifiers, inline flags, word boundaries, recursion and class set operations return HTTP 400 UNSUPPORTED_FEATURE naming only a static construct class. Malformed syntax returns HTTP 422 INVALID_INPUT with structural field and column. No raw pattern text appears in errors.

### Language and difference

empty and universal describe the complete language over the character domain. max_samples 0..20, default 5, separately caps distinct matching_samples and non_matching_samples. Samples are shortest-first; deterministic ties use lowercase, digits, uppercase, punctuation, space, tab, newline, carriage return. Fewer samples mean that language side is exhausted.

compare_pattern is optional and must be omitted rather than null. equivalence is null without it; otherwise exact product exploration returns equivalent and the shortest only_in_pattern and only_in_compare witnesses. A null witness means that side of the symmetric difference is empty. The empty string is a valid witness.

### Ambiguity certificates

check_ambiguity defaults true; false returns ambiguity=null. risk_class: none, finite, polynomial or exponential. A weighted position NFA self-product detects two distinct accepting paths. Two distinct same-word cycles at one live state prove exponential ambiguity; synchronized paths p->p, p->q and q->q, p!=q, prove polynomial ambiguity after exponential ambiguity is excluded. Finite ambiguity has a concrete dual-path string and no pump.

Optional loop iterations must consume input; required iterations may be empty. This progress guard prevents empty iterations alone creating infinite path counts. Counts describe syntactic NFA paths, independent of greedy or lazy order. Ambiguity describes path growth, not measured runtime or a claim about a particular matching engine.

A pumped witness accepts prefix + pump^k + suffix for all k>=1; example_string uses k=2. accepting_paths lists exact saturated counts for k=1,2,3,4 (finite: one count), capped at 1000000000000000. The cycle certificate proves growth for every k. attack_suffix is a separate rejection suffix: prefix + pump^k + attack_suffix is rejected for every k>=1. It may be empty, or null when no common rejection suffix exists, including universal languages. suffix is the accepting continuation.

paths contains two distinct compact accepting NFA paths for example_string; pump_paths contains two exponential cycle paths or the three polynomial paths. states: 0 is entry, 1..N are consuming positions in AST expansion order, -1 is accepting exit. choices selects a zero-based epsilon-route ordinal for each edge. Multiplicity is established by independent lockstep count propagation, without enumerating paths.

### Verification and bounds

An independent epsilon-NFA compiler checks membership in linear time per string, every diff side, shortest witness lengths, emptiness, universality and exact equivalence by separate state-set exploration. It independently eliminates epsilon routes to replay every compact path and pump structure, recounts paths, proves negative ambiguity claims by a self-product, independently excludes higher growth classes with synchronized-product SCC and triple-path checks, and checks the entire periodic pump-state orbit for an attack suffix. A mismatch returns INTERNAL_ERROR with no findings.

Patterns: 1..1024 ASCII bytes, <=512 syntax nodes, group depth <=32, repeat bounds 0..64, <=2048 expanded character positions and <=8192 expanded syntax nodes. DFA <=4096 states each; product <=65536 states; weighted edges <=262144; analysis work <=2000000 steps; each returned string <=16384 characters. Verification has its own bounded exploration. Exceeding a cap returns HTTP 422 RESOURCE_LIMIT_EXCEEDED with no partial findings.

timeout_ms 100..5000, default 3000, covers construction and independent verification. Timeout returns verdict=timeout, verified=false and no findings; complete results require verified=true. The supervisor kills and reaps the process group at timeout_ms +500 ms. Same isolated worker, 65536-byte request, 262144-byte response including MCP wrapping, three compute slots and aggregate-only telemetry.

### analyze_regex schemas

### analyze_regex request

```json
{
  "additionalProperties": false,
  "properties": {
    "check_ambiguity": {
      "default": true,
      "type": "boolean"
    },
    "compare_pattern": {
      "maxLength": 1024,
      "minLength": 1,
      "type": "string"
    },
    "max_samples": {
      "default": 5,
      "maximum": 20,
      "minimum": 0,
      "type": "integer"
    },
    "pattern": {
      "maxLength": 1024,
      "minLength": 1,
      "type": "string"
    },
    "timeout_ms": {
      "default": 3000,
      "maximum": 5000,
      "minimum": 100,
      "type": "integer"
    }
  },
  "required": [
    "pattern"
  ],
  "type": "object"
}
```

### analyze_regex response

```json
{
  "$defs": {
    "RegexAmbiguity": {
      "additionalProperties": false,
      "properties": {
        "ambiguous": {
          "type": "boolean"
        },
        "risk_class": {
          "enum": [
            "none",
            "finite",
            "polynomial",
            "exponential"
          ],
          "type": "string"
        },
        "witness": {
          "anyOf": [
            {
              "$ref": "#/$defs/RegexWitness"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "ambiguous",
        "risk_class"
      ],
      "type": "object"
    },
    "RegexEquivalence": {
      "additionalProperties": false,
      "properties": {
        "equivalent": {
          "type": "boolean"
        },
        "only_in_compare": {
          "anyOf": [
            {
              "$ref": "#/$defs/Text"
            },
            {
              "type": "null"
            }
          ]
        },
        "only_in_pattern": {
          "anyOf": [
            {
              "$ref": "#/$defs/Text"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "equivalent"
      ],
      "type": "object"
    },
    "RegexPath": {
      "additionalProperties": false,
      "properties": {
        "choices": {
          "items": {
            "maximum": 1000000000000000,
            "minimum": 0,
            "type": "integer"
          },
          "maxItems": 16385,
          "type": "array"
        },
        "states": {
          "items": {
            "maximum": 2048,
            "minimum": -1,
            "type": "integer"
          },
          "maxItems": 16386,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "states",
        "choices"
      ],
      "type": "object"
    },
    "RegexWitness": {
      "additionalProperties": false,
      "properties": {
        "accepting_paths": {
          "items": {
            "maximum": 1000000000000000,
            "minimum": 1,
            "type": "integer"
          },
          "maxItems": 4,
          "minItems": 1,
          "type": "array"
        },
        "attack_suffix": {
          "anyOf": [
            {
              "$ref": "#/$defs/Text"
            },
            {
              "type": "null"
            }
          ]
        },
        "example_string": {
          "$ref": "#/$defs/Text"
        },
        "paths": {
          "items": {
            "$ref": "#/$defs/RegexPath"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        },
        "prefix": {
          "anyOf": [
            {
              "$ref": "#/$defs/Text"
            },
            {
              "type": "null"
            }
          ]
        },
        "pump": {
          "anyOf": [
            {
              "$ref": "#/$defs/Text"
            },
            {
              "type": "null"
            }
          ]
        },
        "pump_paths": {
          "items": {
            "$ref": "#/$defs/RegexPath"
          },
          "maxItems": 3,
          "type": "array"
        },
        "suffix": {
          "anyOf": [
            {
              "$ref": "#/$defs/Text"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "example_string",
        "accepting_paths",
        "paths"
      ],
      "type": "object"
    },
    "Stats": {
      "additionalProperties": false,
      "properties": {
        "elapsed_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "timed_out": {
          "type": "boolean"
        }
      },
      "required": [
        "elapsed_ms",
        "timed_out"
      ],
      "type": "object"
    },
    "Text": {
      "maxLength": 16384,
      "type": "string"
    }
  },
  "additionalProperties": false,
  "properties": {
    "ambiguity": {
      "anyOf": [
        {
          "$ref": "#/$defs/RegexAmbiguity"
        },
        {
          "type": "null"
        }
      ]
    },
    "empty": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "equivalence": {
      "anyOf": [
        {
          "$ref": "#/$defs/RegexEquivalence"
        },
        {
          "type": "null"
        }
      ]
    },
    "matching_samples": {
      "items": {
        "$ref": "#/$defs/Text"
      },
      "maxItems": 20,
      "type": "array"
    },
    "non_matching_samples": {
      "items": {
        "$ref": "#/$defs/Text"
      },
      "maxItems": 20,
      "type": "array"
    },
    "stats": {
      "$ref": "#/$defs/Stats"
    },
    "universal": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "verdict": {
      "enum": [
        "complete",
        "timeout"
      ],
      "type": "string"
    },
    "verified": {
      "type": "boolean"
    }
  },
  "required": [
    "verdict",
    "verified",
    "stats"
  ],
  "type": "object"
}
```

## check_schema_compat

POST /v1/check/schema-compat. MCP: check_schema_compat. Send old_schema, new_schema and optional timeout_ms (100..5000, default 3000). No API key or account required. Zero-logging execution.

### Directions and results

Backward: every payload accepted by old_schema is accepted by new_schema. Forward: every payload accepted by new_schema is accepted by old_schema. These definitions describe accepted data languages; choose the direction for your producer or consumer role.

verdict=complete and verified=true returns backward_compatible and forward_compatible. Each false flag has a corresponding backward_counterexample or forward_counterexample wrapper: {payload: <JSON value>}. A null payload is a concrete example. A null wrapper means no counterexample. Both true means equivalent, including two empty languages.

### Supported schemas

Draft 2020-12 validation semantics for boolean schemas and these keywords only: type, enum, minimum, maximum, exclusiveMinimum, exclusiveMaximum, pattern, properties, required, additionalProperties, anyOf, oneOf. type is a supported name or unique nonempty list: null, boolean, integer, number, string, object. Integer-valued numbers satisfy integer; booleans are distinct from numbers. enum has 1..64 unique primitive values; numeric 1 and 1.0 are equal.

Objects support nested schemas, optional or required properties, required names without property declarations, and boolean or schema-valued additionalProperties (default true). Keywords constrain only their applicable types; properties without type does not require an object. anyOf accepts at least one branch; oneOf accepts exactly one, including overlaps. Sibling keywords are conjunctive.

All unknown keywords are rejected with UNSUPPORTED_FEATURE, including annotations, $schema, $ref, allOf, not, const, array constraints, formats and unevaluatedProperties. No network references are resolved. Unconstrained schemas can still accept all JSON values, including arrays, which this subset cannot inspect.

### String patterns

Patterns use search semantics over full Unicode payload strings, with ASCII pattern syntax: literals, escaped punctuation, explicit character ranges/classes and their negations, dot (except newline), groups, non-capturing groups, alternation and regular quantifiers *, +, ?, {m}, {m,}, {m,n}; lazy suffixes preserve the language. Boundary ^ and $ are allowed; $ also matches before a final newline. Use ^(?:a|b)$ for anchored alternation.

Unsupported: character class escapes such as backslash-d, backslash-w and backslash-s or their uppercase complements (use explicit ranges), internal anchors, anchored top-level alternation, backreferences, lookarounds, inline flags, atomic groups and possessive quantifiers. Empty pattern accepts every string. This intentionally narrow regex dialect is separate from analyze_regex's full-string ASCII domain.

### Schema verification and limits

Exact bottom-up semantic partitions cover every type and object shape. The existing symbolic solver exhausts numeric and object membership vectors; the existing position automaton exhausts string-language products. Unnamed properties are partitioned by value membership; several extra properties may be necessary to falsify different union branches. These are exhaustive abstractions, not bounded payload samples.

Every returned concrete payload is serialized and independently validated against both original schemas by a Draft 2020-12 validator. Its pattern keyword uses the separate Thompson automaton compiler and lockstep membership; no backtracking engine is invoked. Any mismatch returns INTERNAL_ERROR without findings. Compatibility proofs rely on partition construction and solver exhaustion; witness validation does not independently prove negative claims.

Combined schemas: <=128 nodes, depth <=12; <=64 properties and required names per node (names <=128 characters), <=64 distinct names per object level; anyOf/oneOf 1..16 branches. Names and enum strings must contain Unicode scalar values. Primitive numeric constants are finite within -1000000000..1000000000; enum strings <=256 characters. Numeric solving is exact rational arithmetic; a witness that cannot be represented safely as a finite JSON number produces unknown.

Patterns <=1024 characters, <=512 syntax nodes, depth <=32, repeat bounds <=64, <=2048 expanded positions and <=8192 expanded nodes. String product <=16384 states, Unicode enum character set <=128 representatives including one other character; semantic partitions <=1024 classes, total work <=200000 steps; returned strings <=16384 characters. Exceeding a cap returns RESOURCE_LIMIT_EXCEEDED without partial findings.

One timeout_ms budget covers analysis and independent validation. timeout or unknown has verified=false, null compatibility flags and no counterexamples. The supervisor kills and reaps at timeout_ms +500 ms. Same isolated no-egress worker, three compute slots, payment gate, 65536-byte request and 262144-byte response caps, including MCP wrapping. Aggregate telemetry contains only bounded labels; no schemas, property names or payloads are retained. Errors contain only static reasons and index paths.

MCP reference: oracle://docs/schema-compat. Prompt: check_schema_compat(). Verified examples: oracle://examples.

### check_schema_compat request

```json
{
  "additionalProperties": false,
  "properties": {
    "new_schema": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "old_schema": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "timeout_ms": {
      "default": 3000,
      "maximum": 5000,
      "minimum": 100,
      "type": "integer"
    }
  },
  "required": [
    "old_schema",
    "new_schema"
  ],
  "type": "object"
}
```

### check_schema_compat response

```json
{
  "$defs": {
    "JsonValue": {},
    "SchemaCounterexample": {
      "additionalProperties": false,
      "properties": {
        "payload": {
          "$ref": "#/$defs/JsonValue"
        }
      },
      "required": [
        "payload"
      ],
      "type": "object"
    },
    "Stats": {
      "additionalProperties": false,
      "properties": {
        "elapsed_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "timed_out": {
          "type": "boolean"
        }
      },
      "required": [
        "elapsed_ms",
        "timed_out"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "backward_compatible": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "backward_counterexample": {
      "anyOf": [
        {
          "$ref": "#/$defs/SchemaCounterexample"
        },
        {
          "type": "null"
        }
      ]
    },
    "forward_compatible": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "forward_counterexample": {
      "anyOf": [
        {
          "$ref": "#/$defs/SchemaCounterexample"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "$ref": "#/$defs/Stats"
    },
    "verdict": {
      "enum": [
        "complete",
        "timeout",
        "unknown"
      ],
      "type": "string"
    },
    "verified": {
      "type": "boolean"
    }
  },
  "required": [
    "verdict",
    "verified",
    "stats"
  ],
  "type": "object"
}
```

## rules-rbac-gap-overlap

- [Verified JSON](https://oracles.burgeonads.com/examples/rules-rbac-gap-overlap.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/analyze/rules -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"role","type":"enum","values":["guest","editor","auditor"]},{"name":"active","type":"bool"}],"rules":[{"id":"active_editor","when":{"op":"and","args":[{"op":"eq","var":"role","value":"editor"},{"op":"eq","var":"active","value":true}]},"action":"allow"},{"id":"editor","when":{"op":"eq","var":"role","value":"editor"},"action":"deny"},{"id":"guest","when":{"op":"eq","var":"role","value":"guest"},"action":"deny"}]}'
```

## rules-semantic-diff

- [Verified JSON](https://oracles.burgeonads.com/examples/rules-semantic-diff.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/analyze/rules -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"amount","type":"int","min":0,"max":2}],"rules":[{"id":"small","when":{"op":"le","var":"amount","value":1},"action":"allow"}],"default_action":"deny","compare_rules":[{"id":"small_v2","when":{"op":"lt","var":"amount","value":1},"action":"allow"}],"compare_default_action":"deny"}'
```

## fsm-lock-deadlock

- [Verified JSON](https://oracles.burgeonads.com/examples/fsm-lock-deadlock.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/verify/state-machine -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"lock_a","type":"enum","values":["free","p","q"]},{"name":"lock_b","type":"enum","values":["free","p","q"]},{"name":"p","type":"enum","values":["start","holding","done"]},{"name":"q","type":"enum","values":["start","holding","done"]}],"initial":{"lock_a":"free","lock_b":"free","p":"start","q":"start"},"transitions":[{"name":"p_take_a","guard":{"op":"and","args":[{"op":"eq","var":"p","value":"start"},{"op":"eq","var":"lock_a","value":"free"}]},"updates":{"p":{"op":"const","value":"holding"},"lock_a":{"op":"const","value":"p"}}},{"name":"q_take_b","guard":{"op":"and","args":[{"op":"eq","var":"q","value":"start"},{"op":"eq","var":"lock_b","value":"free"}]},"updates":{"q":{"op":"const","value":"holding"},"lock_b":{"op":"const","value":"q"}}},{"name":"p_take_b","guard":{"op":"and","args":[{"op":"eq","var":"p","value":"holding"},{"op":"eq","var":"lock_b","value":"free"}]},"updates":{"p":{"op":"const","value":"done"},"lock_a":{"op":"const","value":"free"}}},{"name":"q_take_a","guard":{"op":"and","args":[{"op":"eq","var":"q","value":"holding"},{"op":"eq","var":"lock_a","value":"free"}]},"updates":{"q":{"op":"const","value":"done"},"lock_b":{"op":"const","value":"free"}}}],"terminal_condition":{"op":"and","args":[{"op":"eq","var":"p","value":"done"},{"op":"eq","var":"q","value":"done"}]},"reachability":[{"name":"completed","expr":{"op":"and","args":[{"op":"eq","var":"p","value":"done"},{"op":"eq","var":"q","value":"done"}]}}]}'
```

## fsm-order-lifecycle-safe

- [Verified JSON](https://oracles.burgeonads.com/examples/fsm-order-lifecycle-safe.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/verify/state-machine -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"phase","type":"enum","values":["new","paid","shipped","cancelled"]}],"initial":{"phase":"new"},"transitions":[{"name":"pay","guard":{"op":"eq","var":"phase","value":"new"},"updates":{"phase":{"op":"const","value":"paid"}}},{"name":"cancel","guard":{"op":"eq","var":"phase","value":"new"},"updates":{"phase":{"op":"const","value":"cancelled"}}},{"name":"ship","guard":{"op":"eq","var":"phase","value":"paid"},"updates":{"phase":{"op":"const","value":"shipped"}}},{"name":"retry_payment","guard":{"op":"eq","var":"phase","value":"paid"},"updates":{"phase":{"op":"const","value":"paid"}}},{"name":"cancel_after_ship","guard":{"op":"and","args":[{"op":"eq","var":"phase","value":"new"},{"op":"eq","var":"phase","value":"shipped"}]},"updates":{}}],"invariants":[{"name":"valid_phase","expr":{"op":"in","var":"phase","values":["new","paid","shipped","cancelled"]}}],"terminal_condition":{"op":"in","var":"phase","values":["shipped","cancelled"]},"reachability":[{"name":"settled","expr":{"op":"eq","var":"phase","value":"shipped"}}]}'
```

## rules-variable-comparison

- [Verified JSON](https://oracles.burgeonads.com/examples/rules-variable-comparison.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/analyze/rules -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"requested","type":"int","min":0,"max":5},{"name":"limit","type":"int","min":0,"max":5},{"name":"owner","type":"enum","values":["ana","bo","cy"]},{"name":"caller","type":"enum","values":["ana","bo","cy"]}],"rules":[{"id":"own_within_limit","action":"allow","when":{"op":"and","args":[{"op":"eq","var":"caller","value":{"var":"owner"}},{"op":"le","var":"requested","value":{"var":"limit"}}]}},{"id":"over_limit","action":"deny","when":{"op":"gt","var":"requested","value":{"var":"limit"}}}],"default_action":null,"compare_rules":null,"max_witnesses":null,"timeout_ms":null}'
```

## fsm-retry-livelock

- [Verified JSON](https://oracles.burgeonads.com/examples/fsm-retry-livelock.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/verify/state-machine -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"phase","type":"enum","values":["idle","sending","acked","failed"]},{"name":"tries","type":"int","min":0,"max":2}],"initial":{"phase":"idle","tries":0},"initial_states":null,"transitions":[{"name":"send","guard":{"op":"eq","var":"phase","value":"idle"},"updates":{"phase":{"op":"const","value":"sending"}}},{"name":"retry","guard":{"op":"eq","var":"phase","value":"sending"},"updates":{"tries":{"op":"clamp","arg":{"op":"add","left":{"op":"var","var":"tries"},"right":{"op":"const","value":1}},"min":0,"max":2}}},{"name":"ack","guard":{"op":"eq","var":"phase","value":"sending"},"updates":{"phase":{"op":"const","value":"acked"}}},{"name":"give_up","guard":{"op":"and","args":[{"op":"eq","var":"phase","value":"sending"},{"op":"eq","var":"tries","value":2}]},"updates":{"phase":{"op":"const","value":"failed"}}}],"terminal_condition":{"op":"in","var":"phase","values":["acked","failed"]},"check_livelocks":true,"reachability":null}'
```

## fsm-bounded-retry-progress

- [Verified JSON](https://oracles.burgeonads.com/examples/fsm-bounded-retry-progress.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/verify/state-machine -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"phase","type":"enum","values":["idle","sending","acked","failed"]},{"name":"tries","type":"int","min":0,"max":2}],"initial":{"phase":"idle","tries":0},"initial_states":null,"transitions":[{"name":"send","guard":{"op":"eq","var":"phase","value":"idle"},"updates":{"phase":{"op":"const","value":"sending"}}},{"name":"retry","guard":{"op":"and","args":[{"op":"eq","var":"phase","value":"sending"},{"op":"lt","var":"tries","value":2}]},"updates":{"tries":{"op":"add","left":{"op":"var","var":"tries"},"right":{"op":"const","value":1}}}},{"name":"ack","guard":{"op":"eq","var":"phase","value":"sending"},"updates":{"phase":{"op":"const","value":"acked"}}},{"name":"give_up","guard":{"op":"and","args":[{"op":"eq","var":"phase","value":"sending"},{"op":"eq","var":"tries","value":2}]},"updates":{"phase":{"op":"const","value":"failed"}}}],"terminal_condition":{"op":"in","var":"phase","values":["acked","failed"]},"check_livelocks":true,"reachability":null}'
```

## regex-diff-witness

- [Verified JSON](https://oracles.burgeonads.com/examples/regex-diff-witness.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/analyze/regex -H 'Content-Type: application/json' --data-raw '{"pattern":"a(b|c)","compare_pattern":"(ab|b)"}'
```

## regex-redos-ambiguity

- [Verified JSON](https://oracles.burgeonads.com/examples/regex-redos-ambiguity.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/analyze/regex -H 'Content-Type: application/json' --data-raw '{"pattern":"(a+)+"}'
```

## schema-required-property

- [Verified JSON](https://oracles.burgeonads.com/examples/schema-required-property.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/check/schema-compat -H 'Content-Type: application/json' --data-raw '{"old_schema":{"type":"object","properties":{"id":{"type":"integer"}}},"new_schema":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]}}'
```

## schema-regex-widening

- [Verified JSON](https://oracles.burgeonads.com/examples/schema-regex-widening.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/check/schema-compat -H 'Content-Type: application/json' --data-raw '{"old_schema":{"type":"string","pattern":"^[a-z]+$"},"new_schema":{"type":"string","pattern":"^[a-z0-9]+$"}}'
```

## schema-exclusive-union

- [Verified JSON](https://oracles.burgeonads.com/examples/schema-exclusive-union.json)

```sh
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/check/schema-compat -H 'Content-Type: application/json' --data-raw '{"old_schema":{"anyOf":[{"type":"integer"},{"type":"number","minimum":0}]},"new_schema":{"oneOf":[{"type":"integer"},{"type":"number","minimum":0}]}}'
```

Deterministic solver service. Outputs provided as-is without warranty. No accounts, no API keys, no visitor logging, no solver payload retention.
