Package li.selman.jpbe.datastructure
Class Edge
java.lang.Object
li.selman.jpbe.datastructure.Edge
An edge represents a set of programs which evaluate to a substring of the intended output string.
An edge is part of a directed acyclic graph (DAG).
For example: Given input i_1
and output o_1
, we generate a graph with
n * (n - 1) / 2
edges where n = o_1.length
,
because we generate an edge for each possible substring made out of o_1
.
from
represents the start index of such substring and to
the end index.
While expressions
contains all valid expressions in our DSL for which following constraint holds true.
For each expression exp
in Expression | exp.apply(i_1) == o_1.substring(from, to)
For example: Given i_1 = "Joe Bob 1990.12.3" and output o_1 = "Bob 1990", we might have the following edge:
Edge(0, 3, { CStr("Bob"), SubStr(CPos(4), CPos(7), ... })
where all expression on i_1 would eval to "Bob".
-
Field Details
-
from
public final int from -
to
public final int to
-
-
Constructor Details
-
Edge
- Parameters:
from
- start index on a substring of the user provided output stringto
- end index on a substring of the user provided output stringexpressions
- all expressions which on input_1 eval to provided_output_1.substring(from, to)
-
-
Method Details