if (string.isEmpty() && !accepted)
throw new IllegalArgumentException("since the initial state is an accept one, a negative string should not be empty");
for(int i = 1;i<=string.size();i++){
List<String> current = string.subList(0, i);
Vertex existing = getVertex(pta,current);
Vertex newVertex = new DirectedSparseVertex();
if (i == string.size())// KIRR: every prefix of a reject sequence is an accept sequence.
newVertex.setUserDatum(JUConstants.ACCEPTED, accepted, UserData.SHARED);
else
newVertex.setUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
if(existing == null){
pta.addVertex(newVertex);
Vertex previous;
previous = getVertex(pta, string.subList(0, i-1));// for i==1, getVertex will return the initial vertex
DirectedSparseEdge e = new DirectedSparseEdge(previous, newVertex);
Set<String> labels = new HashSet<String>();
labels.add(string.get(i-1));
e.addUserDatum(JUConstants.LABEL, labels, UserData.CLONE);