I'm using the Approximation.thy from the Descision_Procs file for interval arithmetic in Isabelle. The file gives you a tactic for proving inequalities over the reals, such as:
theorem "3 ≤ x ∧ x ≤ 6 ⟹ sin ( pi / x) > 0.4" by (approximation 10)
Now, I'm interested in trying out the core function of the implementation which appears to be the approx function. This is described in section 4.5.2 of Proving Real-Valued Inequalities by Computation in Isabelle/HOL. Here are some of the statements that I do:
value "Float 3 (-1)"
value "approx 1 (Num (Float 3 (-2))) [Some (Float 1 0,Float 4 0)]"
value "approx 1 (Add (Num (Float 3 (-2))) (Num (Float 4 (-8)))) [Some (Float 1 0,Float 4 0)]"
value "approx 1 (Add (Var 1) (Num (Float 4 (-8)))) [Some (Float 1 0,Float 4 0)]"
First, I would ask if you know a more convinient way to write floats (instead of Float a b, maybe there is a function of the kind real_to_float r
). Then, you see that the function computes, given some precision (which I understand as the number of correct decimals), the upper and lower bounds for the operations given as a second parameter.
Now, the main question is the following:
What is the purpose of the last parameter? I guess they are confidence intervals for the variables in the second parameter?
The text claims that this function also implements interval arithmetic. Can you show an example where I can see how this functions performs interval addition for instance? ([a,b]+[c,d]=[a+c,b+d])