--  Ada.Numerics.Big_Numbers.Big_Reals (RM A.5.7), for specifications. As Big_Integers, the
--  package is ghost: Big_Real values appear in contracts, assertions and ghost code, are
--  reasoned about as the rational numbers (a Real sort in the solver), are exact in the
--  interpreter, and are erased from the generated code.
with Ada.Numerics.Big_Numbers.Big_Integers; use Ada.Numerics.Big_Numbers.Big_Integers;

package Ada.Numerics.Big_Numbers.Big_Reals
  with Ghost
is
   type Big_Real is private;

   function To_Big_Real (Arg : Big_Integer) return Big_Real
     with Global => null;

   --  the quotient Num / Den, exactly
   function "/" (Num, Den : Big_Integer) return Big_Real
     with Global => null, Pre => Den /= To_Big_Integer (0);

   function In_Range (Arg, Low, High : Big_Real) return Boolean
     with Global => null;

   function "=" (L, R : Big_Real) return Boolean with Global => null;
   function "<" (L, R : Big_Real) return Boolean with Global => null;
   function "<=" (L, R : Big_Real) return Boolean with Global => null;
   function ">" (L, R : Big_Real) return Boolean with Global => null;
   function ">=" (L, R : Big_Real) return Boolean with Global => null;

   function "-" (L : Big_Real) return Big_Real with Global => null;
   function "abs" (L : Big_Real) return Big_Real with Global => null;
   function "+" (L, R : Big_Real) return Big_Real with Global => null;
   function "-" (L, R : Big_Real) return Big_Real with Global => null;
   function "*" (L, R : Big_Real) return Big_Real with Global => null;
   function "/" (L, R : Big_Real) return Big_Real
     with Global => null, Pre => R /= To_Big_Real (To_Big_Integer (0));
   function "**" (L : Big_Real; R : Integer) return Big_Real
     with Global => null, Pre => R >= 0;   --  (Verada: non-negative powers only)

   function Min (L, R : Big_Real) return Big_Real with Global => null;
   function Max (L, R : Big_Real) return Big_Real with Global => null;
private
   --  the model is the rational numbers; Verada's prover and interpreter know these
   --  operations, and no code is generated for them
   type Big_Real is null record;
end Ada.Numerics.Big_Numbers.Big_Reals;
