35 val less_cancel_numeral_factor: Proof.context -> cterm -> thm option |
35 val less_cancel_numeral_factor: Proof.context -> cterm -> thm option |
36 val le_cancel_numeral_factor: Proof.context -> cterm -> thm option |
36 val le_cancel_numeral_factor: Proof.context -> cterm -> thm option |
37 val div_cancel_numeral_factor: Proof.context -> cterm -> thm option |
37 val div_cancel_numeral_factor: Proof.context -> cterm -> thm option |
38 val divide_cancel_numeral_factor: Proof.context -> cterm -> thm option |
38 val divide_cancel_numeral_factor: Proof.context -> cterm -> thm option |
39 val field_combine_numerals: Proof.context -> cterm -> thm option |
39 val field_combine_numerals: Proof.context -> cterm -> thm option |
40 val field_cancel_numeral_factors: simproc list |
40 val field_divide_cancel_numeral_factor: simproc list |
41 val num_ss: simpset |
41 val num_ss: simpset |
42 val field_comp_conv: Proof.context -> conv |
42 val field_comp_conv: Proof.context -> conv |
43 end; |
43 end; |
44 |
44 |
45 structure Numeral_Simprocs : NUMERAL_SIMPROCS = |
45 structure Numeral_Simprocs : NUMERAL_SIMPROCS = |
444 fun less_cancel_numeral_factor ctxt ct = LessCancelNumeralFactor.proc ctxt (term_of ct) |
444 fun less_cancel_numeral_factor ctxt ct = LessCancelNumeralFactor.proc ctxt (term_of ct) |
445 fun le_cancel_numeral_factor ctxt ct = LeCancelNumeralFactor.proc ctxt (term_of ct) |
445 fun le_cancel_numeral_factor ctxt ct = LeCancelNumeralFactor.proc ctxt (term_of ct) |
446 fun div_cancel_numeral_factor ctxt ct = DivCancelNumeralFactor.proc ctxt (term_of ct) |
446 fun div_cancel_numeral_factor ctxt ct = DivCancelNumeralFactor.proc ctxt (term_of ct) |
447 fun divide_cancel_numeral_factor ctxt ct = DivideCancelNumeralFactor.proc ctxt (term_of ct) |
447 fun divide_cancel_numeral_factor ctxt ct = DivideCancelNumeralFactor.proc ctxt (term_of ct) |
448 |
448 |
449 val field_cancel_numeral_factors = |
449 val field_divide_cancel_numeral_factor = |
450 map (prep_simproc @{theory}) |
450 [prep_simproc @{theory} |
451 [("field_eq_cancel_numeral_factor", |
451 ("field_divide_cancel_numeral_factor", |
452 ["(l::'a::field) * m = n", |
|
453 "(l::'a::field) = m * n"], |
|
454 EqCancelNumeralFactor.proc), |
|
455 ("field_cancel_numeral_factor", |
|
456 ["((l::'a::field_inverse_zero) * m) / n", |
452 ["((l::'a::field_inverse_zero) * m) / n", |
457 "(l::'a::field_inverse_zero) / (m * n)", |
453 "(l::'a::field_inverse_zero) / (m * n)", |
458 "((numeral v)::'a::field_inverse_zero) / (numeral w)", |
454 "((numeral v)::'a::field_inverse_zero) / (numeral w)", |
459 "((numeral v)::'a::field_inverse_zero) / (- numeral w)", |
455 "((numeral v)::'a::field_inverse_zero) / (- numeral w)", |
460 "((- numeral v)::'a::field_inverse_zero) / (numeral w)", |
456 "((- numeral v)::'a::field_inverse_zero) / (numeral w)", |
461 "((- numeral v)::'a::field_inverse_zero) / (- numeral w)"], |
457 "((- numeral v)::'a::field_inverse_zero) / (- numeral w)"], |
462 DivideCancelNumeralFactor.proc)] |
458 DivideCancelNumeralFactor.proc)]; |
|
459 |
|
460 val field_cancel_numeral_factors = |
|
461 prep_simproc @{theory} |
|
462 ("field_eq_cancel_numeral_factor", |
|
463 ["(l::'a::field) * m = n", |
|
464 "(l::'a::field) = m * n"], |
|
465 EqCancelNumeralFactor.proc) |
|
466 :: field_divide_cancel_numeral_factor; |
463 |
467 |
464 |
468 |
465 (** Declarations for ExtractCommonTerm **) |
469 (** Declarations for ExtractCommonTerm **) |
466 |
470 |
467 (*Find first term that matches u*) |
471 (*Find first term that matches u*) |