src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML
changeset 40301 bf39a257b3d3
parent 40139 6a53d57fa902
child 40840 2f97215e79bf
equal deleted inserted replaced
40300:d4487353b3a0 40301:bf39a257b3d3
  1807             |> Random_Engine.run))*)
  1807             |> Random_Engine.run))*)
  1808         Pos_Random_DSeq =>
  1808         Pos_Random_DSeq =>
  1809           let
  1809           let
  1810             val [nrandom, size, depth] = arguments
  1810             val [nrandom, size, depth] = arguments
  1811           in
  1811           in
  1812             rpair NONE (TimeLimit.timeLimit (Time.fromSeconds 20) (fn () => fst (DSequence.yieldn k
  1812             rpair NONE (TimeLimit.timeLimit (seconds 20.0) (fn () => fst (DSequence.yieldn k
  1813               (Code_Runtime.dynamic_value_strict (Dseq_Random_Result.get, put_dseq_random_result, "Predicate_Compile_Core.put_dseq_random_result")
  1813               (Code_Runtime.dynamic_value_strict (Dseq_Random_Result.get, put_dseq_random_result, "Predicate_Compile_Core.put_dseq_random_result")
  1814                 thy NONE (fn proc => fn g => fn nrandom => fn size => fn s => g nrandom size s |>> DSequence.map proc)
  1814                 thy NONE (fn proc => fn g => fn nrandom => fn size => fn s => g nrandom size s |>> DSequence.map proc)
  1815                   t' [] nrandom size
  1815                   t' [] nrandom size
  1816                 |> Random_Engine.run)
  1816                 |> Random_Engine.run)
  1817               depth true)) ())
  1817               depth true)) ())
  1818           end
  1818           end
  1819       | DSeq =>
  1819       | DSeq =>
  1820           rpair NONE (TimeLimit.timeLimit (Time.fromSeconds 20) (fn () => fst (DSequence.yieldn k
  1820           rpair NONE (TimeLimit.timeLimit (seconds 20.0) (fn () => fst (DSequence.yieldn k
  1821             (Code_Runtime.dynamic_value_strict (Dseq_Result.get, put_dseq_result, "Predicate_Compile_Core.put_dseq_result")
  1821             (Code_Runtime.dynamic_value_strict (Dseq_Result.get, put_dseq_result, "Predicate_Compile_Core.put_dseq_result")
  1822               thy NONE DSequence.map t' []) (the_single arguments) true)) ())
  1822               thy NONE DSequence.map t' []) (the_single arguments) true)) ())
  1823       | Pos_Generator_DSeq =>
  1823       | Pos_Generator_DSeq =>
  1824           let
  1824           let
  1825             val depth = (the_single arguments)
  1825             val depth = (the_single arguments)
  1826           in
  1826           in
  1827             rpair NONE (TimeLimit.timeLimit (Time.fromSeconds 20) (fn () => fst (Lazy_Sequence.yieldn k
  1827             rpair NONE (TimeLimit.timeLimit (seconds 20.0) (fn () => fst (Lazy_Sequence.yieldn k
  1828               (Code_Runtime.dynamic_value_strict (New_Dseq_Result.get, put_new_dseq_result, "Predicate_Compile_Core.put_new_dseq_result")
  1828               (Code_Runtime.dynamic_value_strict (New_Dseq_Result.get, put_new_dseq_result, "Predicate_Compile_Core.put_new_dseq_result")
  1829               thy NONE (fn proc => fn g => fn depth => g depth |> Lazy_Sequence.mapa proc)
  1829               thy NONE (fn proc => fn g => fn depth => g depth |> Lazy_Sequence.mapa proc)
  1830               t' [] depth))) ())
  1830               t' [] depth))) ())
  1831           end
  1831           end
  1832       | New_Pos_Random_DSeq =>
  1832       | New_Pos_Random_DSeq =>
  1833           let
  1833           let
  1834             val [nrandom, size, depth] = arguments
  1834             val [nrandom, size, depth] = arguments
  1835             val seed = Random_Engine.next_seed ()
  1835             val seed = Random_Engine.next_seed ()
  1836           in
  1836           in
  1837             if stats then
  1837             if stats then
  1838               apsnd (SOME o accumulate) (split_list (TimeLimit.timeLimit (Time.fromSeconds 20)
  1838               apsnd (SOME o accumulate) (split_list (TimeLimit.timeLimit (seconds 20.0)
  1839               (fn () => fst (Lazy_Sequence.yieldn k
  1839               (fn () => fst (Lazy_Sequence.yieldn k
  1840                 (Code_Runtime.dynamic_value_strict
  1840                 (Code_Runtime.dynamic_value_strict
  1841                   (Lseq_Random_Stats_Result.get, put_lseq_random_stats_result, "Predicate_Compile_Core.put_lseq_random_stats_result")
  1841                   (Lseq_Random_Stats_Result.get, put_lseq_random_stats_result, "Predicate_Compile_Core.put_lseq_random_stats_result")
  1842                   thy NONE
  1842                   thy NONE
  1843                   (fn proc => fn g => fn nrandom => fn size => fn s => fn depth => g nrandom size s depth
  1843                   (fn proc => fn g => fn nrandom => fn size => fn s => fn depth => g nrandom size s depth
  1844                     |> Lazy_Sequence.mapa (apfst proc))
  1844                     |> Lazy_Sequence.mapa (apfst proc))
  1845                     t' [] nrandom size seed depth))) ()))
  1845                     t' [] nrandom size seed depth))) ()))
  1846             else rpair NONE
  1846             else rpair NONE
  1847               (TimeLimit.timeLimit (Time.fromSeconds 20) (fn () => fst (Lazy_Sequence.yieldn k
  1847               (TimeLimit.timeLimit (seconds 20.0) (fn () => fst (Lazy_Sequence.yieldn k
  1848                 (Code_Runtime.dynamic_value_strict
  1848                 (Code_Runtime.dynamic_value_strict
  1849                   (Lseq_Random_Result.get, put_lseq_random_result, "Predicate_Compile_Core.put_lseq_random_result")
  1849                   (Lseq_Random_Result.get, put_lseq_random_result, "Predicate_Compile_Core.put_lseq_random_result")
  1850                   thy NONE 
  1850                   thy NONE 
  1851                   (fn proc => fn g => fn nrandom => fn size => fn s => fn depth => g nrandom size s depth
  1851                   (fn proc => fn g => fn nrandom => fn size => fn s => fn depth => g nrandom size s depth
  1852                     |> Lazy_Sequence.mapa proc)
  1852                     |> Lazy_Sequence.mapa proc)
  1853                     t' [] nrandom size seed depth))) ())
  1853                     t' [] nrandom size seed depth))) ())
  1854           end
  1854           end
  1855       | _ =>
  1855       | _ =>
  1856           rpair NONE (TimeLimit.timeLimit (Time.fromSeconds 20) (fn () => fst (Predicate.yieldn k
  1856           rpair NONE (TimeLimit.timeLimit (seconds 20.0) (fn () => fst (Predicate.yieldn k
  1857             (Code_Runtime.dynamic_value_strict (Pred_Result.get, put_pred_result, "Predicate_Compile_Core.put_pred_result")
  1857             (Code_Runtime.dynamic_value_strict (Pred_Result.get, put_pred_result, "Predicate_Compile_Core.put_pred_result")
  1858               thy NONE Predicate.map t' []))) ()))
  1858               thy NONE Predicate.map t' []))) ()))
  1859      handle TimeLimit.TimeOut => error "Reached timeout during execution of values"
  1859      handle TimeLimit.TimeOut => error "Reached timeout during execution of values"
  1860   in ((T, ts), statistics) end;
  1860   in ((T, ts), statistics) end;
  1861 
  1861