src/HOL/Matrix/MatrixLP_gensimp.ML
author nipkow
Fri, 18 Feb 2005 15:20:27 +0100
changeset 15537 5538d3244b4d
parent 15178 5f621aa35c25
permissions -rw-r--r--
continued eliminating sumr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15178
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     1
open BasisLibrary;
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     2
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     3
use "Cplex.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     4
use "CplexMatrixConverter.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     5
use "ExactFloatingPoint.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     6
use "FloatArith.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     7
use "FloatSparseMatrixBuilder.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     8
use "fspmlp.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
     9
use "codegen_prep.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    10
use "eq_codegen.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    11
use "conv.ML";
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    12
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    13
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    14
val th = theory "MatrixLP"
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    15
val sg = sign_of th
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    16
	 
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    17
fun prep x = standard (mk_meta_eq x)
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    18
	     
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    19
fun inst_real thm = standard (Thm.instantiate ([(fst (hd (term_tvars (prop_of thm))),
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    20
						 ctyp_of sg HOLogic.realT)], []) thm);
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    21
    
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    22
val spm_lp_dual_estimate_simp = 
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    23
    (thms "Float.arith_no_let") @ 
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    24
    (map inst_real (thms "SparseMatrix.sparse_row_matrix_arith_simps")) @ 
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    25
    (thms "SparseMatrix.sorted_sp_simps") @ 
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    26
    [thm "Product_Type.fst_conv", thm "Product_Type.snd_conv"] @ 
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    27
    (thms "SparseMatrix.boolarith") 
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    28
    
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    29
val simp_with = Simplifier.simplify (HOL_basic_ss addsimps [thm "SparseMatrix.if_case_eq", thm "Float.norm_0_1"])
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    30
		
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    31
val spm_lp_dual_estimate_simp = map simp_with spm_lp_dual_estimate_simp
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    32
				
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    33
val geninput = codegen_prep.prepare_thms spm_lp_dual_estimate_simp
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    34
5f621aa35c25 Matrix theory, linear programming
obua
parents:
diff changeset
    35
val _ = SimprocsCodegen.use_simprocs_code sg geninput