src/HOL/Matrix/fspmlp.ML
changeset 15570 8d8c70b41bab
parent 15531 08c8dad8e399
equal deleted inserted replaced
15569:1b3115d1a8df 15570:8d8c70b41bab
   143 			      | SOME x => 
   143 			      | SOME x => 
   144 				(case get_sure_bound g src_key of
   144 				(case get_sure_bound g src_key of
   145 				     NONE => NONE
   145 				     NONE => NONE
   146 				   | SOME src_sure_bound => SOME (FloatArith.add x (mult_btype src_sure_bound coeff)))
   146 				   | SOME src_sure_bound => SOME (FloatArith.add x (mult_btype src_sure_bound coeff)))
   147 		    in
   147 		    in
   148 			case foldl add_src_bound (SOME row_bound, sources) of
   148 			case Library.foldl add_src_bound (SOME row_bound, sources) of
   149 			    NONE => sure_bound
   149 			    NONE => sure_bound
   150 			  | new_sure_bound as (SOME new_bound) => 
   150 			  | new_sure_bound as (SOME new_bound) => 
   151 			    (case sure_bound of 
   151 			    (case sure_bound of 
   152 				 NONE => new_sure_bound
   152 				 NONE => new_sure_bound
   153 			       | SOME old_bound => 
   153 			       | SOME old_bound => 
   232 						add_edge g (src_index, UPPER) dest_key row_index coeff
   232 						add_edge g (src_index, UPPER) dest_key row_index coeff
   233 					    else
   233 					    else
   234 						add_edge g (src_index, LOWER) dest_key row_index coeff
   234 						add_edge g (src_index, LOWER) dest_key row_index coeff
   235 					end
   235 					end
   236 			    in	    
   236 			    in	    
   237 				foldl fold_src_nodes ((add_row_bound g dest_key row_index row_bound), approx_a)
   237 				Library.foldl fold_src_nodes ((add_row_bound g dest_key row_index row_bound), approx_a)
   238 			    end
   238 			    end
   239 		    end
   239 		    end
   240 	    in
   240 	    in
   241 		case approx_a of
   241 		case approx_a of
   242 		    [] => g
   242 		    [] => g
   249 			else if atest = 1 then
   249 			else if atest = 1 then
   250 			    update_sure_bound g (u, UPPER) b2
   250 			    update_sure_bound g (u, UPPER) b2
   251 			else
   251 			else
   252 			    g
   252 			    g
   253 		    end
   253 		    end
   254 		  | _ => foldl fold_dest_nodes (g, approx_a)
   254 		  | _ => Library.foldl fold_dest_nodes (g, approx_a)
   255 	    end
   255 	    end
   256 	
   256 	
   257 	val g = FloatSparseMatrixBuilder.m_fold calcr VarGraph.empty A
   257 	val g = FloatSparseMatrixBuilder.m_fold calcr VarGraph.empty A
   258 	val g = propagate_sure_bounds safe_propagation names g
   258 	val g = propagate_sure_bounds safe_propagation names g
   259 
   259