Skip to content

Commit 151822f

Browse files
committed
improve documentation.
1 parent bbbe4d9 commit 151822f

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/org/sosy_lab/java_smt/api/StringFormulaManager.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,23 @@
1414
import org.sosy_lab.java_smt.api.NumeralFormula.IntegerFormula;
1515

1616
/**
17-
* Manager for dealing with string formulas. Functions come from
18-
* http://smtlib.cs.uiowa.edu/theories-UnicodeStrings.shtml.
17+
* Manager for dealing with string formulas. Functions come from <a
18+
* href="http://smtlib.cs.uiowa.edu/theories-UnicodeStrings.shtml">String theory in SMTLIB</a>.
1919
*/
2020
public interface StringFormulaManager {
2121

2222
/**
23-
* Returns a {@link StringFormula} representing the given constant String. The String value is
24-
* expected to be UTF16, i.e., plain Java string with Unicode characters. JavaSMT handles escaping
25-
* internally, as some solvers follow the SMTLIB standard and escape Unicode characters with curly
26-
* braces. We hide this detail from the user and allow to use plain Java Strings.
23+
* Creates a {@link StringFormula} representing the given constant String.
2724
*
28-
* @param value the string value the returned <code>Formula</code> should represent
29-
* @return a Formula representing the given value
25+
* <p>This method accepts plain Java Strings with Unicode characters from the Basic Multilingual
26+
* Plane (BMP) (codepoints in range [0x00000, 0x2FFFF]). JavaSMT handles escaping internally, as
27+
* some solvers follow the SMTLIB standard and escape Unicode characters with curly braces.
28+
*
29+
* <p>Additionally, you can use SMTLIB escaping like "\\u{1234}" to represent Unicode characters
30+
* directly.
31+
*
32+
* @param value the string value the returned {@link StringFormula} should represent
33+
* @return a {@link StringFormula} representing the given value
3034
*/
3135
StringFormula makeString(String value);
3236

@@ -236,14 +240,14 @@ default RegexFormula concat(RegexFormula... parts) {
236240

237241
/**
238242
* Returns an Integer formula representing the code point of the only character of the given
239-
* String formula, if s is a singleton string. Otherwise, returns -1.
243+
* String formula, if it represents a single character. Otherwise, returns -1.
240244
*/
241245
IntegerFormula toCodePoint(StringFormula str);
242246

243247
/**
244-
* Returns the singleton string whose only character is the given code point if it is represented
245-
* as a single char in UTF16, i.e., it is in the range [0, 196607]. Otherwise, returns the empty
246-
* string.
248+
* Returns a String formula representing the single character with the given code point, if it is
249+
* a valid Unicode code point within the Basic Multilingual Plane (BMP) (codepoints in range
250+
* [0x00000, 0x2FFFF]). Otherwise, returns the empty string.
247251
*/
248252
StringFormula fromCodePoint(IntegerFormula codePoint);
249253
}

0 commit comments

Comments
 (0)