DFA

class DFA : Cloneable

A representation of a deterministic finite automaton (DFA).

Constructors

Link copied to clipboard
fun DFA()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addEdge(    from: State,     to: State,     op: String,     base: String?): Boolean

Creates an edge between two nodes with a given label (operator and optional base).

Link copied to clipboard
fun addState(isStart: Boolean = false, isAcceptingState: Boolean = false): State

Generates a new state and adds it to this FSM.

Link copied to clipboard
open override fun clone(): DFA

Copies the FSM to enable multiple independent branches of execution.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun isAccepted(): Boolean

Checks if the FSM is currently in an accepting state.

Link copied to clipboard
fun makeTransitionWithOp(op: String, node: Node): Boolean

Checks if the transition with operator op is possible from the current state of the FSM. If so, it updates the state of the FSM and returns true. If no transition is possible, returns false. Collects the old state, the edge and the cpg node in the executionTrace

Link copied to clipboard
fun toDotString(): String

Generates the string representing this FSM in DOT format. This allows a simple visualization of the resulting automaton.

Properties

Link copied to clipboard
var currentState: State? = null
Link copied to clipboard
var executionTrace: MutableList<Triple<State, Node, BaseOpEdge>>
Link copied to clipboard
var states: MutableSet<State>