library colibrilib.dv — module RealFactsFacts about the product and the rounding of the reals
module RealFacts223use int.Int224use real.RealInfix225use real.FromInt226use real.Truncate227Valid (19ms) (colibri2)228let ghost mul_nonneg (a b:real) : unit229requires { 0.0 <=. a /\ 0.0 <=. b }230ensures { 0.0 <=. a *. b }231= ()232Valid (14ms) (colibri2)233let ghost mul_pos (a b:real) : unit234requires { 0.0 <. a /\ 0.0 <. b }235ensures { 0.0 <. a *. b }236= ()237Valid (30ms) (colibri2)238let ghost floor_shift (x:real) (n:int) : unit239ensures { floor (x +. from_int n) = floor x + n }240= {proof…} assert { from_int n +. from_int (floor x) = from_int (n + floor x) };241assert { from_int (floor x + n) <=. x +. from_int n <. from_int (floor x + n + 1) };242assert { floor (x +. from_int n) = floor x + n243by from_int (floor (x +. from_int n)) <=. x +. from_int n <. from_int (floor (x +. from_int n) + 1) } {qed}244Valid (29ms) (colibri2)245let ghost ceil_shift (x:real) (n:int) : unit246ensures { ceil (x +. from_int n) = ceil x + n }247= {proof…} assert { from_int n +. from_int (ceil x) = from_int (n + ceil x) };248assert { from_int (ceil x + n - 1) <. x +. from_int n <=. from_int (ceil x + n) };249assert { ceil (x +. from_int n) = ceil x + n250by from_int (ceil (x +. from_int n) - 1) <. x +. from_int n <=. from_int (ceil (x +. from_int n)) } {qed}251end252