src/HOL/Tools/ATP/system_on_tptp.scala
changeset 73418 7d7d959547a1
child 73419 22f3f2117ed7
equal deleted inserted replaced
73417:1dcc2b228b8b 73418:7d7d959547a1
       
     1 /*  Title:      HOL/Tools/ATP/system_on_tptp.scala
       
     2     Author:     Makarius
       
     3 
       
     4 Support for remote ATPs via SystemOnTPTP.
       
     5 */
       
     6 
       
     7 package isabelle.atp
       
     8 
       
     9 import isabelle._
       
    10 
       
    11 import java.net.URL
       
    12 
       
    13 
       
    14 object SystemOnTPTP
       
    15 {
       
    16   def get_url(options: Options): URL = Url(options.string("SystemOnTPTP"))
       
    17 
       
    18   def proper_lines(text: String): List[String] =
       
    19     Library.trim_split_lines(text).filterNot(_.startsWith("%"))
       
    20 
       
    21   def list_systems(url: URL): List[String] =
       
    22   {
       
    23     val result =
       
    24       HTTP.Client.post(url, user_agent = "Sledgehammer", parameters =
       
    25         List("NoHTML" -> 1,
       
    26           "QuietFlag" -> "-q0",
       
    27           "SubmitButton" -> "ListSystems",
       
    28           "ListStatus" -> "READY"))
       
    29     proper_lines(result.text)
       
    30   }
       
    31 
       
    32   object List_Systems extends Scala.Fun("SystemOnTPTP.list_systems")
       
    33   {
       
    34     val here = Scala_Project.here
       
    35     def apply(url: String): String = cat_lines(list_systems(Url(url)))
       
    36   }
       
    37 }