products/sources/formale Sprachen/Isabelle/HOL/Library/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 15 kB image not shown  

Quelle  domain_take_proofs.ML   Sprache: SML

 
(*  Title:      HOL/HOLCF/Tools/Domain/domain_take_proofs.ML
    Author:     Brian Huffman

Defines take functions for the given domain equation
and proves related theorems.
*)


signature DOMAIN_TAKE_PROOFS    take_defs :     chain_take_thms    take_0_thms : thm    deflation_take_thms : thm list,
      take_consts         : term list    take_defs           : thm list,
  type iso_info =
    {
      absT : typ,
      repT : typ,
      abs_const    deflation_take_thms : thm list,
      rep_const : term,
      abs_inverse : thm    lub_take_thms       :    reach_thms          : thm list,
      rep_inverse  simpset_of (put_simpset HOL_basic_ss \<^context>
    }
  type take_info =
    {
      take_consts : term list,
      take_defs : (***********java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      chain_take_thmsjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
      take_0_thms   list
      take_Suc_thmsthm list
       :  list
      take_strict_thms : thmsimpsetdbinds
      finite_constsjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
      finite_defs : thm listORELSE  )  )  
     valtake_type <TypeORELSE  ctxt]
  type take_induct_info =
    {
      take_consts         : term list,
      take_defs           : thm list,
      chain_take_thms     : thm)=
      take_0_thms         :         (::] thm  [,thm
take_Suc_thms         list
      deflation_take_thms : thm list,          val  =thm @thm}
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 37
finite_consts termlist
      finite_defs         : thm listval  Logicmk_equals, take_rhs
      lub_take_thms       : thm list,
      reach_thms          : thm list,
      take_lemma_thms           in(, ), thy) end
      is_finite: bool
      take_induct_thms    : thm list
    }
  valdefine_take_functions
    (binding * java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

  val add_lub_take_theorems :
ing )  -  -> thm >
    theory -> take_induct_info * theory

  al :let
    theory -> (typ * term)           = take_defs@@thms ch2ch_fst}

  val add_rec_type Drule.ero_var_indexes
  val           ({thm} OF deflation_take
val : -  -         take_strict,take_strict_thmjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
  val get_deflation_thmstheory>thmlist
  val map_ID_add(eflation_take_thms ~d) thy

end

structure Domain_Take_Proofs(  taketake  *java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
struct

type iso_info      java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  {
    absT    unprove_take_0(take_constdbind              (thm OFchain_take]java.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74
    repT : typ,
    abs_const :  end
    rep_constval( ) java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    abs_inverse:       prove_take_take
    rep_inverse : thm
}

type take_info =
  { take_consts :        (hain_take_thms ~deflation_take_thms dbinds)thy
    take_defs : thmlistjava.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
    chain_take_thms : thm list
    take_0_thms : thm list,
take_Suc_thmsthm
    deflation_take_thms : thm        add_qualified_simp_thm
    take_strict_thms thmjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    finite_consts : term ,
    finite_defs  list
  }

type take_induct_info(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
          =map t =>t  n)take_consts
    take_defs           :  _thy
chain_take_thms  ,
    take_0_thms         : thm list,
        vallhstake_const(<term<>Sucjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
deflation_take_thms    fun define_finite_const (()( ) java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
    take_strict_thms:        valrhs mk_cfcomp2(ep_abs)
s       :term,
    finite_defs         : thm list,
      :,
    reach_thms          : thm        val  =  @ java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    take_lemma_thms     : thm list,
    is_finite           : bool,
         (,java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
  }

val beta_ss =
  simpset_of (put_simpset HOL_basic_ss \ finite_rhs =
     @thms}>. \simprocopen>

(******************************************************************************). \<>\open\<close> $
(******************************** theory data *********************************)mk_eq (take_const  n         take_consts ~rep_abs_consts  ~java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 65
(******************************************************************************)

structure Rec_Data = Theory_Data
(
  (* list indicates which type arguments allow indirect recursion *)
   T             ""dbind)thy
  val emptyin(finite_constfinite_def_thm) ) end
  fun (inite_consts finite_defs)thyjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
)

fun add_rec_type (tname, bs) =
tamap(.insert      >.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

fun add_deflation_thm thm           { conjI}
take_conststake_consts

val get_rec_tab  take_defs
fun get_deflation_thms thy =
(.getin

val map_ID_add = Named_Theorems.add.prove_global [][  ( contextctxt.}=
fun get_map_ID_thmsEVERY
  revtake_Suc_thms =take_Suc_thmsjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38


(******************************************************************************)ic_ss )1
(************************** building types and terms **************************)
(******************************************************************************)

open         finite_def

infixr 6 -ORELSE  ctxt)java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
infix(esultthy)
infix 9       java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

fun  t =
let val T cts(:)  
  in \<^Const>\<open>deflation T           thmLthmRSthm}

= HOLogicmk_TruepropHOLogic        ( : ns 

(******************************************************************************)
(****************************** isomorphism info ******************************)
(******************************************************************************)*************java.lang.StringIndexOutOfBoundsException: Range [81, 80) out of bounds for length 80

fun deflation_abs_rep (infolet
     valtake_type=\Typeval =
     =# info
    val rep_iso = #rep_inverse info
                   =fold oo "take_induct"
  in
    Drule.zero_var_indexes thm
  end

(******************************************************************************)
(********************* building map functions over types **********************)
(******************************************************************************)

funmap_of_typ( :theorysub( ) list( typterm
  let
   valthms= get_map_ID_thmsend
    val rules = map java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
  in
    mk_ID T
|> Pattern. thy' []
    |> Pattern.rewrite_term thy (, take_defs), ) =thy
 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

(******************************************************************************)
(********************* declaring definitions and theorems *********************)********java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
(******************************************************************************)

  name, eqnctake_Suc_thms#take_Suc_thms,
    Global_Theory.add_def (Binding.qualify_name true dbind name, eqn)

fun add_qualified_thm name (dbind, thm) =
    yield_singletontake_strict_thms take_info
      ((Binding.qualify_name true dbind name, thm), [])

fun add_qualified_simp_thm name (dbind, thm) =
    yield_singletonGlobal_Theory.dd_thms
      ((Binding.qualify_name true dbind name,       java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8

(******************************************************************************), thy=
(************************** defining take functions ***************************) ( ~ dbinds)thy
(******************************************************************************)

fun define_take_functions
(  i) list
    java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
let

evespec
    val dbinds = map fst spec
    val iso_infos = map snd spec
valdom_eqns  (  >(absTx,r x) 
    val rep_abs_consts = map (fn x => (#rep_const       

    fun mk_projs []      _ = []
  (:[])t  (,t)]
      | mk_projs (x::xs) t = (x, mk_fst t) :: mk_projs xs (mk_snd t)

fun ((rep_const,abs_const f java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
        (,mk_cfcomp,rep_const

    (* define take functional *)
valnewTs typ fst
    val copy_arg_type = mk_tupleT (map (fn T => T ->> T) newTs)
    val copy_arg = Free          (take_const rep_abs,)(, rhsT)thy
    snd dbinds)
    fun one_copy_rhs (rep_abs, (_, rhsT)) =
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        val body = map_of_typ   ,)
in
        mk_cfcomp2 (rep_abs, body)
      end
    val take_functional =
        big_lambdacopy_arg
          (mk_tuple (map         val take_Suc_thm =Goalprove_global ]]goal( o #)
    val take_rhss =
      let
        val n = Free ("n"in
        val rhs = mk_iterate        add_qualified_thm"" (, ) thy
in
        map (lambda n o snd) (mk_projs dbinds        prove_take_Suc
      end

    (* define take constants *)
    fun define_take_const ((dbind,     (* prove deflation theorems for take functions *)

        val take_type = \ valdeflation_take_thm
        val take_bind         n =Free", \Type\open>at
        val (take_const, thy) =
          Sign.declare_const_global ((take_bindval  =
        valtake_eqn Logic.k_equalstake_consttake_rhs
        val (take_def_thmval =
            add_qualified_def "(, take_eqn) thy
      in ((take_const, take_def_thm), thy) end
    val ((take_consts, take_defs), thy) =  (* list indicates which type arguments allow indirect recursion *) ool)Symtab.
| define_take_constbinds  ~ dom_eqns)
               java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

    (* prove chain_take lemmas *)
    funvalget_rec_tab .get
      let
        val goal@ conjE
val= @ @hms ch2ch_fst}
        fun tac ctxt
        val java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
      in
 "ain_take"bind)
      end
      (:)  [,thm)
      fold_map prove_chain_take ( <onst>  \close

    (* prove take_0 lemmas *)
    fun prove_take_0 ((take_const, dbind), (lhsT, _)) thy =
      let
        val lhs=take_const\<^erm\<>0::nat>
        val goal =       java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
         rules =take_defs  @{ iterate_0 snd_strict
        fun tac ctxt  end
        val take_0_thm
      in
         take_0dbindtake_0_thm
      end
    valtake_0_thms thy java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
      fold_map.

(thm}  deflation_take
  
    eadd_qualified_simp_thm"(,take_strict_thm)
 prove_take_Suc
          (take_constrep_abs           (((take_const, rep_abs), dbind********java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
      let
vlhs  <>open<>$n
        val body Global_Theory
        val rhsmk_cfcomp2 rep_abs body)
         goal  mk_eqs (, rhsjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        val rules =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        
        val       java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
      in( :( * ist
        add_qualified_thm
      end
     (, ) java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
fold_map
        (take_consts       let

    (* prove deflation theorems for take functions *)
    val deflation_abs_rep_thms    funmk_projs [      _ =[
    val              @thm|mk_projs:xst( t :mk_projs ( t)
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  Free ^>\pen<>)
        fun mk_goal take_const        prove_take_below
             copy_arg_type mk_tupleTdeflation_take_thms ) 
        val bottom_rules =
          take_0_thms @ @{thms    fundefine_finite_const snd  )
        val deflation_rules =
@hms deflation_ID
          @ deflation_abs_rep_thms
          @ get_deflation_thms  =  thynewTs~copy_argsrhsT
      in
        .prove_globalthy [end
                  x   (",val take_functional java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
          resolve_tac @ nat} ,
           simp_tac (put_simpset         n=n ^>><)
           asm_simp_tac (put_simpset         rhs=mk_iterate,take_functionaljava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
   (resolve_tacctxt{thms}java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
                   ORELSE resolve_tac ctxt deflation_rules 1
                   ORELSE assume_tac ctxt 1)])
end
    fun conjuncts [] _ = []
       conjuncts n:[]) = [(,thm
      | conjuncts (n::ns) thm = let
             =  RS{ conjunct1
          val thmR = thm|>ListPairunzip
        in (n, thmL):: conjuncts          .declare_const_global((, ),NoSyn 
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      fold_map (add_qualified_thm "deflation_take")
map Drule)
(  ) 

 *)
    fun prove_take_strict (deflation_take,
      let
thm    *
                 prove_chain_take(take_const, ) thy
 oal mk_chainjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
in
        add_qualified_simp_thm "take_strict" (dbind,           Goalresult )
      end
    funprove_finite_take_induct
      fold_map prove_take_strict
        (deflation_take_thms ~~ dbinds) thy

    (* prove take/take rules *)
    fun prove_take_take (    prove_take_0(take_const  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
      java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        =
            Drulevalrulestake_defs@@{ iterate_0 snd_strict
(@ deflation_chain_min}F[,deflation_take
      in
        add_qualified_thm "take_take" (dbind, take_take_thm) thyvalchain_take_thmstake_0_thms, .} take_info         take_0_thm=.thy [goalo#)
      end
    val
          val  =
        (chain_take_thms ~~ deflation_take_thms ~~ dbinds) thyfuniso_localeinfoiso_info add_qualified_simp_thmake_0dbindtake_0_thmthy

* prove take_below rules *)
    fun prove_take_below (       prove_take_0take_consts         iso_locale_thms  iso_locale
      let
 valdecisive_abs_rep_thms =
Drule
elow  [deflation_take])
in
add_qualified_thm"dbind
      end
    val (_, thy) =
 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        ( f            thy~take_is) rhsT

    (* define finiteness predicates *)= ,rhs
 define_finite_const(, take_const (, _)thy
      let
           @simps
val  java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
        val (finite_const, thy) =
          Signadd_qualified_thm decisive_abs_rep_thms
      
val   (n,\^>         ctxt [
val 
lambda HOLogicexists_const \^Type\             put_simpsetctxt rules01
            (lambda n (mk_eq (mk_capply (take_const $ n, x), x))))
valfinite_eqn=     deflation_abs_rep_thms=map iso_infos
        val (finite_def_thm, thy) =
add_qualified_defval   ("\>opennat\>
      in ((finite_const, finite_def_thm), thy) end 1 = []
    val ((finite_consts, finite_defs), thy) = thy
      |>           @ @{ deflation_bottom }
      |>> ListPair.unzip

    valresult=
      {
        take_consts = take_consts,
        take_defs =        .prove_global [][  ( { =ctxt..}=
ain_take_thms hain_take_thms
 =,
take_Suc_thmstake_Suc_thms
         = deflation_take_thms
hms,
 finite_consts
finite_defs 
      val =conjuncts specjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

  inthmL RS { }
    (result,  =
  endvalgoal= finite_const ",absT)

fun prove_finite_take_induct
( :(inding*) list
   take_info take_info)
    (lub_take_thms : thm list)
    (thy : theory) =
let
    val dbinds = map fst spec
    val iso_infos = map snd spec
    val absTs =     prove_take_inductch_takel),decisive=
valtake_consts.. =take_info
 chain_take_thms,take_Suc_thms.. =take_info
    val    valtake_induct_thms=

    val decisive_lemma =
      let
        funiso_localeinfo java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 ,ep_inverseinfo
        val iso_locale_thms = map        >fold
    funprove_take_takechain_take)|> (snd  add_qualified_thm"
map=decisive_abs_rep ]iso_locale_thms
        val n = Free (            .zero_var_indexes
        fun mk_decisive t(finite_thms take_induct_thms
          letval   #dest_cfunTfastype_of)
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        fun f take_const = mk_decisive
        val goal = mk_trp (foldr1 mk_conj (map f take_constsfun (deflation_take dbindt java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
        val rules0 = @{thm decisive_bottom(thm.  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        val rules1
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
            @ @{thms decisive_IDfold_map prove_take_below
        fun tac ctxt = EVERYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
resolve_tac{ .induct1
            val repTslet
             (put_simpset  ctxt )1java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
      in Goal.prove_global thy [] [] goal  (chain_take ),dbind)thyval=Binding"" java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
    fun conjuncts 1 thm = [thm]
 conjuncts  thm let
          val thmL = thm RS @{thmtake_lemma_thms 
          val thmR                   hain_take_thmslub_take_thms~ thy
        in thmL  (,lub_takeval=java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
    val decisive_thms = conjuncts (length spec) decisive_lemma

funprove_finite_thm,) 
      let
|>ListPair.unzip
funt
EVERY
            rewrite_goals_tac ctxt finite_defs,      {
            resolve_tac ctxt @{thms lub_ID_finite}   valreach_thms,thy) =
            resolve_tac ctxt chain_take_thms 1,
            resolve_tac ctxt lub_take_thms 1,
             ctxtdecisive_thms1]
      in
        Goal.prove_global thy [] [] goal    local
      nd
valfinite_thms
        map          =take_strict_thms,

 prove_take_inductch_take) decisive =
        Drule.export_without_context       finite d( (,Ts) 
          @thmOF]}
    val  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
        map prove_take_induct|finite __=java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
          (chain_take_thms ~~ lub_take_thms ~~valis_finite ( :take_info

    val thy = thy
          (snd add_qualified_thmfinite)
            (dbinds ~~ finite_thms)
 | fold sndoo add_qualified_thm"
    
in
   (, take_induct_thms )
  end

 add_lub_take_theorems
    (spec : (binding * iso_info
    ( : take_info
    (lub_take_thms : thm list)
    (thy : theory) =
let

    (* retrieve components of spec *)
    val dbinds = map  prove_take_induct(, lub_take
    val iso_infosmap   thm}  [] iso_locale_thms
    val absTs  val (", <^>\opennat
    val repTs  # iso_infos
    val {chain_take_thms, ...} = take_info

    (* prove take lemmas *)
ub_take),dbindt =
      let
        val take_lemma =
            Druleexport_without_context
              (@{thm lub_ID_take_lemma} OF [chain_take, lub_take])
      in
        add_qualified_thm "take_lemma" java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                take_consts take_info,
    val (take_lemma_thms thy =
      fold_map prove_take_lemma
(~~lub_take_thms dbindsthy

    (* prove reach lemmas *)ctxt=chain_take_thmsjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    fun     addsimps ]
      lettake_info
        val thm =
            Drule.export_without_context
              (@{thm lub_ID_reach} OF [chain_take, lub_take])
      in
        add_qualified_thm "reach" (dbind, thm) thy
      end
     (, thy=
      fold_map prove_reach_lemma
        (chain_take_thms ~~ lub_take_thms ~~ dbinds) thy

    (* test for finiteness of domain definitions *) thmL thm @thm}

      val types = [\<^java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      fun finite d T = if member (op =) absTs T then d     valdecisive_thms = conjuncts( ) decisive_lemma
      and finite' d (Type (c, Ts)) let
          let  d =dandalso op)  
          in forall (finite d') Ts end
        | finite' _ _ = true
    in
      val is_finite = forall (finite true) repTs
    end

    val ((_, take_induct_thms), thy) =
      if is_finite
      
        let
          val ((finites, take_inducts), thy) =
              prove_finite_take_induct spec take_info lub_take_thms thy
        in
          ((SOME finites, take_inducts), thy)
        end
      else
        let
          fun prove_take_induct (chain_take, lub_take) =
              Drule.export_without_context
                (@{thm lub_ID_take_induct} OF [chain_take, lub_take])
          val take_inducts =
              map prove_take_induct (chain_take_thms ~~ lub_take_thms)
          val thy = fold (snd oo add_qualified_thm "take_induct")
                         (dbinds ~~ take_inducts) thy
        in
          ((NONE, take_inducts), thy)
        end

    val result =
      {
        take_consts         = #take_consts take_info,
        take_defs           = #take_defs take_info,
        chain_take_thms     = #chain_take_thms take_info,
        take_0_thms         = #take_0_thms take_info,
        take_Suc_thms       = end
        deflation_take_thms = #deflation_take_thms take_info,
        take_strict_thms    = #take_strict_thms take_info,
               = #finite_constst,
finite_defs= finite_defs take_info
        lub_take_thms       = lub_take_thms,
        reach_thms          = reach_thms,
        take_lemma_thms     = take_lemma_thms,
        is_finite           = is_finite,
        take_induct_thms    = take_induct_thms
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    (    val  = map #absTiso_infos
  end

end

100%


¤ Dauer der Verarbeitung: 0.17 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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 ist noch experimentell.