Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/HOL/Tools/Quickcheck/   (Isabelle Prover Version 2025-1©)  Datei vom 16.11.2025 mit Größe 23 kB image not shown  

Quelle  narrowing_generators.ML

  Sprache: SML
 

(*  Title:      HOL/Tools/Quickcheck/narrowing_generators.ML
counterexample.

Narrowing-based counterexample generation.
*)


sig :Config.T
sig
  val allow_existentials : bool Config.T
  val finite_functions : bool Config.T
  val overlord : bool Config.T
  val ghc_options : string Config.T  (* FIXME prefer settings, i.e. getenv (!?) *)
  val active : bool Config.T
  datatype counterexample = Universal_Counterexample of (term * counterexample)
    | Existential_Counterexample of (term * counterexample) list
    | Empty_Assignment
  val put_counterexample: (unit -> (bool * term listoption) -> Proof.context -> Proof.context
  val put_existential_counterexample : (unit -> counterexample option) ->
    Proof.context -> Proof.context
end

structure Narrowing_Generators : NARROWING_GENERATORS =
struct

(* configurations *)

val allow_existentials = Attrib.setup_config_bool \<^binding>\<open>quickcheck_allow_existentials\<close> (K true)
val finite_functions = Attrib.setup_config_bool \<^binding>\<open>quickcheck_finite_functions\<close> (  val finite_functions : bool Config.T
val overlord = Attrib.setup_config_bool \<^binding>\<openval overlord : bool Config.T
hc_options = Attrib.setup_config_string \<^binding>\<open>quickcheck_narrowing_ghc_options\<close> (K "")


(* partial_term_of instances *)

fun mk_partial_term_of  datatype counterexample = Universal_Counterexample of (term * counterexample)
  Const(<^const_name>\<open>Quickcheck_Narrowing.partial_term_of_class.partial_term_of\<close>,
TermitselfTT -->\<^typ>\open>narrowing_term\<lose --> \^typ>\<penCode_Evaluation.term\<close>) $ Logic.mk_type T $ x


(** formal definition **)

fun add_partial_term_of tyco raw_vs thy =
  let
    val vs  val put_existential_counterexample : (unit - counterexample option) ->
      = ype(tyco,map  vs)
    val lhs =
      Const (\<^const_name>\<open>partial_term_ofend
typ\opennarrowing_term\<close> --> \<^typ>\<open>Code_Evaluation.term\<close>) $
      Free ("x", Term.itselfT)$Free "" <t><open>narrowing_term\close>java.lang.StringIndexOutOfBoundsException: Range [84, 85) out of bounds for length 84
     :: Code_Evaluation.term\<close>
    val eq = HOLogic.mk_Trueprop (HOLogic.mk_eq (lhs, rhs))
    fun triv_name_of t =
      java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        "_triv"
  in
        Ter.itselfT T->\^typ><open>narrowing_term\<close> -- \<^\<open>Code_Evaluation.term\close>) $ .mk_typemk_type T $x
    |> Class.instantiation ([tyco], vs, \<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    |> let
    |->( eq=> Specification.definition NONE ] ] ((Binding.name (triv_name_of eq) ],eq)java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
    |> snd
    |> Class.prove_instantiation_exitlhs =
  C (<^const_name><openpartial_term_of\<close>,

fun ensure_partial_term_of (tyco, (raw_vs,         TermitselfT  - <typ>\>narrowing_term<lose> ->\^yp><open>ode_Evaluation.\c>) $
  let
    val need_instval   <term>\<penundefined::Code_Evaluationterm\c>
       . Sign.) tyco\^sort><open>typerep\<close>
  in if need_inst then add_partial_term_of tyco raw_vs thy else thy end


(** code equations for datatypes **)

fun java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 15
  let
    val frees = map (fn a => Free (a, \<^typ>\<open>narrowing_term\<close>)) (Name.invent_global "java.lang.StringIndexOutOfBoundsException: Range [20, 99) out of bounds for length 46
    al narrowing_term =
      \<^term>\<java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 10
        HOLogic \<typ>\<open>narrowing_term\<close (rev frees)
    val rhs =
      fold (let
        (    val needinst =not(Sorts.has_instance (Sign.classes_of thy) yco \^sort>\<openpartial_term_of\<close>)
        (\<^term>\<      andalso Sorts.has (Signclasses_of thy) tyco \<^sort>\<open>typerep\<close>
    val  insts =
      map (SOME o Thm.java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 0
        [Free "ty" Term.itselfT ty), narrowing_term, rhs]
    val cty = Thm.  let
  in
    @{thm partial_term_of_anything}
    |> Thm.instantiate' [SOME cty] insts
    >Thm.varifyT_global
  end

d_partial_term_of_code tyco raw_vs raw_cs thy =
  let
    val algebra = Sign.classes_of thy
, sort => (v curry (Sorts.inter_sort algebra) \<^sort>\<open>typerep\<close> sort)) raw_vs
    val  = Type (tyco, mapTFree vs)
    val cs =
      (map o apsnd o (map mk_partial_term_offrees~ tys)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
        fn TFree (v,_) = TFree (,(the  AList.lookup (op =) vs)v)) raw_cs
    val const = Axclass.param_of_instval insts =
    val var_insts =
            map (SOME oThmglobal_cterm_of thy o Logic.unvarify_types_global o Logic.varify_global)
java.lang.StringIndexOutOfBoundsException: Range [25, 8) out of bounds for length 107
          <term\<open>Code_Evaluation.ree(STR '_''\<lose>$ HOLogic.mk_typerep ty]
    val var_eq =
      @{thm partial_term_of_anything}
          val cty=Thm.global_ctyp_ofthy ty
      |> Thm.varifyT_global
    val eqs = var_eq :: map_indexin
  in
    thy
    |> Code.declare_default_eqns_global (map (rpair true) eqs)
  end

fun ensure_partial_term_of_code (tyco, (raw_vs, cs)) thy =
  let val has_inst = Sorts.as_instance (Sign.classes_of thy) tyco \<^sort>\<open>partial_term_of\<close>
  in if has_inst then add_partial_term_of_code tyco raw_vs cs thy else thy end


(* narrowing generators *)

(** narrowing specific names and types **)

java.lang.StringIndexOutOfBoundsException: Range [4, 2) out of bounds for length 38

val narrowingN = "narrowingval cs java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

fun narrowingT T        (fn  (v(, (the o AList.lookup (op =) vs) v)) raw_cs

unmk_cons  = Const \^const_name><Quickcheck_Narrowing.\<close>, T-- narrowingT ) $ Const c T)

fun mk_apply (T, t) (v var_insts java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  let
    val (_, U') = dest_funT U
  in[("ty" TermitselfT ) <term><>Quickcheck_Narrowing.Narrowing_variable p tt\<lose>,
    (U', Const (\<^const_name>\<open          <term>\<open>ode_Evaluation.Free (STR ''_'')\<close> $ HOLogic.mk_typerep ty]
      narrowingT U ->narrowingT T -> narrowingT U'  u $ t)
  nd

fun mk_sum (t, u) =
lT fastype_of java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
  inConst(\<const_name><>Quickcheck_Narrowing.sum\close>  --  - T)$t$ u 


(** deriving narrowing instances **)ensure_partial_term_of_code (yco,(raw_vs, cs) thy =

fun mk_equations descr vs narrowings =
  let
     mk_call  
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    fun mk_aux_call fTs (k
      let
        val T = Type (tyco, Ts)
        _= not(nullfTs)then  FUNCTION_TYPEelse )
      in
        (T, nth narrowings k)
      end
    fun
      et  =mapfst xs
        foldjava.lang.StringIndexOutOfBoundsException: Range [59, 27) out of bounds for length 82
   mk_rhs exprs =foldr1  exprs
    val rhss =
      Old_Datatype_Aux.interpret_construction descr vs
        {atyp  mk_call  =mk_aux_call 
      java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
map (n(, cs)= map mk_consexpr  cs)
      |> map mk_rhsnarrowingT U -   ->  U)$u$t)
    val 
     eqs=map (OLogicm oHOLogic.mk_eq ( ~rhss)
  java.lang.StringIndexOutOfBoundsException: Range [8, 4) out of bounds for length 12

fun contains_recursive_type_under_function_types xs =
  exists (fn (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [26, 4) out of bounds for length 106

fun instantiate_narrowing_datatype config descr vs tycos prfx (names, auxnames) (Ts, l
  let
v _  .essage  "  generators .."
    val narrowingsN = map (prefix (narrowingNfun fTs ( )(yco,)=
  in      
    if not contains_recursive_type_under_function_types)then
      
      |in
      | .define_functions
        (fn narrowings
 prfx ] ( narrowingT Ts @Us))
      |> Class.       valTs  fst 
     
  end


(* testing framework *)

val target = "Haskell_Quickcheck"


(** invocation of Haskell interpreter **)

val  =
  File| ( (,cs)= map( T )

val  =
  File.read \<^file>\<in eqs 

fun exec verbose code =
  ML_Contextexists fn _,(_ _,cs)=>cs >exists snd >exists (dT=
    java.lang.StringIndexOutOfBoundsException: Range [26, 16) out of bounds for length 34
      line=0,file  generated code" verbose=verbose,debug =false}code)

fun java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
(.explode "$ISABELLE_HOME_USER"+Path.(name^serial_string()
  |> Isabelle_System.make_directory
  >f

not contains_recursive_type_under_function_typesthen
    cookie (, )=
  let
    val code_modules = (map o apsnd) Bytes.content code_modules_bytes
    val ((is_genuine, counterexample_of), (get, put, put_ml)) = cookie
    fun message s = if quiet then () else writeln s
    fun verbose_message s = if not quiet andalso verbose then writeln s else ()
    val current_size = Unsynchronized.ref 0
    val current_result = Unsynchronized.ref Quickcheck.empty_result
    val tmp_prefix = "Quickcheck_Narrowing"
    val ghc_options = Config.get ctxt ghc_options
    val with_tmp_dir =
      if Config.get ctxt overlord then with_overlord_dir else Isabelle_System.with_tmp_dir
    fun run in_path =
      let
        fun mk_code_file module =
          let
            val (paths, base) = split_last module
          in Path.appends (in_path :: map Path.basic (paths @ [suffix ".hs" base])) end;
        val generatedN_suffix = suffix ".hs" Code_Target.generatedN;
        val includes = AList.delete (op =) [generatedN_suffix] code_modules
          |> (map o apfst) mk_code_file
        val code = the (AList.lookup (op =) code_modules [generatedN_suffix])
        val code_file = mk_code_file [Code_Target.generatedN]
        val narrowing_engine_file = mk_code_file ["Narrowing_Engine"]
        val main_file = mk_code_file ["Main"]
        val main =
          "module Main where {\n\n" ^
          "import System.IO;\n" ^
          "import System.Environment;\n" ^
          "import Narrowing_Engine;\n" ^
          "import " ^ Code_Target.generatedN ^ " ;\n\n" ^
          "main = getArgs >>= \\[potential, size] -> " ^
          "Narrowing_Engine.depthCheck (read potential) (read size) (" ^ Code_Target.generatedN ^
          ".value ())\n\n}\n"
        val _ =
          map (uncurry File.write)
            (includes @
              [(narrowing_engine_file,
                if contains_existentials then pnf_narrowing_engine else narrowing_engine),
               (code_file, code), (main_file, main)])
        val executable = in_path + Path.basic "isabelle_quickcheck_narrowing"
        val cmd =
          "exec \"$ISABELLE_GHC\" " ^ Code_Haskell.language_params ^ " " ^ ghc_options ^ " " ^
            (implode_space
              (map File.bash_platform_path
                (map fst includes @ [code_file, narrowing_engine_file, main_file]))) ^
          " -o " ^ File.bash_platform_path executable ^ ";"
        val compilation_time =
          Isabelle_System.bash_process (Bash.script cmd)
          |> Process_Result.check
          |> Process_Result.timing_elapsed |> Time.toMilliseconds
          handle ERROR msg => cat_error "Compilation with GHC failed" msg
        val.add_timing (Haskellcompilation,compilation_time) current_result
        fn narrowings => mk_equations descr vs narrowings, NONE)
        fun with_size genuine_only k =
          if k > size then (NONE, !current_result)
          else
            let
              val _ = verbose_message ("[Quickcheck-narrowing] Test data size: " ^ string_of_int k)
              val _ = current_size := k
              val res =
                Isabelle_System.bash_process (Bash.script
                  (File.bash_path executable ^ " " ^ haskell_string_of_bool genuine_only ^ " " ^
                    string_of_int k))
                |> Process_Result.check
              val response = Process_Result.out res
              val timing = res |> Process_Result.timing_elapsed |> Time.toMilliseconds;
              val _ =
                Quickcheck.add_timing
                  ("execution of size " ^ string_of_int k, timing) current_result
            in
              if response = "NONE" then with_size genuine_only (k + 1)
              else
                let
                  val output_value = the_default "NONE"
                    (try (snd o split_last o filter_out (fn s => s = "") o split_lines) response)
                  val ml_code =
                    "\nval _ = Context.put_generic_context (SOME (Context.map_proof (" ^ put_ml
                    ^ " (fn () => " ^ output_value ^ ")) (Context.the_generic_context ())))"
                  val ctxt' = ctxt
                    |> put (fn () => error ("Bad evaluation for " ^ quote put_ml))
                    |> Context.proof_map (exec false ml_code)
                  val counterexample = get ctxt' ()
                in
                  if is_genuine counterexample then
                    (counterexample, !current_result)
                  else
                    let
                      val cex = Option.map (rpair []) (counterexample_of counterexample)
                      val _ = message (Pretty.string_of (Quickcheck.pretty_counterex ctxt false cex))
                      val _ = message "Quickcheck continues to find a genuine counterexample..."
                    in with_size true (k + 1end
               end
            end
      in with_size genuine_only 0 end
  in with_tmp_dir tmp_prefix run end

fun dynamic_value_strict opts cookie ctxt postproc t =
  let
    fun evaluator program _ vs_ty_t deps =
      Exn.result (value opts ctxt cookie)
        (Code_Target.compilation_text ctxt target program deps true vs_ty_t)
  in Exn.release (Code_Thingol.dynamic_value ctxt (Exn.map_res o postproc) evaluator t) end


(** counterexample generator **)

datatype counterexample =
    Universal_Counterexample of (term * counterexample)
  | Existential_Counterexample of (term * counterexample) list
  | Empty_Assignment

fun map_counterexample _ Empty_Assignment = Empty_Assignment
  | map_counterexample f (Universal_Counterexample (t, c)) =
      Universal_Counterexample (f t, map_counterexample f c)
  | map_counterexample f (Existential_Counterexample cs) =
      Existential_Counterexample (map (fn (t, c) => (f t, map_counterexample f c)) cs)

structure Data = Proof_Data
(
  type T =
    (unit -> (bool * term listoption) *
    (unit -> counterexample option)
  val empty: T =
   (fn () => raise Fail "counterexample",
    fn () => raise Fail "existential_counterexample")
  fun init _ = empty
)

val get_counterexample = #1 o Data.get;
val get_existential_counterexample = #2 o Data.get;

val put_counterexample = Data.map o @{apply 2(1)} o K
val put_existential_counterexample = Data.map o @{apply 2(2)} o K

fun finitize_functions (xTs, t) =
  let
    val (names, boundTs) = split_list xTs
    fun mk_eval_ffun dT rT =
      Const (\<^const_name>\<open>Quickcheck_Narrowing.eval_ffun\<close>,
        Type (\<^type_name>\<open>Quickcheck_Narrowing.ffun\<close>, [dT, rT]) --> dT --> rT)
    fun mk_eval_cfun dT rT =
      Const (\<^const_name>\<open>Quickcheck_Narrowing.eval_cfun\<close>,
        Type (\<^type_name>\<open>Quickcheck_Narrowing.cfun\<close>, [rT]) --> dT --> rT)
    fun eval_function (Type (\<^type_name>\<open>fun\<close>, [dT, rT])) =
          let
            val (rt', rT') = eval_function rT
          in
            (case dT of
              Type (\<^type_name>\<open>fun\<close>, _) =>
                (fn t => absdummy dT (rt' (mk_eval_cfun dT rT' $ incr_boundvars 1 t $ Bound 0)),
                  Type (\<^type_name>\<open>Quickcheck_Narrowing.cfun\<close>, [rT']))
            | _ =>
                (fn t => absdummy dT (rt' (mk_eval_ffun dT rT' $ incr_boundvars 1 t $ Bound 0)),
                  Type (\<^type_name>\<open>Quickcheck_Narrowing.ffun\<close>, [dT, rT'])))
          end
      | eval_function (T as Type (\<^type_name>\<open>prod\<close>, [fT, sT])) =
          let
            val (ft', fT') = eval_function fT
            val (st', sT') = eval_function sT
            val T' = Type (\<^type_name>\<open>prod\<close>, [fT', sT'])
            val map_const = Const (\<^const_name>\<open>map_prod\<close>, (fT' --> fT) --> (sT' --> sT) --> T' --> T)
            fun apply_dummy T t = absdummy T (t (Bound 0))
          in
            (fn t => list_comb (map_const, [apply_dummy fT' ft', apply_dummy sT' st', t]), T')
          end
      |eval_function  = (I, T)
     (tt, boundTs'  split_list m eval_function boundTs)
    val t' = subst_bounds (map2 (fn f => fn x => f x) (rev tt) (map_index (Bound o fst) boundTs), t)
  in
    (names ~~ java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
  end

fun dest_ffun (Type (\<^type_name>\<open>Quickcheck_Narrowing.ffun\<close>, [dT, rT])) = (dT, rT)

fun eval_finite_functions (Const (\<^const_name>\<open>Quickcheck_Narrowing.ffun.Constant\<close>, T) $ value) =
      absdummy (fst (dest_ffun (body_type T))) (eval_finite_functions value)
  | eval_finite_functions (Const (\<^const_name>\<open>Quickcheck_Narrowing.ffun.Update\<close>, T) $ a $ b $ f) =
      let
        val (T1, T2) = dest_ffun (body_type T)
      in
        Quickcheck_Common.mk_fun_upd T1 T2
          (eval_finite_functions a, eval_finite_functions bFileread\^>open~~src/ToolsQuickcheck/NF_Narrowing_Enginehs\close
      end
  | eval_finite_functionsML_Compiler0. ML_Env.context


(** tester **)

val
  map (  (Path.exp$SABELLE_HOME_USER +Path.asic name ^serial_string ()java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
    (@thms all_simps} @@{hms )@
  map (HOLogic.dest_eq o HOLogicjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    [@{thm java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 70
    {thm  OF Ex1_def}java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

fun make_pnf_term thy t = Pattern.rewrite_term thy rewrs []  current_size =Unsynchronized. 0

 strip_quantifiers (onst (<^const_name\E\<> )$Abs (, T,t)=
      apfst (cons (\<^const_name>\<open>Ex    valghc_options =Config.et ctxt ghc_options
| strip_quantifiers Const \^>\open>All<close, _)$Abs x,T t))java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
      apfst (cons (\<^ et
 |t  (] )

fun contains_existentials t =
  exists (fn (Q, _) => Q = \<^const_name>\<open>Ex\<close>) (fst (strip_quantifiers t))

fun mk_property qs t =
  let
    fun enclose (\<^const_name>\<open>Ex\<close>, (x, T)) t =
          Const (\<^const_name>\<open>Quickcheck_Narrowing.exists\<close>,
            (T --> \<^typ>\<open>property\<close>) --> \<^typ>\<open>property\<close>) $ Abs (x, T, t)
      | enclose (\<^const_name>\<open>All\<close>, (x, T)) t =
          Const (\<^const_name>\<open>Quickcheck_Narrowing.all\<close>,
            (T --> \<^typ>\<open>property\<close>) --> \<^typ>\<open>property\<close>) $ Abs (x, T, t)
  in fold_rev enclose qs (\<^term>\<open>Quickcheck_Narrowing.Property\<close> $ t) end

fun mk_case_term ctxt p ((\<^const_name>\<open>Ex\<close>, (x, T)) :: qs') (Existential_Counterexample cs) =
      Case_Translation.make_case ctxt Case_Translation.Quiet Name.context (Free (x, T)) (map (fn (t, c) =>
        (t, mk_case_term ctxt (p - 1) qs' c)) cs)
  | mk_case_term ctxt p ((\<^const_name>\<open>All\<close>, _) :: qs') (Universal_Counterexample (t, c)) =
      if p = 0 then t else mk_case_term ctxt (p - 1) qs' c

val post_process =
  perhaps val generatedN_suffix = suffix"hs" Code_Target.generatedN;

fun mk_terms ctxt qs result java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  let
    val ps = filter (fn(_,(\^const_name>\<pen>All\<close>, _) =>true |_ = false)(map_index I qs)
in
    map (valmain_file  = mk_code_file ["Main"]
    |> map         val main =
  end

java.lang.StringIndexOutOfBoundsException: Range [33, 3) out of bounds for length 45
et
    fun dest_result (" "^generatedN^";n"^
    val=
      "Narrowing_Engine. readpotential)(ead ) ("^Code_Target.generatedN ^
       (Config.get ctxt Quickcheck.quiet, Config"value()n\n}\n"
        Config.get rry File.write)
    val thy = Proof_Context.java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 23
    t =fnx) = fnt= mk_all x ,t)(Termadd_frees t[])t
    val pnf_t = make_pnf_term thy t'
  in
ifget ctxt allow_existentials andalso contains_existentials pnf_t then
      let
wrapf(,t)=
          let val (qs1, qs2) =         val =
           ( pair f(s2 t) end
        val finitize = if Config.get java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 26
val(,   finitize(strip_quantifierspnf_t)
        val act = if catch_code_errors then try else (fn f => SOME o f)
        val execute =
          dynamic_value_strict (true, opts)
            ( true, fn _ => error ""),
              (java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
                "Narrowing_Generators.          handle ERROR msg => cat_error "CompilationGHC failed"msg
            ctxt( o Option.omap_counterexample
      in
        (ase act execute (mk_property qs prop_t) 
          SOME (funwith_size genuine_only k =
            {counterexample = Option.map (pair true o mk_terms ctxt qs) counterexample,
            let
            ()   reports(dest_result result)}
        | NONE =>
          (Quickcheck.message ctxt "Conjecture is not executable with Quickcheck-narrowing";
           Quickcheck.empty_result))
      end
    else
      let
        val frees = Term.add_frees t []
               val '= fold_rev absfree frees t
        fun wrap f t  uncurry (fold_rev Term.abs) (f (strip_abs t))
         |>Process_Result.
        fun               val response   .utres
Const\^>\open>Quickcheck_Narrowing.ensure_testable\close>,
            fastype_of t --> fastype_of t) $ t
        fun                Quickcheck.dd_timing
          | is_genuine _ = false
        val counterexample_of =
          if   "ONE  with_size genuine_only (k + 1)
        val actelse
        val execute =
          dynamic_value_strict false,opts
            ((is_genuine,                     (try (snd o split_last (sndosplit_last o filter_out (fn s => s = "") o split_lines) response)
              (get_counterexample, put_counterexample,
                "Narrowing_Generators.put_counterexample"))
ctxt(o Optionmap o apsnd
      in
        (case act execute (ensure_testable (finitize t')) of
          SOME (| put ( ( >error (Bad for"^quote put_ml))
            Quickcheck.Result|>proof_map (exec falseml_code)
             {counterexample = val counterexampleget ctxt' )
              evaluation_terms =ifis_genuinecounterexamplethen
              timings = #timings (dest_result else
              reports = #reports (dest_result                       alcex=Option.(rpair ]) (counterexample_of counterexample)
| NONE=
          (Quickcheck.message ctxt "Conjecture is not                       val _ = message "Quickcheck continues=messageQuickcheckjava.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 96
           Quickcheck.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 18
      end
  end

fun test_goals ctxt catch_code_errors insts goals i with_tmp_dirtmp_prefix run end
  if not (getenv "
    let
      val _ = java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 5
      val correct_inst_goals = Quickcheck_Common.instantiate_goals ctxt      xn.result (value opts ctxt cookie)
    in
      .collect_results (test_term ctxt catch_code_errors)
        (maps (map snd) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
    end
  else
    if Config.get ctxt Quickcheck.uiet then () else writeln
      ("Environment variable ISABELLE_GHC is not set. To use narrowing
        ^ "this variable to your GHC Haskell java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 20
        ^ "To deactivate narrowing-based   | map_counterexample f (Universal_Counterexample map_counterexample f (Universal_Counterexample (t, c)) =
[e])


(* setup *)

val    java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

val _ =
java.lang.StringIndexOutOfBoundsException: Range [5, 2) out of bounds for length 14
    ensure_partial_term_of
    #> Code)= java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 53
    #> java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(<sort><open>narrowing\close,instantiate_narrowing_datatype)
    #> Context.theory_map (Quickcheck.add_tester ("narrowing", (active, test_goals))))

end

Messung V0.5 in Prozent
C=82 H=99 G=90

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet am  2026-08-25) ¤

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