(*
   --------------------------------------------------------------------------
   title: Combining Verify and Instance
   description: Using both verify and instance together
   order: 6
   --------------------------------------------------------------------------

   Concept: Combining verify and instance

   Demonstrates using both `verify` (to prove properties) and `instance`
   (to find edge cases) together. Shows verification of mathematical properties
   (non-negative, idempotent) and finding a specific edge case.

   Expected:
   - Properties proven ✅
   - Instance found: `x = -15`

   ============================================================================ *)

let absolute (x : int) : int =
  if x >= 0 then x else -x

(* Verify: absolute value is always non-negative *)
verify (fun x -> absolute x >= 0)

(* Verify: absolute value is idempotent *)
verify (fun x -> absolute (absolute x) = absolute x)

(* Find a negative number with absolute value 15 *)
instance (fun x -> x < 0 && absolute x = 15)
