(* ====================================================================== *)
(*  Signs                                                                 *)
(* ====================================================================== *)
(* ---------------------------------------------------------------------- *)
(*  Datatype                                                              *)
(* ---------------------------------------------------------------------- *)
;
let SIGN_CASES = prove_by_refinement(
  `!s. (s = Pos) \/ (s = Neg) \/ (s = Zero) \/ (s = Nonzero) \/ (s = Unknown)`,
(* {{{ Proof *)
[
  MATCH_MP_TAC sign_INDUCT;
  REWRITE_TAC[];
]);;
 
let interpsign = new_recursive_definition sign_RECURSION
  `(interpsign set ply Zero = (!x:real. set x ==> (ply x = &0))) /\
   (interpsign set ply Pos  = (!x. set x ==> (ply x > &0))) /\
   (interpsign set ply Neg  = (!x. set x ==> (ply x < &0))) /\
   (interpsign set ply Nonzero  = (!x. set x ==> (ply x <> &0))) /\
   (interpsign set ply Unknown = (!x. set x ==> (ply x = ply x)))`;;
let interp_doub = prove(
  `interpsigns [p1] set [s1] ==> interpsigns pl set sl ==>
     interpsigns (CONS p1 pl) set (CONS s1 sl)`,
  ASM_MESON_TAC[interpsigns;
ALL2]);;