HUCTLp / com.github.sybila / Unary

Unary

interface Unary<out This : Tree, Tree : TreeNode<Tree>> : TreeNode<Tree>

Common interface for unary operators.

Properties

inner abstract val inner: Tree

The singular child element of this object.

Inherited Properties

node abstract val node: Tree

The object which holds the actual data in the tree.

Functions

copy abstract fun copy(inner: Tree = this.inner): This

Create a copy of the original object but optionally replace the child element.

Extension Functions

fold fun <Tree : TreeNode<Tree>, R> TreeNode<Tree>.fold(atom: Tree.() -> R, unary: Unary<*, Tree>.(R) -> R, binary: Binary<*, Tree>.(R, R) -> R): R

Standard tree fold. You can provide transformation operations for atoms, unary and binary nodes.

map fun <Tree : TreeNode<Tree>> TreeNode<Tree>.map(atom: Tree.() -> Tree = { this }, unary: Unary<Tree, Tree>.(Tree) -> Tree = { this.copy(inner = it) }, binary: Binary<Tree, Tree>.(Tree, Tree) -> Tree = { left, right -> this.copy(left, right)}): Tree

Change tree structure while preserving tree type. You can provide transformation operations for atoms, unary and binary nodes. The only requirement is that operations don't change the type of the tree.

Inheritors

At data class At : Formula, Unary<At, Formula>

At operator specifies that a formula holds at the state with the given name.

Bind data class Bind : Formula, Unary<Bind, Formula>

Hybrid operator which specifies that at the inspected state, the target formula holds with name substituted for the inspected state.

Not data class Not : DirFormula, Unary<Not, DirFormula>

Logical negation. A path will match this restriction if it does not match the inner restriction.

Not data class Not : Formula, Unary<Not, Formula>

Logical negation. A state satisfies this formula if it does not satisfy inner.

Temporal interface Temporal<out This : Formula> : Unary<This, Formula>

Common interface for temporal Formulas.