Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Pure/ex/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 7 kB image not shown  

Quelle  Guess.thy   Sprache: Isabelle

 
(*  Title:      Pure/ex/Guess.thy
    Author:     Makarius

Improper proof command 'guess': variant of 'obtain' based on tactical result.

  <chain_facts>
  guess x <proof body> <proof end> \<equiv>

  {
    fix thesis
    <chain_facts> have "PROP ?guess"
      apply magic      \<comment> \<open>turn goal into \<open>thesis \<Longrightarrow> #thesis\<close>\<close>
      <proof body>
      apply_end magic  \<comment> \<open>turn final \<open>(\<And>x. P x \<Longrightarrow> thesis) \<Longrightarrow> #thesis\<close> into\<close>
        \<comment> \<open>\<open>#((\<And>x. A x \<Longrightarrow> thesis) \<Longrightarrow> thesis)\<close> which is a finished goal state\<close>
      <proof end>
  }
  fix x assm <<obtain_export>> "A x"
*)


section

theoryimports Pure "guess": % proof
 Pure is toobtain but  the context
keywords % ""
begin

text \<open>
  The to obtain it the context
  elements  course tactical in the. Thus can
   proof  @{command}starts a  goal \<open>thesis\<close>. The
  experimental refinement may turn toanything thejava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67

    withcommand} starts with  goal <open>thesis\<close>. The
  subsequent refinement steps may turn this to anything of the form
  \<open>\<And>\<^vec>x. \<^vec>A \<^vec>x \<Longrightarrow> thesis\<close>, but without splitting into new
  subgoals. The final goal state is then used as  a prefix accessibleparameters
  pattern aboveObtained \<open>\<^vec>x\<close> are marked as
  internalbyandthus in the text variable
  names type given asarguments@command}specify
  a prefix of accessible parameters.

  Some examples are in \<^file>\<open>Guess_Examples.thy\<close>.
\<close>

  val: (binding *string * mixfix)list bool .state>Proof
signature GUESSend
sig
  val guess
  val guess_cmd:(binding string * mixfix  -> bool>Proof -> Proofjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
end;

structureGUESS=
struct

local

fun unify_params vars thesis_var raw_rule ctxt =
  let
         err th
    val string_of_termval = fold.maxidx_typ o fstvars

     rule=Thm (maxidx 1) raw_rule

    val m = length vars
val = Thmincr_indexes + 1) raw_rule

    
         unifyx T,(,U) tyenv) = Sign thy(,U)(tyenv, max
    val n  length;
            err     ^

    funstring_of_term (x, .norm_typetyenv    parameter
      handle (Syntax_Transmark_bound_abs,Envir tyenv))^ "in") rule
        err (tyenv_=fold (map vars ~ take mparams
          string_of_term (x, Envir.norm_type T))^"againstparameter " ^
          string_of_termSyntax_Trans (y,Envir tyenv))   ")rulejava.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
    val (tyenv ys =mapapsnd norm_typedrop);
(.empty, Int. (maxidxThm rule));
    val norm_type     terms =map.mk_term o Thm.cterm_of o Free) (xs ys;

    val xs = map (apsnd norm_type o fst) vars;
    val ys = map (apsnd java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     ys =map. Name(map)(map)~~map;
    val terms = map (Drule.mk_term o Thm.cterm_of ctxt o Free        params  (#2 >Term (fn= fn =>

    val instT                TVars instT  instT
      .build
        (params|_= ))));
          (case T of closed_rule
             v =>
              if|.instantiate, Vars);
elsev,Thm  (norm_typeinstT
          | _ => instT))));
    val closed_rule = rule
      |> Thm.forall_intrval vars'=
>Thm (instTVars);

    val ((_, rule' mapsndvars @ replicate (engthys );
    val' java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
      map (dest_Free o java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      (map snd vars
val''  Thm. (Thmcterm_of'(.varify_global (Free ))) rule';
i (', rule',ctxt;

fun inferred_type (binding;
  let
    val=Variable binding
    val   let val =map..polymorphic (map(.mk_type 2 ))
  in(x  ), ctxt

fun polymorphic
letval  = map.dest_type.polymorphic (map.mk_type #) vars)java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
in ( (x,_, mxfn= (x ) )) vars end

fun val ctxt.context_of;
  letval = if Proof state Proofthe_facts else
     _ = Proof. state
    val = 
    | fold_map |-  inferred_type

val,thesis  1(.obtain_thesisjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
    val raw_rule. state
      |> fold_map prep_var raw_vars |->         (, _)  Variableadd_fixes # o 1 ) ctxt
      |> fst |> polymorphic tsmap ps

    un raw_rule' =
               |map asm Term ( Termabs asm), [])java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
        val ((parms, rule
                  state'
        valxs) .add_fixes (#1o 1)parms';
        val ps>Proof (map ((x T,mx>(.name,SOMEmx)parms
        val = mapFree;
        val asms =
          LogicObtain fix_ctxt rule (Thmcterm_of) ts
          | map asm = Term (fold_rev Term.bsps, ts), [))
        val|> Proofmap_contextfold Variable.unbind_termAuto_Bind)
      
        state guess =("", ) );
        | .map_contextKctxt
        |> Proof.fix (mapfunprint_result ctxt [s _ th 
        | `.context_of (fn fix_ctxt =>Proofjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
          (Obtain.obtain_export fix_ctxtval before_qed
            [] [] [Binding, asms)]
        |> Proofmap_contextfold.unbind_termAuto_Bind)
      end;

    val guess = (("guess", 0), propT);
    val goal = Var guess;
    fun print_result ctxt' (k, [(s, [_, th])]) =
      .print_results{ = int,posPosition.thread_data
ctxt(, (s,[th;
    val before_qed =
      Method.primitive_text (fn ctxt =>
        .conclude > Simplifier ctxt#>
          fn => Goal 0 (Conjunction (Drule (Thm.cprop_of th th)));
    fun after_qed (result_ctxt, results      in
      let
val [_, res] = Proof_Context.export result_ctxt (Proof.context_of state' (flat results);
        val res' = res RS Conjunction.conjunctionD2;
      in
        state'
        Proofend_block
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
      |Proof
  inProof.fix(Binding. Auto_Bind.thesisN, NoSyn
    state
    |> Proof.enter_forward
    |> Proof.begin_block
    | Proof.fix[Binding Auto_BindthesisN, NoSynjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    |> Proof chain_facts
          [ [][(inding, [(Logic goal[), (oal)]]
      (SOME| Proofrefine_singleton.Basic(fn >fn= CONTEXT_TACTIC
      [] ][(inding.empty_atts[Logic goal [],(oal])]
    |> snd
    |> Proof.refine_singleton (Method.Basic (fn          THEN.conjunction_tac
( (Thminstantiate.empty, Vars (guessThm ctxt thesis)))
          THEN Goal.conjunction_tac;
          java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  end;

in

val guess = gen_guess Proof_Context.cert_var;
val =

val=
      Scan Parsevars >(.proof' guess_cmd));
    (Scan;

end;

end;
\<close>

end

100%


¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© 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.