Class Edge

java.lang.Object
li.selman.jpbe.datastructure.Edge

public class Edge extends Object
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

      public Edge(int from, int to, Set<Expression> expressions)
      Parameters:
      from - start index on a substring of the user provided output string
      to - end index on a substring of the user provided output string
      expressions - all expressions which on input_1 eval to provided_output_1.substring(from, to)
  • Method Details

    • getExpressions

      public Set<Expression> getExpressions()
    • getExpressionsSize

      public int getExpressionsSize()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object