Skip to content

Commit

Permalink
Change visibility of getTrace(TLCState) method to public.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmy committed Feb 9, 2020
1 parent 6d4672e commit 103a121
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tlatools/src/tlc2/tool/ConcurrentTLCTrace.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ public synchronized final int getLevel() throws IOException {
return maxLevel; return maxLevel;
} }


private TLCStateInfo[] getTrace(final TLCState state) throws IOException { /**
* @see TLCTrace#getTrace(LongVec)
*/
public TLCStateInfo[] getTrace(final TLCState state) throws IOException {
final LongVec fps = new LongVec(); final LongVec fps = new LongVec();


// Starting at the given start fingerprint (which is the end of the // Starting at the given start fingerprint (which is the end of the
Expand Down
11 changes: 11 additions & 0 deletions tlatools/src/tlc2/tool/TLCTrace.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -260,6 +260,17 @@ protected TLCStateInfo[] getTrace(long loc, boolean included) throws IOException
return getTrace(fps); return getTrace(fps);
} }


/**
* This method is *not* safe to call multiple times iff the spec being checked
* consumed randomness, ie. TLC!RandomElement or through the Randomization
* module. In other words, such specs are incompatible with TLC's -continue
* mode.
* <p>
* To implement this correctly, state space exploration would either have to
* halt while the fingerprints are resolved to TLCStates below or ITool has
* to offer additional API s.t. the seed of RandomEnumerableValues gets
* passed as part of the method call.
*/
protected final TLCStateInfo[] getTrace(LongVec fps) { protected final TLCStateInfo[] getTrace(LongVec fps) {
// Re-Initialize the rng with the seed value recorded and used during the model // Re-Initialize the rng with the seed value recorded and used during the model
// checking phase. Otherwise, we won't be able to reconstruct the error trace // checking phase. Otherwise, we won't be able to reconstruct the error trace
Expand Down
2 changes: 1 addition & 1 deletion tlatools/src/tlc2/value/impl/EnumerableValue.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public SubsetEnumerator(final int k, final int n) {
// //
// x has to be co-prime to n. Since n might or might not be a prime number // x has to be co-prime to n. Since n might or might not be a prime number
// - it depends on the actual size of the set - we simply set x to // - it depends on the actual size of the set - we simply set x to
// be a prime number. The prime x has to be larger than n tough, since n is // be a prime number. The prime x has to be larger than n though, since n is
// bound by Integer.MAX_VALUE, we simply choose the Mersenne prime // bound by Integer.MAX_VALUE, we simply choose the Mersenne prime
// Integer.MAX_VALUE // Integer.MAX_VALUE
// for x and accept that we fail if n = Integer.MAX_VALUE. To minimize // for x and accept that we fail if n = Integer.MAX_VALUE. To minimize
Expand Down

0 comments on commit 103a121

Please sign in to comment.