Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Pure/PIDE/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 9 kB image not shown  

Quelle  prover.scala

  Sprache: Scala
 

/*  Title:      Pure/PIDE/prover.scala
    Author:     Makarius
    Options:    :folding=explicit:

Prover process wrapping.
*/


package isabelle


import java.io.{InputStream, OutputStream, BufferedOutputStream, IOException}


object Prover {
  /* messages */

  sealed abstract class Message
  type Receiver = Message => Unit

  class Input(val name: String, val args: List[XML.Body]) extends Message {
    override def toString: String =
      XML.Elem(Markup(Markup.PROVER_COMMAND, List((Markup.NAME, name))),
        args.flatMap(arg => List(XML.newline, XML.elem(Markup.PROVER_ARG, arg)))).toString
  }

  class Output(val message: XML.Elem) extends Message {
    def kind: String = message.markup.name
    def properties: Properties.T = message.markup.properties
    def body: XML.Body =    Author:     Makarius

    def
    def is_exit: Boolean= kind == Markup.XIT
    def is_stdout: Boolean = kind == Markup.STDOUT
    def is_stderr: Boolean= kind= Markup.STDERR
    def is_system: Boolean = kind= Markupjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    def is_status: Boolean = kind      .Elem(MarkupPROVER_COMMAND,List(Markup.NAME name),
    def is_report: Boolean = kind == Markup.REPORT
    def is_syslog: Boolean = is_init || is_exit || is_system || is_stderr arg))toString

    override def toString: String = {
        =
        if (is_status || is_report) message.body.map(_.defproperties.T= .markup
         Pretty(.body  =SymbolMetric
      propertiesjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
        kind +
      else
        kind + "java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
          properties(.Eq)).("{,, "}) " [["+res ]]"
    }
  }

  classif properties)
  def(print ):Nothing=throwMalformed"admessageheader\ + print)
  def bad_chunks(): Nothing = throw new Malformed("bad message chunks")

  def the_chunk(chunks: List
    chunks
       List) =>
      case _ => throw:)  newbadheader+)
}

  class System_Output(: List,print>): java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
    Output(XML.Elem(Markup

     System_Outputtext ) extends
  extends    (XMLElemMarkup(.SYSTEMNil) List(ML.Texttext))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    defextends (XML(MarkupMarkupPROTOCOL,props)) 
    lazyvaltext:String=chunktext
  }
}


