src/HOL/Matrix/Compute_Oracle/compute.ML
changeset 46537 84f20233d466
parent 46536 09ee87ef8b43
equal deleted inserted replaced
46536:09ee87ef8b43 46537:84f20233d466
    18     val theory_of : computer -> theory
    18     val theory_of : computer -> theory
    19     val hyps_of : computer -> term list
    19     val hyps_of : computer -> term list
    20     val shyps_of : computer -> sort list
    20     val shyps_of : computer -> sort list
    21     (* ! *) val update : computer -> thm list -> unit
    21     (* ! *) val update : computer -> thm list -> unit
    22     (* ! *) val update_with_cache : computer -> term list -> thm list -> unit
    22     (* ! *) val update_with_cache : computer -> term list -> thm list -> unit
    23     (* ! *) val discard : computer -> unit
       
    24     
    23     
    25     (* ! *) val set_naming : computer -> naming -> unit
    24     (* ! *) val set_naming : computer -> naming -> unit
    26     val naming_of : computer -> naming
    25     val naming_of : computer -> naming
    27     
    26     
    28     exception Compute of string    
    27     exception Compute of string    
   321         ()
   320         ()
   322     end
   321     end
   323 
   322 
   324 fun update computer raw_thms = update_with_cache computer [] raw_thms
   323 fun update computer raw_thms = update_with_cache computer [] raw_thms
   325 
   324 
   326 fun discard computer =
       
   327     let
       
   328         val _ = 
       
   329             case prog_of computer of
       
   330                 ProgBarras p => AM_Interpreter.discard p
       
   331               | ProgBarrasC p => AM_Compiler.discard p
       
   332               | ProgHaskell p => AM_GHC.discard p
       
   333               | ProgSML p => AM_SML.discard p
       
   334         val _ = (ref_of computer) := NONE
       
   335     in
       
   336         ()
       
   337     end 
       
   338                                               
       
   339 fun runprog (ProgBarras p) = AM_Interpreter.run p
   325 fun runprog (ProgBarras p) = AM_Interpreter.run p
   340   | runprog (ProgBarrasC p) = AM_Compiler.run p
   326   | runprog (ProgBarrasC p) = AM_Compiler.run p
   341   | runprog (ProgHaskell p) = AM_GHC.run p
   327   | runprog (ProgHaskell p) = AM_GHC.run p
   342   | runprog (ProgSML p) = AM_SML.run p    
   328   | runprog (ProgSML p) = AM_SML.run p    
   343 
   329