Packages

class KeYmaeraXParser extends Parser with TokenParser with Logging

KeYmaera X parser reads input strings in the concrete syntax of differential dynamic logic of KeYmaera X.

Also consider using the alternative parser DLParser.

Example:
  1. Parsing formulas from strings is straightforward using edu.cmu.cs.ls.keymaerax.parser.KeYmaeraXParser.apply:

    val parser = KeYmaeraXParser
    val fml0 = parser("x!=5")
    val fml1 = parser("x>0 -> [x:=x+1;]x>1")
    val fml2 = parser("x>=0 -> [{x'=2}]x>=0")
    // parse only formulas
    val fml3 = parser.formulaParser("x>=0 -> [{x'=2}]x>=0")
    // parse only programs/games
    val prog1 = parser.programParser("x:=x+1;{x'=2}")
    // parse only terms
    val term1 = parser.termParser("x^2+2*x+1")
See also

edu.cmu.cs.ls.keymaerax.parser

DLParser

Grammar

Wiki

Linear Supertypes
Logging, LazyLogging, LoggerHolder, TokenParser, Parser, (String) ⇒ Expression, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. KeYmaeraXParser
  2. Logging
  3. LazyLogging
  4. LoggerHolder
  5. TokenParser
  6. Parser
  7. Function1
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new KeYmaeraXParser(LAX_MODE: Boolean)

Type Members

  1. type TokenStream = List[Token]

    Lexer's token stream with first token at head.

    Lexer's token stream with first token at head.

    Definition Classes
    TokenParser

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val LAX_MODE: Boolean
  5. def andThen[A](g: (Expression) ⇒ A): (String) ⇒ A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  6. def annotationListener: (Program, Formula) ⇒ Unit

    Returns the annotation listener.

    Returns the annotation listener.

    Definition Classes
    KeYmaeraXParserParser
  7. def apply(input: String, lax: Boolean): Expression

    Parse the input string in the concrete syntax as a differential dynamic logic expression

  8. def apply(input: String): Expression

    Parse the input string in the concrete syntax as a differential dynamic logic expression

    Parse the input string in the concrete syntax as a differential dynamic logic expression

    input

    the string to parse as a dL formula, dL term, or dL program.

    Definition Classes
    KeYmaeraXParserParser → Function1
    Exceptions thrown

    ParseException if input is not a well-formed expression of differential dynamic logic or differential game logic.

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. def compose[A](g: (A) ⇒ String): (A) ⇒ Expression
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  12. val differentialProgramParser: (String) ⇒ DifferentialProgram

    Parse the input string in the concrete syntax as a differential dynamic logic differential program.

    Parse the input string in the concrete syntax as a differential dynamic logic differential program.

    Definition Classes
    KeYmaeraXParserParser
    Exceptions thrown

    ParseException whenever its input is not a well-formed differential program of differential dynamic logic or differential game of differential game logic.

  13. val differentialProgramTokenParser: (KeYmaeraXParser.TokenStream) ⇒ DifferentialProgram

    Parse the input tokens in the concrete syntax as a differential dynamic logic differential program

    Parse the input tokens in the concrete syntax as a differential dynamic logic differential program

    Definition Classes
    KeYmaeraXParserTokenParser
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. val formulaParser: (String) ⇒ Formula

    Parse the input string in the concrete syntax as a differential dynamic logic formula.

    Parse the input string in the concrete syntax as a differential dynamic logic formula.

    Definition Classes
    KeYmaeraXParserParser
    Exceptions thrown

    ParseException whenever its input is not a well-formed formula of differential dynamic logic or differential game logic.

  18. val formulaTokenParser: (TokenStream) ⇒ Formula

    Parse the input token stream in the concrete syntax as a differential dynamic logic formula

    Parse the input token stream in the concrete syntax as a differential dynamic logic formula

    Definition Classes
    KeYmaeraXParserTokenParser
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. lazy val laxParser: KeYmaeraXParser
  23. lazy val logger: Logger
    Attributes
    protected
    Definition Classes
    LazyLogging → LoggerHolder
  24. final val loggerName: String
    Attributes
    protected
    Definition Classes
    LoggerHolder
  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. def parse(input: TokenStream, lax: Boolean): Expression
  29. def parse(input: TokenStream): Expression

    Parse the input tokens in the concrete syntax as a differential dynamic logic expression

    Parse the input tokens in the concrete syntax as a differential dynamic logic expression

    input

    the token stream to parse as a dL formula, dL term, or dL program.

    Definition Classes
    KeYmaeraXParserTokenParser
    Exceptions thrown

    ParseException if input is not a well-formed expression of differential dynamic logic or differential game logic.

  30. lazy val printer: KeYmaeraXPrettyPrinter.type

    A pretty-printer that can write the output that this parser reads

    A pretty-printer that can write the output that this parser reads

    Definition Classes
    KeYmaeraXParserParser
  31. val programParser: (String) ⇒ Program

    Parse the input string in the concrete syntax as a differential dynamic logic program.

    Parse the input string in the concrete syntax as a differential dynamic logic program.

    Definition Classes
    KeYmaeraXParserParser
    Exceptions thrown

    ParseException whenever its input is not a well-formed program of differential dynamic logic or game of differential game logic.

  32. val programTokenParser: (KeYmaeraXParser.TokenStream) ⇒ Program

    Parse the input tokens in the concrete syntax as a differential dynamic logic program

    Parse the input tokens in the concrete syntax as a differential dynamic logic program

    Definition Classes
    KeYmaeraXParserTokenParser
  33. val sequentParser: (String) ⇒ Sequent

    Parse the input string in the concrete syntax as a differential dynamic logic sequent.

    Parse the input string in the concrete syntax as a differential dynamic logic sequent.

    Definition Classes
    KeYmaeraXParserParser
    Exceptions thrown

    ParseException whenever its input is not a well-formed sequent of differential dynamic logic or differential game logic.

  34. def setAnnotationListener(listener: (Program, Formula) ⇒ Unit): Unit

    Register a listener for @annotations during the parse.

    Register a listener for @annotations during the parse.

    Definition Classes
    KeYmaeraXParserParser
    To do

    this design is suboptimal.

  35. lazy val strictParser: KeYmaeraXParser
  36. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  37. val termParser: (String) ⇒ Term

    Parse the input string in the concrete syntax as a differential dynamic logic term.

    Parse the input string in the concrete syntax as a differential dynamic logic term.

    Definition Classes
    KeYmaeraXParserParser
    Exceptions thrown

    ParseException whenever its input is not a well-formed term of differential dynamic logic or differential game logic.

  38. val termTokenParser: (KeYmaeraXParser.TokenStream) ⇒ Term

    Parse the input tokens in the concrete syntax as a differential dynamic logic term

    Parse the input tokens in the concrete syntax as a differential dynamic logic term

    Definition Classes
    KeYmaeraXParserTokenParser
  39. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  40. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Logging

Inherited from LazyLogging

Inherited from LoggerHolder

Inherited from TokenParser

Inherited from Parser

Inherited from (String) ⇒ Expression

Inherited from AnyRef

Inherited from Any

Ungrouped