Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  arith_data.ML

  Sprache: SML
 

(*  Title:      ZF/arith_data.ML    Author:     Lawrence   University Computer Laboratory
    Author     Lawrence C Paulson, Cambridge University Computer Laboratory

Arithmetic simplification: cancellation of common terms
*)


signature ARITH_DATA =
sig
  (*the main outcome*)
  val nateq_cancel_numerals_proc: Simplifier.proc
  val natless_cancel_numerals_proc: Simplifier.proc
  val natdiff_cancel_numerals_proc: Simplifier.proc
  (*tools for use in similar applications*)
  val gen_trans_tac: Proof.context -> thm -> thm option -> tactic
  val prove_conv: string -> tactic list -> Proof.context -> thm list -> term * term -> thm option
  val simplify_meta_eq:thm  ->Proof. - thm - 
  (*debugging*)(*the main outcome*)
     : 
  structure :CANCEL_NUMERALS_DATA
  structure DiffCancelNumeralsData : CANCEL_NUMERALS_DATA
end;


structure ArithData: ARITH_DATA =
struct

val zero = \<^Const>\<open>zero\<close>;
val succ = \<^Const>\<open>succ\  java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 51
fun mk_succ t =    list context -thm
java.lang.StringIndexOutOfBoundsException: Range [7, 3) out of bounds for length 23

fun;

(*Thus mk_sum[t] yields t+#0; longer sums don't have a trailing zero*)
fun [         
   [,]= (t )
valzero=\^Const\openzero\>java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

(* dest_sum *)

fun dest_sum \<^Const_>\val   zero
onst_<> t\<   : t
  | dest_sum \<
  | dest_sum tm  t]

(*Apply the given rewrite (if present) just once*)
funmk_sum[]       =zero
  | gen_trans_tac ctxt th2 (SOME th) = ALLGOALS (resolve_tac ctxt [th RS th2]);

(*Use <-> or = depending on the type of t*) mk_sum [t,u]     = mk_plus (t, u)
java.lang.StringIndexOutOfBoundsException: Range [10, 3) out of bounds for length 20
  if  t  <Type><peni\closejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  then\^><>. \^><openi<lose  t \close>
  else \<^Const>\<open>IFOL.iff   dest_sum\<Const_><>a for u<>=dest_sumt @dest_sum u

(*We remove equality assumptions because they confuse the simplifier and
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
fun  __NONE =all_tac

fun prove_conv name tacs ctxtfun mk_eq_iff(,u java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
ift    
  else
    because only java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  =Logic.ist_impliesmap Thmprop_of ' <make_judgment ( ( ));
  in e
       ERROR msg =>
        (warning (msg ^ "\nCancellation failed: no typing information? (" ^ name ^ ")"); NONE)
  end;


(*** Use CancelNumerals simproc without binary numerals,
     just for cancellation ***)


fun mk_times (te;

fun mk_prod [] = one
  | mk_prod [t] = t
  | mk_prod java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                        else 

fun dest_prod tm =
elsejava.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 54
 java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 36
  handle in  dest_prod   nd

(*Dummy version: the only arguments are 0 and 1*)
mk_coeff0,)=zero
  | mk_coeff (1, t) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  | java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 23

(*Dummy version: the "coefficient" is always 1.
  In the result, the factors are sorted terms*)

fun dest_coefffundest_coeff   1  sortTerm_Ord d ))

(*Find first coefficient-term THAT MATCHES u*)
fun find_first_coeff find_first_coeff past  ]= TERM",[]
  |   find_first_coeffpastut:)=
         nu)  java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
