Packages

sealed case class PosInExpr(pos: List[Int] = Nil) extends Product with Serializable

Positions identify subexpressions of an expression. A position is a finite sequence of binary numbers where

  • 0 identifies the left or only subexpression of an expression and
  • 1 identifies the right subexpression of an expression. For example, 0.1 is the right child of the left child. And, 0.1.0.0 is the left child of the left child of the right child of the left child.
Example:
  1. import StringConverter._
    val fml = "(x>2 & x+1<9) -> [x:=2*x+1; y:=0;] x^2>=2".asFormula
    // explicitly use FormulaAugmentor
    print(FormulaAugmentor(fml).sub(PosInExpr(0::0::Nil)))        // x>2
    
    // implicitly use FormulaAugmentor functions on formulas
    import Augmentors._
    print(fml.sub(PosInExpr(0::0::Nil)))        // x>2;
    
    print(fml.sub(PosInExpr(0::1::Nil)))        // x+1<9
    print(fml.sub(PosInExpr(0::1::0::Nil)))     // x+1
    print(fml.sub(PosInExpr(0::1::0::0::Nil)))  // x
    print(fml.sub(PosInExpr(0::1::0::1::Nil)))  // 1
    print(fml.sub(PosInExpr(0::1::1::Nil)))     // 9
    print(fml.sub(PosInExpr(1::1::Nil)))        // x^2>=2
    print(fml.sub(PosInExpr(1::0::Nil)))        // x:=2*x+1; y:=0;
    print(fml.sub(PosInExpr(1::0::0::Nil)))     // x:=2*x+1;
    print(fml.sub(PosInExpr(1::0::1::Nil)))     // y:=0;
    print(fml.sub(PosInExpr(1::0::0::1::Nil)))  // 2*x+1
See also

edu.cmu.cs.ls.keymaerax.btactics.TactixLibrary.positionOf()

Context.at()

Context.replaceAt()

Context.splitPos()

Augmentors

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PosInExpr
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PosInExpr(pos: List[Int] = Nil)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++(appendChild: PosInExpr): PosInExpr

    Append child to obtain position of given subexpression by concatenating appendChild to this.

  4. def ++(appendChild: Int): PosInExpr

    Append child to obtain position of given subexpression.

  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def child: PosInExpr

    The child that this position refers to, i.e., the tail one level down

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def head: Int

    Head: The top-most position of this position

  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def isPrefixOf(p: PosInExpr): Boolean

    Whether this position is a prefix of p

  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. def parent: PosInExpr

    The parent of this position, i.e., one level up

  19. val pos: List[Int]
  20. def prettyString: String
  21. def sibling: PosInExpr

    The sibling of this position (flip last position from left to right and right to left)

  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    PosInExpr → AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped