theory P

  use real.Real

  goal x_mul_x_pos :
    forall x:real. x * x >= 0.0

  function sqr (x:real) : real = x * x

  goal sqr_pos :
    forall x:real. sqr x >= 0.0

end

theory P2

  use real.Real
  use real.Square

  goal sqr_pos :
    forall x:real. sqr x >= 0.0

end

theory P3

  use real.Real
  use real.Trigonometry

  (* unprovable without cos-constant.ax, which causes failures for more interesting goals *)
  goal cos_bound :
    forall x:real. -1.0 <= cos x <= 1.0

  goal cos_bound_harder :
    forall x:real. -0.7 <= x <= 0.7 -> 0.7 <= cos x <= 1.0


  use real.Abs

  goal MethodErrorOK: forall x:real. abs x <= 0x1p-5 ->
    abs (1.0 - 0.5 * (x * x) - cos x) <= 0x1p-24

  goal MethodErrorWrong: forall x:real. abs x <= 0x1p-5 ->
    abs (1.0 - 0.5 * (x * x) - cos x) <= 0x1p-25

end


theory Power

use real.RealInfix
use real.PowerReal

goal G: false

goal G1: forall x:real. x >. 2.0 -> (pow x 3.0) *. 2.0 >. 20.0

goal G2: forall x:real. x >. 2.0 -> x >. 5.0

end


theory PolyPaverExamples

  use real.Real
  use real.ExpLog

  goal g1: forall a b : real.
    -10.0 <= a <= 10.0 ->
    -10.0 <= b <= 10.0 ->
    b > a + 0.1 ->
    exp a - exp b > (b-a) * exp ((a + b) / 2.0)

end
