src/HOL/Matrix_LP/fspmlp.ML
changeset 69597 ff784d5a5bfb
parent 47455 26315a545e26
equal deleted inserted replaced
69596:c8a2755bf220 69597:ff784d5a5bfb
   180         if b then propagate_sure_bounds safe names g else g
   180         if b then propagate_sure_bounds safe names g else g
   181     end
   181     end
   182 
   182 
   183 exception Load of string;
   183 exception Load of string;
   184 
   184 
   185 val empty_spvec = @{term "Nil :: real spvec"};
   185 val empty_spvec = \<^term>\<open>Nil :: real spvec\<close>;
   186 fun cons_spvec x xs = @{term "Cons :: nat * real => real spvec => real spvec"} $ x $ xs;
   186 fun cons_spvec x xs = \<^term>\<open>Cons :: nat * real => real spvec => real spvec\<close> $ x $ xs;
   187 val empty_spmat = @{term "Nil :: real spmat"};
   187 val empty_spmat = \<^term>\<open>Nil :: real spmat\<close>;
   188 fun cons_spmat x xs = @{term "Cons :: nat * real spvec => real spmat => real spmat"} $ x $ xs;
   188 fun cons_spmat x xs = \<^term>\<open>Cons :: nat * real spvec => real spmat => real spmat\<close> $ x $ xs;
   189 
   189 
   190 fun calcr safe_propagation xlen names prec A b =
   190 fun calcr safe_propagation xlen names prec A b =
   191     let
   191     let
   192         fun test_1 (lower, upper) =
   192         fun test_1 (lower, upper) =
   193             if lower = upper then
   193             if lower = upper then
   274                     val index = xlen-i
   274                     val index = xlen-i
   275                     val (r12_1, r12_2) = abs_estimate (i-1) r1 r2
   275                     val (r12_1, r12_2) = abs_estimate (i-1) r1 r2
   276                     val b1 = Inttab.lookup r1 index
   276                     val b1 = Inttab.lookup r1 index
   277                     val b2 = Inttab.lookup r2 index
   277                     val b2 = Inttab.lookup r2 index
   278                 in
   278                 in
   279                     (add_row_entry r12_1 index @{term "lbound :: real => real"} ((names index)^"l") b1, 
   279                     (add_row_entry r12_1 index \<^term>\<open>lbound :: real => real\<close> ((names index)^"l") b1, 
   280                      add_row_entry r12_2 index @{term "ubound :: real => real"} ((names index)^"u") b2)
   280                      add_row_entry r12_2 index \<^term>\<open>ubound :: real => real\<close> ((names index)^"u") b2)
   281                 end
   281                 end
   282 
   282 
   283         val (r1, r2) = abs_estimate xlen r1 r2
   283         val (r1, r2) = abs_estimate xlen r1 r2
   284 
   284 
   285     in
   285     in