Commit 2325f49a by MARCHE Claude

### simple examples and tests

parent 5d5daeba
 theory CosineSingle use import real.Real use import real.Abs use import real.Trigonometry (* approximation of cosine function by 1 - x^2 / 2 on interval [-1/32; 1/32] *) lemma MethodError: forall x:real. abs x <= 0x1p-5 -> abs (1.0 - 0.5 * (x * x) - cos x) <= 0x1p-24 (* this one is proved in Coq + interval tactics *) end
 (* This file is generated by Why3's Coq driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.Rbasic_fun. Require Reals.R_sqrt. Require Reals.Rtrigo_def. Require Reals.Rtrigo1. Require Reals.Ratan. Require BuiltIn. Require real.Real. Require real.Abs. Require real.Square. Require real.Trigonometry. (* Why3 goal *) Theorem MethodError : forall (x:R), ((Reals.Rbasic_fun.Rabs x) <= (1 / 32)%R)%R -> ((Reals.Rbasic_fun.Rabs ((1%R - ((05 / 10)%R * (x * x)%R)%R)%R - (Reals.Rtrigo_def.cos x))%R) <= (1 / 16777216)%R)%R. intros x h1. Require Import Interval_tactic. Qed.

 theory T use import real.Real use import real.MinMax goal g: forall e p: real. (2.0 * e + p + max e p) / 4.0 = max ((e+p)/2.0) ((3.0*e+p)/4.0) end \ No newline at end of file

 /**************************************************************************/ /* */ /* The Why platform for program certification */ /* */ /* Copyright (C) 2002-2011 */ /* */ /* Jean-Christophe FILLIATRE, CNRS & Univ. Paris-sud 11 */ /* Claude MARCHE, INRIA & Univ. Paris-sud 11 */ /* Yannick MOY, Univ. Paris-sud 11 */ /* Romain BARDOU, Univ. Paris-sud 11 */ /* */ /* Secondary contributors: */ /* */ /* Thierry HUBERT, Univ. Paris-sud 11 (former Caduceus front-end) */ /* Nicolas ROUSSET, Univ. Paris-sud 11 (on Jessie & Krakatoa) */ /* Ali AYAD, CNRS & CEA Saclay (floating-point support) */ /* Sylvie BOLDO, INRIA (floating-point support) */ /* Jean-Francois COUCHOT, INRIA (sort encodings, hyps pruning) */ /* Mehdi DOGGUY, Univ. Paris-sud 11 (Why GUI) */ /* */ /* This software is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Lesser General Public */ /* License version 2.1, with the special exception on linking */ /* described in file LICENSE. */ /* */ /* This software 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. */ /* */ /**************************************************************************/ /*@ decreases 101-n ; @ behavior less_than_101: @ assumes n <= 100; @ ensures \result == 91; @ behavior greater_than_100: @ assumes n >= 101; @ ensures \result == n - 10; @*/ int f91(int n) { if (n <= 100) { return f91(f91(n + 11)); } else return n - 10; } /* Local Variables: compile-command: "make rec.why3ide" End: */