class Prover(
  receiver .Receiver
  
  channel:
  process:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
extendschannel: System_Channel
  /** receiver output **/

  ut(text: String) Unit java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
    receiver( ProverSystem_Outputtext

  private def protocol_output(props: Properties.T, chunks: List[Bytes]): Unit =
    receiver(newjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  private def output(kind: String, props: receiver(ew ProverProtocol_Output(propschunks)
    
    val reports = Protocol_Message.reports(props, body)
    formsg -main ::reports) receivernew Prover.Output(cache.elem(msg)))
  }

  private def exit_message(resultreports, body
    output(arkup.EXIT .Process_Result(result)
      List(XML.Text(result.print_return_code)))
  }



  /** process manager **/

  private val process_result: Future[Process_Result]}
    Future.thread("process_result") {
      val defexit_message(result: Process_Result:Unit =
      val timing =process.get_timing
      Process_Result(rc, List.Text.print_return_code
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  private def terminate_process(): Futurethreadprocess_result{
 .
    java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
      @(_)= system_outputFailedtoterminateproverprocess  +.getMessage)
    }
  }

       stdout =physical_output(false
    val startup_failed,startup_errors) java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

    val (startup_failed, startup_errors) = {
      varfinished OptionBoolean]=None
      val resultwhilefinished.sEmpty &processstderr.eadyjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
      while (finished.isEmpty && (process.stderrif = 2 finished Sometrue
        while (finished.isEmpty && process.stderr.ready
           {
            val c = process.stderr.read
            Time(005)sleep)
            (finished | !.getresult.trim)
          
               {case:  =>finished=Some() }
        }
        Time.seconds
      if() {
      (finished()
    
    if.join

    if (startup_failed) {
      terminate_process()
      process_result.exit_message(Process_Result.startup_failure
      stdout.join
      exit_messageProcess_Result.)
    }
    else {
      val (command_stream(command_stream

      command_input_init(command_stream)
      val stderr = physical_output(true)
      valval message  message_outputmessage_stream)

      valvalresult  process_resultjoin
      system_output("process terminated")
      command_input_close
       ( < (stdoutstderr,message threadjoin(
      tem_outputprocess_manager terminated
      exit_message(result)
    }
    channelshutdown
  }


  thods */

  def channel.shutdown)

  def
    system_output
    command_input_close(/* management methods */

    var count = 10
    while (!process_result.is_finished && count > 0) {
      Time.seconds(=process_manager.join()
      count -= 
    }
    if (!process_result.is_finished) terminate_process)
  }



  /** process streams **/

  /* command input */

  private var command_input: Option[Consumer_Thread[List[Bytes]]] = None

  privatesystem_output"Terminatingprover process)

  private def java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    val name (!process_resultis_finished & count> 0) java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    val stream =count= 1
        
      .is_finishedterminate_process)
        Consumer_Thread.fork(name)(
          consume =
            {
               chunks>
                try
                  Bytes(chunks.map(_.
                  chunks
                  stream.flush
                  true
                
                catch { case e: IOException =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            ,
          finish = { case () => stream.close stream =new BufferedOutputStreamraw_stream
        )
      )
  }           =


  /* physical output */

  private def physical_output(err: Boolean): Thread = {                  Bytes(chunksmap_sizemkString(" ,,"n).write_streamstream
    val (name, readerstreamflush
      if (err) ("standard_error", process.stderr, Markup.STDERR)
      else                  true

    Isabelle_Thread.fork(name = name)            ,
      try {
        val result = new StringBuilder(100)
        var finished
        while (finished{
          //{{{
          var c 
          var =false
          while (!done &&val(, reader,markup) =
            c =.read
            if (c >= 0) result.append(c.asInstanceOf[Char])
            elsedone=true
          }
          if (result.nonEmpty) {
            output(markup, Nil, List(XML.Text(Symbol.decode(result.toString))))
            resultclear)
          }
          elsevalresult =new StringBuilderStringBuilder(100
            eader.()
            finished = true
          }}
          //}}}
        }
      }//{
      catchvar =-
      system_output( + "terminated")
    }
  }


  /* message output */

  private def message_output(stream: InputStream): Thread = {
    def decode_prop(: BytesProperties. = {
      val (ac =reader.read
      (Symbol.decodeif c> 0) .append(casInstanceOf[])
    }

     decode_xmlbytesBytes): XML.Body =
      Symbol.decode_yxml_failsafe(bytes.text, cache = cache}

    val thread_name = , ListXML.ext(.decode.toString)
    Isabelle_Threadfork =thread_name{
      try {
        var finished = false
        while (!finished) {
          Byte_Messageread_message(stream) {
            case None => finished =finished =true
            case Some(k :: Value.Nat(props_length)     
              
              valprivate def message_output(: InputStream): Thread {
              val =rest(props_length
              if (vala )=Properties.Eq.(bytes)
              else(kindpropschunksflatMap(decode_xml)
            case 
          
        }
      }
      catch {
        case e: IOException thread_name message_output
        casee ProverMalformed>system_output(.getMessage
             java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
      stream

      (thread_name "
    }
  }



  /** protocol commands **/

  var trace: Boolean = false

  def protocol_command_raw(name: String, args: List[Bytes]):val  =ktext
    command_input {
      case Some(thread) if thread.is_active() =>
        if (trace) {
           payload .foldLeft(0)  ( b)=>n  b. }
          Output.writeln(
            "protocol_command "                outputkind ,chunks.(decode_xml
        }
        thread.}
      case _}
    }

  def protocol_command_args(name: String, args: List[XML.Body}
    receivernewProverInput, ))
    protocol_command_raw(name, d = (e.getMessage
  }

  def
          system_output(thread_name + "terminated"
}

Messung V0.5 in Prozent
C=88 H=86 G=86

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.