2014-07-14 19:32:44 +00:00
|
|
|
(*
|
|
|
|
* Copyright 2014, General Dynamics C4 Systems
|
|
|
|
*
|
2020-03-09 06:18:30 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
2014-07-14 19:32:44 +00:00
|
|
|
*)
|
|
|
|
|
2016-04-18 20:25:44 +00:00
|
|
|
theory Cache (* FIXME: broken *)
|
2018-06-13 07:55:36 +00:00
|
|
|
imports Main
|
2014-07-14 19:32:44 +00:00
|
|
|
begin
|
|
|
|
|
2019-06-05 10:18:48 +00:00
|
|
|
text \<open>Enable the proof cache, both skipping from it
|
|
|
|
and recording to it.\<close>
|
|
|
|
ML \<open>DupSkip.record_proofs := true\<close>
|
|
|
|
ML \<open>proofs := 1\<close>
|
2014-07-14 19:32:44 +00:00
|
|
|
|
2019-06-05 10:18:48 +00:00
|
|
|
ML \<open>DupSkip.skip_dup_proofs := true\<close>
|
2014-07-14 19:32:44 +00:00
|
|
|
|
2019-06-05 10:18:48 +00:00
|
|
|
text \<open>If executed in reverse order, save the cache\<close>
|
|
|
|
ML \<open>val cache_thy_save_cache = ref false;\<close>
|
|
|
|
ML \<open>
|
2014-07-14 19:32:44 +00:00
|
|
|
if (! cache_thy_save_cache)
|
|
|
|
then File.open_output (XML_Syntax.output_forest
|
|
|
|
(XML_Syntax.xml_forest_of_cache (! DupSkip.the_cache)))
|
|
|
|
(Path.basic "proof_cache.xml")
|
2019-06-05 10:18:48 +00:00
|
|
|
else ()\<close>
|
|
|
|
ML \<open>cache_thy_save_cache := true\<close>
|
|
|
|
ML \<open>cache_thy_save_cache := false\<close>
|
2014-07-14 19:32:44 +00:00
|
|
|
|
2019-06-05 10:18:48 +00:00
|
|
|
text \<open>Load the proof cache
|
|
|
|
- can take up to a minute\<close>
|
2014-07-14 19:32:44 +00:00
|
|
|
|
2019-06-05 10:18:48 +00:00
|
|
|
ML \<open>
|
2014-07-14 19:32:44 +00:00
|
|
|
DupSkip.the_cache := XML_Syntax.cache_of_xml_forest (
|
|
|
|
File.open_input (XML_Syntax.input_forest)
|
2019-06-05 10:18:48 +00:00
|
|
|
(Path.basic "proof_cache.xml"))\<close>
|
2014-07-14 19:32:44 +00:00
|
|
|
|
|
|
|
end
|