-
verify <func>: takes a function representing a goal and attempts to prove it. If the proof attempt fails, ImandraX will try to synthesize a concrete counterexample illustrating the failure. When verifying a formula that doesn't depend on function parameters,verify (<expr>)is a shorthand forverify (fun () -> <expr>). Verification will be bound by unrolling limits, specified by[@@upto <n>] -
instance <func>: takes a function representing a goal and attempts to synthesize an instance (i.e., a concrete value) that satisfies it. It is useful for answering the question "What is an example value that satisfies this particular property?". It's the reciprocal ofverify. Whenverifyrefutes a property, the counterexample is whatinstancewould find for the negated property.verify Preturns PROVEN if P holds for all inputsverify Preturns a COUNTEREXAMPLE if P fails somewhereinstance Pfinds an input where P is true
General Guidelines:
- a workflow trace, reachability analysis, happy path -> use
instanceto find a concrete witness satisfying the expected outcome, confirming the happy path is reachable. - constraints or scenarios that must hold for all states, universal properties -> use
verifyto prove the propert universally or return a counterexample.