File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
5353 /** Gets the rank of element `e`, which is used internally in the string encoding. */
5454 int getRank ( Element e ) { e = DenseRank< DenseRankInput > :: denseRank ( result ) }
5555
56+ /** Gets the ASCII printable excluding `.` with zero-based index `code`. */
5657 pragma [ nomagic]
5758 private string interpretAsciiCode ( int code ) {
5859 exists ( int dot , int c |
@@ -65,14 +66,18 @@ module Make<LocationSig Location, InputSig<Location> Input> {
6566
6667 private int asciiCodes ( ) { result = strictcount ( interpretAsciiCode ( _) ) }
6768
69+ /**
70+ * Gets the `i`th digit (modulo `asciiCodes()`) in a base-`asciiCodes()` integer
71+ * representation of `getRank(e)`.
72+ */
6873 private int getAsciiCodePart ( Element e , int i ) {
6974 result = getRank ( e ) and
7075 i = 0
7176 or
7277 exists ( int mid |
7378 mid = getAsciiCodePart ( e , i - 1 ) and
74- mid > 0 and
75- result = mid / asciiCodes ( )
79+ result = mid / asciiCodes ( ) and
80+ result > 0
7681 )
7782 }
7883
You can’t perform that action at this time.
0 commit comments