Skip to content

Commit

Permalink
Bugfix: add toString for EnumerationAtom
Browse files Browse the repository at this point in the history
  • Loading branch information
madmike200590 committed Aug 9, 2024
1 parent 1dcdbf0 commit 119e2b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public static Set<List<ConstantTerm<String>>> substringOfString(String str, int
}
}

// TODO we could add something to convert string to list
@Predicate(name = "str_x_xs")
public static Set<List<ConstantTerm<String>>> stringHeadRemainder(String str) {
List<ConstantTerm<String>> xXs = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,7 @@ public Atom renameVariables(String newVariablePrefix) {
@Override
public abstract int hashCode();

@Override
public abstract String toString();

}
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,10 @@ public boolean equals(Object o) {
public int hashCode() {
return 31 * ENUMERATION_PREDICATE.hashCode() + getTerms().hashCode();
}


@Override
public String toString() {
return String.format("%s(%s,%s,%s)", ENUMERATION_PREDICATE.getName(), enumIdTerm, valueTerm, indexTerm);
}

}

0 comments on commit 119e2b1

Please sign in to comment.