Commit feb5671
committed
5e5fbe2 bit_machine: add missing space to StderrTracker (Andrew Poelstra)
271dde9 value: display left and rights as L(x) and R(x); drop DispUnlessUnit (Andrew Poelstra)
6c88a8c value: write out bitstrings with len > 4 as hex rather than binary (Andrew Poelstra)
d2da3a0 value: write out power-of-two length bitstrings compactly in Display (Andrew Poelstra)
1ca2498 value: move iterator methods from Value to ValueRef (Andrew Poelstra)
38c5776 value: impl Copy for ValueRef (Andrew Poelstra)
22d5618 value: use ValueRef internally in RawByteIter (Andrew Poelstra)
Pull request description:
Now we:
* display bits and pairs of bits as bitstrings prefixed with `0b`
* display any bitstrings of length 4, 8, 16, ..., 2^32 as a hex string prefixed with `0x`
* display any remaining sum types as `L(...)` or `R(...)` rather than `0...` or `1...`
As an example of the improvement, consider this sample output from `StderrTracker`. Previously we had
```
[ 58] exec jet(sha_256_ctx_8_finalize) (2^256? × (2^128? × (2^64? × (2^32? × (2^16? × 2^8?))))) × (2^64 × 2^256) → 2^256
input ((1((((((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0))))),(((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))))),((((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0))))),(((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0))))))),(((((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0))))),(((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))))),((((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0))))),(((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))))))),(0,(0,(0,(0,0))))),(((((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0))))),(((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))),((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0)))))),((((((((0,1),(1,0)),((1,0),(1,0))),(((0,0),(0,0)),((1,0),(0,1)))),((((1,1),(1,0)),((0,1),(1,0))),(((0,1),(1,0)),((0,1),(1,1))))),(((((1,0),(1,1)),((1,0),(1,1))),(((0,1),(1,0)),((0,1),(1,1)))),((((1,0),(1,0)),((1,1),(1,0))),(((1,0),(0,0)),((0,1),(0,1)))))),((((((0,0),(1,1)),((1,1),(0,0))),(((0,1),(1,0)),((1,1),(1,0)))),((((1,1),(1,1)),((0,0),(1,1))),(((0,1),(1,1)),((0,0),(1,0))))),(((((1,0),(1,0)),((0,1),(0,1))),(((0,1),(0,0)),((1,1),(1,1)))),((((1,1),(1,1)),((0,1),(0,1))),(((0,0),(1,1)),((1,0),(1,0))))))),(((((((0,1),(0,1)),((0,0),(0,1))),(((0,0),(0,0)),((1,1),(1,0)))),((((0,1),(0,1)),((0,0),(1,0))),(((0,1),(1,1)),((1,1),(1,1))))),(((((1,0),(0,1)),((1,0),(1,1))),(((0,0),(0,0)),((0,1),(0,1)))),((((0,1),(1,0)),((1,0),(0,0))),(((1,0),(0,0)),((1,1),(0,0)))))),((((((0,0),(0,1)),((1,1),(1,1))),(((1,0),(0,0)),((0,0),(1,1)))),((((1,1),(0,1)),((1,0),(0,1))),(((1,0),(1,0)),((1,0),(1,1))))),(((((0,1),(0,1)),((1,0),(1,1))),(((1,1),(1,0)),((0,0),(0,0)))),((((1,1),(0,0)),((1,1),(0,1))),(((0,0),(0,1)),((1,0),(0,1))))))))))
output ((((((((0,1),(1,0)),((0,1),(1,0))),(((0,1),(1,0)),((1,0),(0,0)))),((((0,1),(1,1)),((1,0),(1,0))),(((1,0),(1,0)),((1,1),(0,1))))),(((((1,1),(1,1)),((1,0),(0,0))),(((0,1),(1,0)),((0,0),(1,0)))),((((1,0),(1,1)),((1,1),(0,1))),(((0,1),(1,1)),((0,1),(1,1)))))),((((((0,1),(1,0)),((1,1),(0,0))),(((1,0),(0,0)),((1,1),(1,1)))),((((1,1),(0,0)),((0,0),(0,1))),(((1,0),(0,0)),((1,0),(1,1))))),(((((1,0),(0,0)),((1,1),(1,0))),(((1,0),(0,1)),((1,1),(1,1)))),((((1,0),(0,0)),((1,1),(1,0))),(((0,0),(1,0)),((0,0),(0,0))))))),(((((((0,0),(0,0)),((1,0),(0,0))),(((1,0),(0,1)),((0,1),(1,1)))),((((0,0),(0,1)),((0,1),(0,0))),(((1,0),(0,0)),((0,1),(0,1))))),(((((0,1),(1,0)),((1,1),(1,0))),(((1,1),(1,0)),((0,0),(1,0)))),((((0,0),(1,1)),((0,0),(1,1))),(((1,0),(1,1)),((0,0),(1,1)))))),((((((1,0),(0,1)),((0,0),(0,0))),(((0,0),(1,0)),((1,0),(1,0)))),((((0,1),(0,1)),((1,0),(0,1))),(((0,0),(0,1)),((1,1),(0,1))))),(((((0,0),(0,0)),((1,1),(0,1))),(((0,1),(0,1)),((1,1),(1,1)))),((((0,0),(1,0)),((1,0),(0,1))),(((0,0),(1,0)),((0,1),(0,1))))))))
```
Now we have
```
[ 58] exec jet(sha_256_ctx_8_finalize) (2^256? × (2^128? × (2^64? × (2^32? × (2^16? × 2^8?))))) × (2^64 × 2^256) → 2^256
input ((R(0x0202020202020202020202020202020202020202020202020202020202020202),(L(ε),(L(ε),(L(ε),(L(ε),L(ε)))))),(0x0000000000000000,0x6a09e667bb67ae853c6ef372a54ff53a510e527f9b05688c1f83d9ab5be0cd19))
output 0x75877bb41d393b5fb8455ce60ecd8dda001d06316496b14dfa7f895656eeca4a
```
I would like to get this in before #327.
ACKs for top commit:
KyrylR:
ACK 5e5fbe2
Tree-SHA512: 4cd37448ac9e62153255d3426ac827d6f654d2df883bdbb386856095549fb1c5cb053963f49c25b78ae6a12c135401f8cc30a5dde036bdd37c6c0ec47f8a65f1
2 files changed
Lines changed: 88 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
199 | 227 | | |
200 | 228 | | |
201 | 229 | | |
202 | | - | |
| 230 | + | |
203 | 231 | | |
204 | 232 | | |
205 | 233 | | |
| |||
591 | 619 | | |
592 | 620 | | |
593 | 621 | | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
| 622 | + | |
598 | 623 | | |
599 | 624 | | |
600 | 625 | | |
601 | 626 | | |
602 | 627 | | |
603 | 628 | | |
604 | | - | |
| 629 | + | |
605 | 630 | | |
606 | 631 | | |
607 | 632 | | |
608 | 633 | | |
609 | 634 | | |
610 | 635 | | |
611 | | - | |
612 | | - | |
613 | | - | |
| 636 | + | |
614 | 637 | | |
615 | 638 | | |
616 | 639 | | |
| |||
736 | 759 | | |
737 | 760 | | |
738 | 761 | | |
739 | | - | |
740 | 762 | | |
741 | 763 | | |
742 | 764 | | |
743 | 765 | | |
744 | | - | |
745 | | - | |
746 | | - | |
| 766 | + | |
747 | 767 | | |
748 | 768 | | |
749 | | - | |
| 769 | + | |
750 | 770 | | |
751 | | - | |
| 771 | + | |
752 | 772 | | |
753 | 773 | | |
754 | 774 | | |
755 | 775 | | |
756 | 776 | | |
757 | 777 | | |
758 | 778 | | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
| 779 | + | |
774 | 780 | | |
775 | | - | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
776 | 826 | | |
777 | 827 | | |
778 | 828 | | |
| |||
1070 | 1120 | | |
1071 | 1121 | | |
1072 | 1122 | | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1076 | 1126 | | |
1077 | 1127 | | |
1078 | 1128 | | |
| |||
0 commit comments