String
-
string_concat(?a, ?b, ?res)
: Concatenate two strings.At least two arguments must be grouneded. Resolves if
a
+b
=res
. If one of the argument is ungrounded, this predicate constrains it so that the statement is true, by either concating the two strings or removing a prefix or suffix fromres
.f-strings act as a syntatic sugar for this predicate:
X = f"${a}(content of b)"
,X = f"(content of a)${b}
orX = f"${a}${b}"
is equivalent tostring_concat(a, b, X)
.Due to the limitation of our logic resolution algorithm, this predicate can not be part of a recursion. For example,
a(X) :- string_concat("a", Y, X), a(Y)
is not allowed.