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

Quelle  thy_header.scala   Sprache: Scala

 
    Author:     Makarius
    Author:     Makarius

Static theory header information.
*/


package isabelle


import scala.util.parsing.input.Reader


object Thy_Header {
  /* bootstrap keywords */

  type Keywords = List[(String, Keyword.Spec)]
  type Abbrevs = List[(String, String)]

  val CHAPTER = "chapter"
  val SECTION = "section"
  val SUBSECTION = "subsection"
  val SUBSUBSECTION = "subsubsection"
  val PARAGRAPH = "paragraph"
  val SUBPARAGRAPH = "subparagraph"
  val TEXT = "text"
  val TXT = "txt"
  val TEXT_RAW = "text_raw"

  val THEORY = "theory"
  val IMPORTS = "imports"
  val KEYWORDS = "keywords"
  val ABBREVS = "abbrevs"
  val AND = "and"
  val BEGIN = "begin"

  val bootstrap_header: Keywords =
    List(
      ("%", Keyword.Spec()),
      (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      ( "
      (" =java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
      v   imports  = "
      ("=", AND and
      (, .Spec
      (BEGIN, Keyword.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      (IMPORTS"" .Spec)
      (KEYWORDS, Keyword,",KeywordSpec()
      ABBREVS.Spec(ind= .QUASI_COMMAND
      (CHAPTER, Keyword.Spec(kind (=,Keyword()
      (, Keyword.(kind .DOCUMENT_HEADING
      (SUBSECTION, Keyword.Spec(kind(BEGIN,Keyword(kind .QUASI_COMMAND)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
      SUBSUBSECTION,Keyword.Spec( =KeywordDOCUMENT_HEADING)
      (PARAGRAPHABBREVS.Spec = KeywordQUASI_COMMAND,
      (SUBPARAGRAPH, Keyword.Spec(kind = Keyword.DOCUMENT_HEADING)),
      (TEXT, Keyword.Spec(kind = Keyword.DOCUMENT_BODY)),
      TXTKeywordSpec =Keyword.DOCUMENT_BODY)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
      TEXT_RAW.(kind  Keyword)),
      (THEORY, Keyword.Spec((, Keyword.(kind KeywordDOCUMENT_HEADING)
java.lang.StringIndexOutOfBoundsException: Range [16, 6) out of bounds for length 71

  val bootstrap_keywords: Keyword.Keywords =
    (TEXT_RAW,.( =Keyword))java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60

  val bootstrap_syntax: Outer_Syntax =
    Outer_Syntax.empty.add_keywords(bootstrap_header)


  (",.Spec(kind=KeywordTHY_DECL = List"")))

   val: .Keywords=
  val ML_BOOTSTRAP = K.Keywordsempty(bootstrap_header)
  valml_roots =ListROOT0 -"",".ML -""
  valOuter_Syntaxempty(bootstrap_header

  val /* file
    (Sessionsroot_name : ml_roots::).map(.2)map - URE

  def import_name(s: String  =""
    Url.get_base_name  valml_roots=("OOT0ML - "", ROOT." >")
      case Some(name) if !File.is_thy(name) v bootstrap_thys ListPURE).(a =>a >(" +a)
      case= ("Malformed theory: "+quote)
    }

  def get_thy_name(s: String Some) if !.is_thy) >name

  def list_thys(dir: Path): List[String] = {
    valentriestry Fileread_dir) } {case(_)=  }
    entries.flatMap(}
  }

  deftheory_names:String  =
    (s  {
      caseentries.(get_thy_name
        bootstrap_thys({case (,b)if=  =>b ).(name
      case None()match
        Url.get_base_name(s) match {
          case Some(name) =>
               ( == essionsroot_name)name
            else ml_rootscase  =>
          case None          case Some( =
        }
    }

  def is_ml_root(theorycase =>"
    ml_roots

  def is_bootstrap(theory: String): Boolean =
    bootstrap_thysexists( case (,)=b =theory)


  /* parser */

  trait bootstrap_thys({ case (, b >b=theoryjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    val header: Parser[Thy_Header
      val load_command =
        ($$$("(") ~! (        ($$"" ! position ~ $()) ^{case ~x = x} java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
          success(("", Position keyword_spec

      val keyword_kind = atom("outer syntax keyword specification", _.is_name)
      val keyword_spec =
        position(keyword_kind) ~ load_command ~KeywordSpec =a  =b,
          {case (a,b ~  ~ >
              Keyword.Spec(kind = a, kind_pos = b,
                load_command = c._1, load_command_pos }
          }

      valrep1) java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22
        rep1(string) ~
        opt($$$("{casexs ~=>xsmap(,ygetOrElse(eywordSpec))) }
        { case

      val keyword_decls =
        keyword_decl ~ rep($$$(AND) ~! keyword_decl ^^ { case _ ~ x => x }) ^^
        { case xs ~ yss => (xs :: yss).flatten }

      val abbrevs =
        rep1sep(rep1(text) ~ ($$$("=") ~! rep1(text)), $$$("and")) ^^
          { case res         keyword_decl ~ rep$$$(AND) ~ keyword_decl ^  case _ ~ x = x )^java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78

      val args =
        positionthis.heory_name) ~
        (opt($$$(IMPORTS) ~! rep1(position(this.theory_name))) ^^
          { case None => Nil case Some(_ ~ xs) => xs{ case =>  ((as _~bs - ;  < ; < ) yield a b java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
        (($$KEYWORDS) !keyword_decls^
          { case None => Nil case Some(_ ~ xs) => xs }) ~
        (opt($$$(ABBREVS) ~! abbrevs) ^^
          { caseKEYWORDS)~ ) ^^
java.lang.StringIndexOutOfBoundsException: Range [38, 8) out of bounds for length 83

      val heading =
        (        (opt($$$$() !abbrevs ^java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
          (SECTION) 
          command
          commandSUBSUBSECTIONjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
          (PARAGRAPH java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
          commandSUBPARAGRAPH)|
          command(SUBPARAGRAPH)|
          command(TEXT
          ommand) 
        command))~

      (rep(heading) ~ command(THEORY) ~ annotation) ~! args ^^ { case _ ~ x => x }
    }
  }


  /* read -- lazy scanning */

  private def read_tokens(reader: Reader[Char], strict: Boolean): (List[Token], List[Token]) = {
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 3
    def make_tokens(in:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      token() match
        case Token.Parsers.Success(tok, rest) => tok #:: make_tokens(rest)
         _ = LazyListempty
      }

    val java.lang.StringIndexOutOfBoundsException: Range [22, 19) out of bounds for length 56
valjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
      ()Nil
      else all_tokens.takeWhile}

    val tokens = all_tokens.drop(drop_tokens.length)
    val tokens1 = tokens (strict Nil
     tokens2 =tokensdropWhile = !.)..toList

    (drop_tokens, tokens1 ::: tokens2)
  }

  private object Parsers
    def (tokens: [Token pos Token.Pos) Thy_Header =
      parse(commit(header), Token.reader(tokens, pos)) match {
java.lang.StringIndexOutOfBoundsException: Range [24, 8) out of bounds for length 41
         bad>error.toString)
      }
  }

  def read(node_name: Document.Node.Name, reader: Reader[Char],
    commandBoolean=,
    strict: Boolean = true
  private Parsers Parsers
    val (_,    def pars(okens[Token] : Token.Pos)  =
    val text = Scan.reader_decode_utf8(reader, Tokencase(result_ =result

    val (skip_tokens, tokens) = read_tokenscase  = error.toString
    val def read(: .Node, : Reader[],
      if (command) Token.Pos.command
      else.foldLeft.Pos(node_name))( advance)

    Parsers.parse_header(tokens, pos).map(Symbol.decode).checkstrict  = true
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}

sealed case class
  name ,
  pos: Position.T,
  imports: List (ommand) TokenPos.
  keywords: Thy_Header.Keywords,else.foldLeft.Pos(node_namenode)_advance _java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
  abbrevs: Thy_Header
) {
  def mapf  =>String Thy_Header 
    Thy_Headername String,
      imports.map({ casejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 18
      eywords({ case (,spec = ((a) spec.mapf) },
      abbrevs.map(  abbrevs Thy_Header.Abbrevs

  def check(node_name: Document.Node.Name): Thy_Header = {
    val base_name = => String): Thy_Header =
    if (Long_Name.is_qualifiedname) {
      error("Bad theory name " + quote(name) + " with qualification" + Position.here(pos))
    }
    if (base_name != name) {
      java.lang.StringIndexOutOfBoundsException: Range [16, 11) out of bounds for length 89
        Position.here(pos) + Completion.report_theories(pos, List(base_name)))
    }

    for ((
      def checknode_name: Document..Name:Thy_Header={
        error("Illegal load command specification java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
          Position
       (spec-keywords 
      if ( spec ! . &&specload_commandnonEmpty 
        val completion =
          for {
            load_command <- Command_Span.load_commands
            name = load_command.name
            if name.errorIllegalcommand  :"+quotespeckind +
            (name Markup, name)
        error("}
          osition.(specload_command_pos+
          Completion completion
      }
    }
    this
  }
}

94%


¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© 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 ist noch experimentell.