src/HOL/Tools/Nitpick/nitpick_hol.ML
changeset 33557 107f3df799f6
parent 33556 cba22e2999d5
child 33571 3655e51f9958
equal deleted inserted replaced
33556:cba22e2999d5 33557:107f3df799f6
  1604   can (SINGLE (Classical.safe_tac (claset_of ctxt)) #> the
  1604   can (SINGLE (Classical.safe_tac (claset_of ctxt)) #> the
  1605        #> SINGLE (DETERM_TIMEOUT timeout
  1605        #> SINGLE (DETERM_TIMEOUT timeout
  1606                                  (tac ctxt (auto_tac (clasimpset_of ctxt))))
  1606                                  (tac ctxt (auto_tac (clasimpset_of ctxt))))
  1607        #> the #> Goal.finish ctxt) goal
  1607        #> the #> Goal.finish ctxt) goal
  1608 
  1608 
       
  1609 val max_cached_wfs = 100
  1609 val cached_timeout = Unsynchronized.ref (SOME Time.zeroTime)
  1610 val cached_timeout = Unsynchronized.ref (SOME Time.zeroTime)
  1610 val cached_wf_props : (term * bool) list Unsynchronized.ref =
  1611 val cached_wf_props : (term * bool) list Unsynchronized.ref =
  1611   Unsynchronized.ref []
  1612   Unsynchronized.ref []
  1612 
  1613 
  1613 val termination_tacs = [Lexicographic_Order.lex_order_tac,
  1614 val termination_tacs = [Lexicographic_Order.lex_order_tac,
  1637                    priority ("Wellfoundedness goal: " ^
  1638                    priority ("Wellfoundedness goal: " ^
  1638                              Syntax.string_of_term ctxt prop ^ ".")
  1639                              Syntax.string_of_term ctxt prop ^ ".")
  1639                  else
  1640                  else
  1640                    ()
  1641                    ()
  1641        in
  1642        in
  1642          if tac_timeout = (!cached_timeout) then ()
  1643          if tac_timeout = (!cached_timeout)
  1643          else (cached_wf_props := []; cached_timeout := tac_timeout);
  1644             andalso length (!cached_wf_props) < max_cached_wfs then
       
  1645            ()
       
  1646          else
       
  1647            (cached_wf_props := []; cached_timeout := tac_timeout);
  1644          case AList.lookup (op =) (!cached_wf_props) prop of
  1648          case AList.lookup (op =) (!cached_wf_props) prop of
  1645            SOME wf => wf
  1649            SOME wf => wf
  1646          | NONE =>
  1650          | NONE =>
  1647            let
  1651            let
  1648              val goal = prop |> cterm_of thy |> Goal.init
  1652              val goal = prop |> cterm_of thy |> Goal.init