

(* Basic arithmetic operations - Level 1 (no dependencies) *)

(* Note: bad_function has non-terminating recursion when i > 0.
   Since it cannot terminate for i > 0, we cannot prove termination
   in the general case. The function is fundamentally non-terminating
   for positive inputs. *)
let rec bad_function (i : int) : LString.t =
  if i <= 0 then {l|ok|l} else bad_function (i + 1)

let add (a : real) (b : real) : real =
  a +. b

let subtract (a : real) (b : real) : real =
  a -. b

let multiply (a : real) (b : real) : real =
  a *. b

let divide (a : real) (b : real) : real option =
  if b = 0.0 then
    None
  else
    Some (a /. b)

let power : real -> real -> real = () [@@opaque]