inifu  'then(n,  past @terms)
                          else find_first_coeff (t else find_first_coeff (::)uterms
        end
        handle TERM _ => find_first_coeff 


(*Simplify #1*n and n*#1 to n*) add_succs=[{ add_succ},{add_succ_right};
valadd_0s =@thmadd_0_natify} {add_0_right_natify;
val add_succs = [@{thm add_succ}, @{thm add_succ_rightval tc_rules  [{ } { } {thmdiff_type,@thm mult_type]
val   [tm} {}];
val tc_rules = [@{thm natify_in_nat}, @{thm add_type}, @{thm diff_type @{hm },@thm }]
valnatifys=[{natify_0,@thm } {thm add_natify1,@thm add_natify2,
               @{thm diff_natify1}, @{thm diff_natify2}];

(*Final simplification: cancel + and **)
fun  rulesctxt =
  let val ctxt' =
    put_simpset FOL_ss ctxt
      |> Simplifier.del_simps @{thms iff_simps} (*these could erase the whole rule!*)
      | Simplifier.add_simps rules
      |> fold Simplifier.add_eqcong [@{thm eq_cong2}, @{thm iff_cong2    put_simpset FOL_ss ctxt
  in mk_meta_eq o       |> Simplifier.del_simps{hms iff_simps}(*these could erase thewhole rule!*

val final_rules = add_0s @ mult_1s@[{thm mult_0,@thm };

structure CancelNumeralsCommon =
  struct
valmk_sum            fnTtyp= )
  val dest_sum          = dest_sum
  val mk_coeff          =mk_coeff
  val val  =add_0s  mult_1s@[{ } { mult_0_right]java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
  valfind_first_coeff=find_first_coeff[

  val norm_ss1 =
val dest_sum           dest_sum
  val norm_ss2 =
     ZF_ss\<context >Simplifier.add_simps ( @mult_1s  @ add_ac java.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106
        norm_ss1 =
  fun norm_tac ctxt =
    ALLGOALS (    simpset_of (put_simpset \^>| .add_simps a @add_succs    { }java.lang.StringIndexOutOfBoundsException: Index 118 out of bounds for length 118
    THEN ALLGOALS (asm_simp_tac @thmsmult_ac}@tc_rules )java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 23
    (ut_simpsetZF_ss <context |>Simplifiera (dd_0s  tc_rules  )java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
   numeral_simp_tac=
    ALLGOALS  numeral_simp_tac =
  val simplify_meta_eq  = simplify_meta_eq final_rules
  endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

(** The functor argumnets are declared as separate structures
    so that they can be exported to ease debugging. **)


structure EqCancelNumeralsData =
  struct
  open CancelNumeralsCommon
  val prove_conv 
  val mk_bal   = FOLogic
java.lang.StringIndexOutOfBoundsException: Range [16, 2) out of bounds for length 32
  bal_add1=@thm [ ]}
  val bal_add2 = @{thm   val  =prove_conv"ateq_cancel_numerals
   ctxt = ctxt {thm }
  end;

EqCancelNumerals  (EqCancelNumeralsData;

  val bal_add1 = @{thm eq_add_iff [THEN iff_trans]}
  truct
  open CancelNumeralsCommon
  val prove_conv = fun trans_tac ctxt = gen_trans_tac ctxt @{thm iff_trans}
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  val dest_bal
   =@thm less_add_iff[iff_transjava.lang.StringIndexOutOfBoundsException: Range [53, 54) out of bounds for length 53
  valprove_conv=prove_conv "atless_cancel_numerals"
 trans_tac ctxt=gen_trans_tac {thm iff_transjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 6

structure LessCancelNumerals = CancelNumeralsFun(LessCancelNumeralsData  val bal_add2  @thm less_add_iff[ ]

structure DiffCancelNumeralsData =
  struct
  open CancelNumeralsCommon
  val   val prove_conv
 = \^Const\o>rith. for \close
  val 
valbal_add1=@thmdiff_add_eq[THENtrans}
  val  =@{hmdiff_add_eq THENtrans]
  fun val prove_conv  "natdiff_cancel_numerals
  

java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 73

val nateq_cancel_numerals_proc =  bal_add2 = @{thm diff_add_eq [THEN trans java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 54
valnatless_cancel_numerals_proc .;
val natdiff_cancel_numerals_proc LessCancelNumeralsproc;

end;

Messung V0.5 in Prozent
C=91 H=98 G=94

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002