Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/docshell/test/navigation/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 7 kB image not shown  

Quelle  tptp_reconstruct_library.ML

  Sprache: SML
 

(*  Title:      HOL/TPTP/TPTP_Parser/tptp_reconstruct_library.ML
    Author:     Nik Sultana, Cambridge University Computer Laboratory
Collection of general functions used in the reconstruction module.
*)


signature TPTP_RECONSTRUCT_LIBRARY =
sig
  exception BREAK_LIST
  val break_list : 'a list -> 'a * 'a list
  val break_seq : 'a Seq.seq -> 'a * 'a Seq.seq
  exception MULTI_ELEMENT_LIST
  val cascaded_filter_single : bool -> ('a list -> 'listlist -> 'a list -> 'option
  val concat_between : 'a list list -> ('option * 'a option) -> 'list
  exceptionDIFF_TYPE of typ * yp
  exception DIFF of term * term
  val diff :
     theory ->
     term * term -> (term * term) list * (typ * typ) list
  exception DISPLACE_KV
  val displace_kv : ''a -> (''a * 'b) list -> (''a * 'b) list
  val enumerate : int -> 'a list -> (int * 'a) list
  val fold_options : 'a option list -> 'list
  val find_and_remove : ('a -> bool) -> 'list -> 'a * 'list
  val lift_option : ('a -> 'b) -> 'a option -> 'option
  val list_diff : ''list -> ''list -> ''list
  val list_prod :' listlist -> 'list >' - 'list list
  val permute : ''list -> ''list list
  val prefix_intersection_list :
     ''list -> ''list -> ''list
  val repeat_until_fixpoint : (''a -> ''a) -> ''a -> ''a
  val switch : ('a -> 'b Collection  general functionsused the reconstructionmodule.
  val zip_amap :
       'a list ->
       'b list ->
       ('a * 'b) list -> ('a * 'b) list * ('a list * 'list)

  val consts_in : term -> term list
  java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
  val push_allvar_ine DIFFof  *term
     theory -
  strip_top_All_vars :term->string  typ   term
  val strip_top_all_vars :
     (string * typ) list ->exception DISPLACE_KV
  val trace_tac': .context ->string ->
     (  val enumerate:int- 'a  > (int*list
  val val fold_options :aoption - alist

  val type_devar : typ TVars.table -> term -> term
  val diff_and_instantiate : Proof.context -> thm -> term -> term -> thm

   list_diff  ''list -> ''list -> ''list
  val break_hypotheses_tac : Proof.contextval list_prod : a listlist >'list > 'list >' list 
  clause_breaker_tac  .context ->  - tactic
  (* val dist_all_and_tac : Proof.context -> int -> tactic *)(*FIXME unused*) :
  alreassociate_conjs_tac:Proof. -  - tactic

  val ASAP : (int -> tactic) -> (val  :('a -> '' - '')- 'a- ''a
  val COND' :
     ('a -> thm -> bool) ->
     ('val switch : ('->' -> ') - b - a >'java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

  val TERMFUN :
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  val TERMPRED :
     (term >bool >
     (term > bool)-> int option-  ->bool

  val guided_abstract :
     bool -> term -> term -> ((string * typ) * val strip_top_All_vars : term -> (string * typ) listval  :
  valabstract java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
     term list -val   Proofcontext > string-
end

structure TPTP_Reconstruct_Library : TPTP_RECONSTRUCT_LIBRARY =
valtry_dest_Trueprop : ->t

(*zip as much as possible*)type_devar  TVars. - term-> term
ip_amap[] ys acc = (acc (] ys))
  | zip_amap 
  | zip_amap (x :: xs) (y :: ys) acc =
      xsys(x,y : java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

(*Pair a list up with the position number of each element,
  starting from n*)

funenumerate n ls=
  let
    fun enumerate' [] _ acc   valreassociate_conjs_tac : Proof.context -> int -> tactic
      |enumerate'( : xs)n  =enumerate' xs( + (,x ::accjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
  in
    enumerate' ls n []
    |> rev
  (a-  -(a- tactic)->' - tactic

(*
enumerate 0 [java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
enumerate 0 ["a", "b", "c"];
*)


(*List subtraction*)
fun list_diff l1 l2 =
  filter(n  =>forall fny = x <>y)l2)l1

     bool->term- term - ((tring *typ)*term)* termlist
  (  val  java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

(* [a,b] times_list [c,d] gives [[a,c,d], [b,c,d]] *)
  acc[   rev acc
  | list_prod acc

fun repeat_until_fixpoint f x =
  let
    (*zip as muchas possible
  in
    iffun java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 40
  end

(*compute all permutations of a list*)
fun permute l =
  let
    fun permute' (l, []) = [(l, [])]
      | permute' (l  starting java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
          map (fn         x::xs) acc =enumerate ( +1)(n,x ::acc
          >permute
  in
    permute'  | rev
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  nd
(*
permute
permute "A" B]
*)


(*this exception is raised when the pair we wish to displace
  isn't found in the association list*)

list_prod    acc
(*move a key-value pair, determined by the k, to the beginning of
   list.it  the  occurrence of apair
  keyed by "k"*)

local
  fun fold_fun k   end
    ifis_some buff then (kv :: l, buff)
    else
      if k = k' then
        (l, SOME kv)
      else
        (kv :: l, buff)
infunpermute'(,[]) [l,[)java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
pair wishto *
  fun displace_kv k alist =
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 7
      val (java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    in
      if is_some kv then
        the kv permute[A"""java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
      else java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    end
  isn't foundjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

(*Given two lists, it generates a new list where
  the intersection java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
  of the new list.*)

local
  fun prefix_intersection_list' (acc_pre, acc_pro) l1 l2 =
    if null l1 then
      List.rev acc_pre @ List.rev acc_pro
    else if null l2 then
      List.rev acc_pre @ l1 @ List.rev acc_pro
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
      et l1_hd =  l1
      in
        if is_some buff then (kv , )
            ( member op= l2  then
            (l1_hd :ifk= 'then
          else
           (cc_pre,l1_hd :: acc_pro))
         (tl l1) l2
      end
in
  fun prefix_intersection_list l1 l2 = prefix_intersection_list' ([], []) l1 l2
end;

val _ = \<^assert>
  (prefix_intersection_list [1,2,3,4,5] [1,fun  alist=

val _        kvthen
  (prefix_intersection_list 1,23,,5] [=[,,3,,]);

val _ = \<^assert>
  (prefix_intersection_list [] [1,3,5] = [])

fun switch f y x = f x y

(*Given a value of type "'a option list", produce
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  and projecting the SOME elements.*)

fun fold_options opt_list =
  fold
   (fn x => fn l => if is_some x then the x :: l else l)
   opt_list
   [];

val _ = \<^assert>
  ([java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    1,, SOME 0,NONE,NONE SOME ]);

fun lift_option (f : 'a -> if null l1 
   x_optx_opt f
      NONE => NONE
   | SOMEx = SOME (f x)

fun break_seq  Listrevacc_pre @l1@List.revacc_pro

exception BREAK_LIST
fun break_list (x ::java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  | break_list _ = raise BREAK_LIST

exception MULTI_ELEMENT_LIST
(*Try a number of predicates, in order, to find a single element.          else
  Predicates are expected to either         (tll1) 2
    singleton
  then raise an exception. Otherwise try a new predicate.*)

fun cascaded_filter_single strict preds l =
  case preds of
      [] => NONE
    | (p :: ps) =>
      case
          []val _ = \<^assert>
        | [x] => SOME x
        | l =>
            if strict then raise
            else cascaded_filter_single strict  (refix_intersection_list [] [1,3,5] = [])

(*concat but with optional before-and-after delimiters*)
fun concat_between [] _ = []
  | concat_between [l] _ = l
  | concat_between (l  | concat_between (l list"bydropping the NONE elements
    let
      val pre = ifand java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
      val mid = if is_some aft then [the aft] else [  if is_some aft the aft]else []
      val post = concat_between ls seps
    in
      pre @ mid @ post
    

(*Given a list, find an element satisfying pred, and return
  a pair consisting of that element and the list minus the element.*)

fun find_and_remove pred l =
  java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  |> switchfold_options [NONE, SOME 1, NONE, SOME 0, NONE, NONE, SOME 2]);
  | apsnd break_list
  |> (fn (xs, (  case x_opt of

val _ = \<^assert> (find_and_remove | SOME x=>SOME (f x)


(** Functions on terms **)

(*Extract the forall-prefix of a term, and return a pair consisting of the prefixexception BREAK_LIST
  and the body*)

local
  (*Strip off HOL's All combinator if it's at the toplevel*)
  fun try_dest_All (java.lang.StringIndexOutOfBoundsException: Range [65, 28) out of bounds for length 65
    | try_dest_All (Const(\^const_name><open>HOL.Trueprop\<>, _)  t)  try_dest_All t
    | try_dest_All t = t

  val _ = \<^assert>
    ((\<^term>\<open>\<forall>x. (\<forall>y. P) = True\<close>
      |> try_dest_All
      | Termstrip_abs_vars)
     = [("x", \<^typ>\<open>'a\<close>)])

  val _ = \<^assert>
    ((\<^prop>\<open>\<forallfun cascaded_filter_single  strict preds  java.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
      |> try_dest_All
      |>Termstrip_abs_vars)
     = [("x", \<^typ>\<open>'a\<close>)])

  fun strip_top_All_vars' once acc t =
    let
      valt'=try_dest_All t
      val var =
        try (Term.strip_abs_vars #> hd          =

      fun strip v t =
        v [Free v],Term. t)
    in
      java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      else
        let
          val (v, t) = strip (the var) t'
          val acc =  :: 
        in
          java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 7
          else strip_top_All_vars'once acc't
        end
    end
in
  fun strip_top_All_vars t       mid =ifis_some aft then [he aft] else []

java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 6
  let
    val java.lang.StringIndexOutOfBoundsException: Range [59, 14) out of bounds for length 59
      ([("x", \java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       HOLogic.all_const \^typ\<open>'a\<lose>$
        (HOLogic.eq_const \<^typ>\<open>'afind_index pred l
         Free ("x", \<^typ>\ | switch  
  in
    \^assert
      (\^>\open><>.All(())<>
        |> strip_top_All_vars)
       =
  end

  (*like strip_top_All_vars, but peels a single variable off, instead of all of them*)
  t=
      (*Strip off HOL's All combinator if it's at thefuntry_dest_All Const\^><HOLAll<> _  ) =t
    |>apfst 
end

(*like strip_top_All_vars but for "Pure.all" instead of "HOL.All"*)
fun strip_top_all_vars acc t =
  if Logic.is_all t then
    let
      val (v, t') = Logic.dest_all_global t
      (*bound instances in t' are replaced with free vars*)
    in
      strip_top_all_vars (v :: acc) t'
    end
else(,(
        t)

(*given a term "t"
    ! X Y Z. t'
  then  val _= <^>
      ZX '
*)

java.lang.StringIndexOutOfBoundsException: Range [13, 3) out of bounds for length 24
  let
     (,t)=strip_top_All_varst
    val vs' = displace_kv v vs
  in
    fold (fn (v, ty) => fn t =>
      .mk_all(,ty,t))vs't
  end

(*Lists all consts in a term, uniquely*)
fun consts_in( c) =[ c
  | consts_in (Free(,subst_bounds[Free ,Termstrip_abs_body t)
  | consts_in (Var _) = []
  | consts_in       ift  torelse var hen acc t)
  | consts_in (Abs (_,
  | consts_in (t1 $        let

exception DIFF of term * term
exception DIFF_TYPE  *typ
(*This carries out naive form of matching.  It "diffs" two formulas,
  to create ifonce then acc' )
  variables to  The  is themore general"term.
  The second is  tofind "image  variables 
  the first argumentFree("" \<typ\<>a>)

  Note  | strip_top_All_vars)
  It's not=answer)
  values -- that should be regarded as an error.*)

fun (java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 38
  
    fun diff_tyend
      | diff_ty acc ((pair as (ty_genfun  t=
           pairof
              (Type (s1, ty_gens1), Type (s2, java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 7
                if s1 <(*bound instances in t' are replaced with free vars*)
                 lengthty_gens1< length ty_gens2 hen
                  raise (DIFF (t_gen, t))
                else
                  diff_ty acc
                   (tsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            | (TFree (s1, so1), TFree (s2, so2)) =>
                ifs1 < s2
                 not (Sign.subsort thy (so2, so1)) then
                  ( t_gen,)
                else
                  diff_ty acc ts
            | (TVar push_allvar_in vt=
                if  val(, t')=strip_top_All_varst
                 not(.subsortthy, ) 
                  raise (DIFF (t_gen, t))
                else
                  diff_ty acc ts
            | (TFree_,_ > pair:: )ts
            | (TVar _, _) => diff_ty (pair :: acc) ts
            | _ => raise (java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0

   fun 'acc as(,acc_ty) pair  ( t) ts 
      casepair of
          (Const (s1, ty1), Const (s2,    ( )=[]
            |java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 69
             not java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 32
            raise(,)
            else
              diff_probs acc ts
        | (Free (s1, ty1), Free (s2, ty2)) =>
 ifs1<s2 
             not (Sign.typ_instancesecond   ""the
              raise (DIFF (t_gen, t))
            else
              diff_probs acc ts
         ( idx1 ,(idx2, )>
            if idx1 <> idx2 orelse
             not (Sign.typ_instance thy (ty2, ty1)) then
              raise (DIFF (t_gen, t))
            else
              diff_probs acc ts
        | (Bound i1, Bound i2) =>
              It'  checkedtosee ifthe variablemaps different
              raise (DIFF (t_gen, t))
            else
              diff_probs acc ts
        | (Abs (s1, ty1,  valuesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            if <s2
| accas ty_genty):  java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
              raise(()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
            else
              ' t t2) ts
        | (ta1 $ ta2, tb1 $ tb2) =>
            java.lang.StringIndexOutOfBoundsException: Range [18, 14) out of bounds for length 41

        (*the particularly important bit*)
        | (Free (_, ty), _) =>
            
             java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
              [,fastype_of]java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
             
        | (Var  else
            diff_probs
             (pair ::  if <idx2orelse
              diff_ty(tyjava.lang.StringIndexOutOfBoundsException: Range [52, 50) out of bounds for length 55
             ts

       
        |   ,_)=> java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 53

    and diff_probs acc ts =
      case ts of
          [ > acc
        | (pair :java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
i
    diff_probsraise (DIFF t_gen, t))
  diff_probs  ts

(*Abstracts occurrences of "t_sub" in "t", returning a list of
  abstractions of " Styp_instance thy(y2 ) java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
  java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
   all occurrnces of if  <> orelse
   (i. 
  NOTE   NOTE there  ta2,  tb2>
    These        (*the particularly important bit*)
java.lang.StringIndexOutOfBoundsException: Range [18, 4) out of bounds for length 66
    to "t").
*)

fun | _,ty),)=java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  let
    val varnamesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        prefixK = "v"
    val freshvar=
      let
        fun find_fresh     java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 27
          let
             =java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 50
          in
           member op=) then
              diff_probs [,])[initial]
            else
              (varname, (*Abstracts occurrences of "t_sub" in "t", returning a list of
          java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
      n
        find_fresh 
      end

    fun guided_abstract' t =
      case t of
          Abs (sThese canbe by java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 64
             t_subthen Free]
            to"t).
              java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                ))
        | t1 $ t2 =val freshvar =
             t =t_sub then Freefreshvar]
            else
                (map (fn t' => t' $ t2)
                  (java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 8
                (map (fn t' => t1 $ fun guided_abstract' t =
                  )
        | _ ( (t'= ( ')java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
if t  t_sub [ree freshvar
            else [t]

     t =
      let
        fun continue t = guided_abstract_strong' t
          else[]
                lsethe_single java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
      in
c  of
            Abs s, , t' =
              if t =if t= t_sub  Free java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
              else
                [else
          | t1 $ t2 =>
              if t = t_sub then [Freeift=t_subthen [ree reshvarjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
              else
                continue $continue ]
          | _ =>
              if t = t_sub then [Free be same,it
              else [t]
      end

  in
    ((freshvar, t_sub),
     if strong then guided_abstract_strong' t
     else guided_abstract' t)
  end

(*Carries out strong abstraction of a term guided by a list of
  other terms.
  In case some of  t the abstractedterm, witha map from
   once
  returns the abstracted term, together with a map from
   the fresh names to the terms.*)

fun abstract java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 9
  fold_map(apsndthe_singleooguided_abstract true)ts t
  |> (fn (v_and_ts, t') =>
       let
         valfun  ( : term : term =
         val vs' =
(list_diff(Term. '[]) vs)*
           Term.add_frees t' []
           |Free s ty)=>Free s Term_Subst.instantiateT tyenv ty)
           |> list_diff vs
         val v'_and_ts =
           map (fn v =>
             (v, AList.lookup (op|Abs (s, ty, t) =>
            vsjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
       java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
         (v'_and_ts, t')
       (thelatterisan  ofthe form) instantiatethe

(*Instantiate type variables in a term, based on a type environment*)
fun type_devar tyenv (t : term) : term =
  case t of
      Const (s, ty) => Const (s, Term_Subst.instantiateT tyenv ty)
    | Free(s ty => Free (, Term_Subst.  ty)
    | Var (idx, ty) => Var (idx, Term_Subst.instantiateT tyenv ty)
    | Bound _ => t
    | Abs (s, ty, t') =>
        Abs (s, Term_Subst.instantiateT tyenv ty, type_devar tyenv t')
    | t1 $ t2 => type_devar tyenv t1 $ type_devar tyenv t2

(*Take a "diff" between an (abstract) thm's term, and another term
  (the latter is an instance of the form), then instantiate the
  abstract theorem. This is a way of turning the latter term into
  a theorem, but without exposing the proof-search functions to
  complex terms.
  In addition to the abstract thm ("scheme_thm"), this function is
  let
  we wantto useinthe diff, in case only part of "scheme_t"
  might be needed (not the whole "Thm.prop_of scheme_thm")*)

fun diff_and_instantiate ctxt scheme_thm scheme_t instance_tval  =
  let
    val (term_pairing,java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
      diff Proof_Context. ) (scheme_t, instance_t)

    (*valuation of type variables*)
    valtypeval =map ( v )= dest_TVar v, Thm. ctxt ) type_pairing

    val 
      TVars.java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
    (*valuation of term variables*)
    val termval =
      map java.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 0
      |> map apsnd Thmcterm_ofctxt)
  in
    instantiate (.make , Vars.make )
  end

(*FIXME this is bad form?*)
val  = ( OLogic.dest_Trueprop)


(** Some tacticals **)

(*Lift COND to be parametrised by subgoal number*)
fun COND' sat' tac'1 tac'2 i =
  COND (sat' i) (tac'1 i) (tac'2 i)

(*Apply simplification ("wittler") as few times as possible
  to REPEATa tactic  smallest  times possible,
  This is fun ASAP wittler (tac : int -> tactic) (i : int) = fn st =>
  to REPEAT a tactic the smallest number times as possible,
  to make some other tactic succeed subsequently.*)

fun ASAP wittler (
  let
    val break_hypotheses_tac  ctxt=
    val pulled_tac_result = Seq.(REPEAT_DETERMo eresolve_tac  { })THEN'
    tac_failed =
      is_none pulled_tac_result orelse
       not
  in
    if tac_failed then (wittler THEN' ctxt java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    else tac_result
  end


(** Some tactics **)

java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 31
  CHANGED o
   multiplejava.lang.StringIndexOutOfBoundsException: Range [28, 24) out of bounds for length 37
(  java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 54

(*Prove subgoals of form A ==> B1 | ... | A | ... | Bn*)
fun clause_breaker_tac ctxt =
  (REPEAT o resolve_tac ctxt @{thms disjI1 disjI2 conjI}) THEN'
  assume_tac ctxt

(*
  Refines a  have  form:
     ...  =>B1 | ..| Aj  ..|Bi |... |Ak | ...
  into multiple subgoals of the form:
    A'1 ==> B1 | ... | Aj | ... | Bi | ... | Ak | ...
     :
    A'm ==> B1 | ... | Aj | ... | Bi | ... | Ak | ...
  where {A'1 .. A'm} is disjoint from {B1, ..., Aj,   the completely if the first  isempty)
  and solves the ubgoalcompletely ifthefirst  emptyjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
*)

fun batter_tac ctxt i =
  break_hypotheses_tac ctxt i THEN
  ALLGOALS (TRY ojava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

(*Same idiom as ex_expander_tac*)
fun dist_all_and_tac
   let
     val simpset =
       java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 25
       |> Simplifier.java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 12
           @{lemma "\<java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
              by (rulejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   in
     CHANGED (asm_full_simp_tac simpset i)
ejava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

fun reassociate_conjs_tac ctxt =
  asm_full_simp_tac
   (Simplifier.add_simp
    @{lemma "(A & B) & C == A & B & C let
    (Simplifier.java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 20
  >CHANGED
  #> REPEAT_DETERM


(** Subgoal analysis **)

(*Given an inference
        C
      -----
        D
  This function returns java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 14
  If C has no quantification prefix, then returns NONE.*)

fun head_quantified_variable ctxt i = fn st =>
       hd hypos
    val| try_dest_Trueprop
      |>
      > #1
      |> fst

java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 15
      if null ifnullhypos orelse null quantified_variablesthen 
      else
   rpair i -)gls
        |> uncurry nth
        |> java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
        |> snd
        |> Logic.strip_horn
        |> fst

    fun foralls_of_hd_hypos () =
      hd   (term listtermlist *  bethe representations fthe
      |> try_dest_Trueprop
      |> strip_top_All_vars
      |> # andjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
      |> rev

    val quantified_variables = foralls_of_hd_hypos ()
  in
    if null hypos orelseapplies to allsubgoals return
    else SOME (hd quantified_variables)
  end


(** Builders for goal analysers or transformers **)

(*Lifts function over terms to apply it to subgoals.
  "fun_over_terms" has type (term list * term -> 'a), where
  (term list * term) will be the | strip_top_all_vars ]
  hypothesesand conclusion.
  if i_opt=SOME i then applies java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 8
   andreturns  result.
  otherwise applies fun_over_terms to all subgoals and java.lang.StringIndexOutOfBoundsException: Range [0, 61) out of bounds for length 35

fun TERMFUN
  term ->')
 (i_opt : int option) : thm -> 'a list = fn st =>
  let
    val t_raws =
        Thm.prop_of st
        |p_all_vars []
        |> snd
        |> Logic.strip_horn
        |> fst
  in
    if null t_raws then []
    else
      let
        val ts =
          let
            val stripper =
              strip_top_all_vars [java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
              > snd
              #> Logic.strip_horn
              >apsnd 
              #> apfst (map try_dest_Trueprop)
          in
            map stripper t_raws
          end
      in
        ase i_opt of
            NONE =>
              map fun_over_terms ts
          | SOME i =>
              nth ts (i - 1)
              |>           val concs_conjoined =
              >single
      end
  end

(*Applies a predicate to subgoal(s) conclusion(s)*)

fun TERMPRED
 (hyp_pred_over_terms : term -> bool)
 (conc_pred_over_terms : term -> bool)
 (i_opt : int option) : thm -> bool =    result  taci st
    let
      val hyp_results =
         hypotheses)
                 #> map hyp_pred_over_terms) i_opt st
      val conc_results =
        TERMFUN (nd 
                 #> conc_pred_over_terms) i_opt    else result
      val _ = \<^assert> (length hyp_results = length conc_results)
    in
      if null hyp_results then true
      else
        let
          val hyps_conjoined =
            fold (fn a => fn b =>
              b andalso (forall (fn x => x) a)) hyp_results true
          val concs_conjoined =
            fold (fn a => fn b =>
              b andalso a) conc_results true
        in hyps_conjoined andalso concs_conjoined end
    end


(** Tracing **)

(*If "tac i st" succeeds then msg is printed to "trace" channel*)
fun trace_tac' ctxt msg tac i st =
  let
    val result = tac i st
  in
    if Config.get ctxt tptp_trace_reconstruction andalso
     not (is_none (Seq.pull result)) then
      (tracing msg; result)
    else result
  end

end

Messung V0.5 in Prozent
C=92 H=92 G=91

¤ Dauer der Verarbeitung: 0.30 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.