@@ -38,21 +38,21 @@ private SequencesExt() {
3838 // no-instantiation!
3939 }
4040
41- public static BoolValue IsASet (final Value val ) {
41+ public static BoolValue IsInjective (final Value val ) {
4242 if (val instanceof TupleValue ) {
43- return isASetNonDestructive (((TupleValue ) val ).elems );
43+ return isInjectiveNonDestructive (((TupleValue ) val ).elems );
4444 } else {
4545 final Value conv = val .toTuple ();
4646 if (conv == null ) {
4747 throw new EvalException (EC .TLC_MODULE_ONE_ARGUMENT_ERROR ,
4848 new String [] { "IsASet" , "sequence" , Values .ppr (val .toString ()) });
4949 }
50- return isASetDestructive (((TupleValue ) conv ).elems );
50+ return isInjectiveDestructive (((TupleValue ) conv ).elems );
5151 }
5252 }
5353
5454 // O(n log n) runtime and O(1) space.
55- private static BoolValue isASetDestructive (final Value [] values ) {
55+ private static BoolValue isInjectiveDestructive (final Value [] values ) {
5656 Arrays .sort (values );
5757 for (int i = 1 ; i < values .length ; i ++) {
5858 if (values [i -1 ].equals (values [i ])) {
@@ -66,7 +66,7 @@ private static BoolValue isASetDestructive(final Value[] values) {
6666 // space is good enough. Sorting values in-place is a no-go because it
6767 // would modify the TLA+ tuple. Elements can be any sub-type of Value, not
6868 // just IntValue.
69- private static BoolValue isASetNonDestructive (final Value [] values ) {
69+ private static BoolValue isInjectiveNonDestructive (final Value [] values ) {
7070 for (int i = 0 ; i < values .length ; i ++) {
7171 for (int j = i + 1 ; j < values .length ; j ++) {
7272 if (values [i ].equals (values [j ])) {
0 commit comments