FindInstance
n instances of vars that make expr true, over domain -- scoped to a provably correct core rather than Wolfram's full solver.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
FindInstance!FindInstance(expr, vars)one instance of vars satisfying expr. Declined here -- the unstated domain is Wolfram's Complexes, outside this scope. See below.FindInstance(expr, vars, domain)one instance over domain, which must be Reals or Integers.FindInstance(expr, vars, domain, n)up to n instances over domain.Typed signatures
| Type | Package | Applies |
|---|---|---|
(expression, list<symbol> | symbol, symbol?, integer<1..>?) -> expression | analytic | always |
Details
- Three provably correct paths, tried in order: a univariate polynomial equation of degree <= 2 with exact integer coefficients, solved by our own quadratic formula -- a COMPLETE real-root enumeration, so when every root fails the rest of the constraints, the conjunction is genuinely infeasible; failing that, compute-engine's Solve as a best-effort finder for equations it happens to solve (never trusted to prove absence); and a bounded integer search, brute-forced over a box whose edges every variable's simple inequalities in expr imply directly.
- Every candidate is re-substituted into every original constraint and re-evaluated before being returned -- the actual safety net, independent of which path produced it.
- An empty result ([]) is only ever returned when infeasibility is proven -- the quadratic route's complete root set, or the bounded search's exhaustive box -- never merely because nothing was found.
- Declines (leaves the call unevaluated) on: the unstated default domain (Complexes); any domain but Reals or Integers; more than one variable without a bounded Integers search; a pure inequality over Reals (no equation, so no provable witness); Or; and an integer search whose bounds are not directly implied by expr's own inequalities.
- Matches Wolfram''s output shape -- a list of rule lists,
{{x -> 1}}-- via Rule.
Examples
Basic #
Scope #
A bounded integer search -- no equation needed, just inequalities that imply a finite range
live ↗InOut
Possible issues #
Declines without an explicit domain -- the unstated default is Complexes, outside this scope
live ↗InOut
Declines on a pure inequality over Reals -- infinitely many witnesses and no provable canonical one
live ↗InOut
About
| Examples | 11 |
|---|---|
| Checked against | Wolfram Language 5 agree6 differ |
| Crosswalk | Wolfram Language |
See also: Solve, Rule, Inequality