(**************************************************************************)
(*                                                                        *)
(*  This file is part of WP plug-in of Frama-C.                           *)
(*                                                                        *)
(*  Copyright (C) 2007-2015                                               *)
(*    CEA (Commissariat a l'energie atomique et aux energies              *)
(*         alternatives)                                                  *)
(*                                                                        *)
(*  you can redistribute it and/or modify it under the terms of the GNU   *)
(*  Lesser General Public License as published by the Free Software       *)
(*  Foundation, version 2.1.                                              *)
(*                                                                        *)
(*  It is distributed in the hope that it will be useful,                 *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
(*  GNU Lesser General Public License for more details.                   *)
(*                                                                        *)
(*  See the GNU Lesser General Public License version 2.1                 *)
(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
(*                                                                        *)
(**************************************************************************)

theory Cmath
use int.Int as Int
use int.Abs as Abs
use real.Real as Real
use real.Square as Square

axiom abs_def : forall x:int [Abs.abs x].
  if (Int.(>=) (x) (0)) then ((Abs.abs x) = (x)) else ((Abs.abs
  x) = ((Int.(-_) (x))))

axiom sqrt_lin1 : forall x:real [Square.sqrt x]. (Real.(<) (1.) (x)) ->
  (Real.(<) (Square.sqrt x) (x))

axiom sqrt_lin0 : forall x:real [Square.sqrt x]. (Real.(<) (0.) (x)) /\
  (Real.(<) (x) (1.)) -> (Real.(<) (x) (Square.sqrt x))

axiom sqrt_0 : ((Square.sqrt 0.) = (0.))

axiom sqrt_1 : ((Square.sqrt 1.) = (1.))

end
