Hi.
This issue was mentioned here over a year ago, but I think its intent got lost in the rest of the discussion, so let me bring it up again.
The TLA+ pdf pretty-printer does a fantastic job, but its output is optimized for the printed page, while I look at a screen all day and don’t even own a printer (not that I remember, at least). After months of reading and writing TLA+ almost all day, every day, the ASCII representation of various symbols is now second nature to me, but I still find it less readable than proper symbols (and people less familiar with TLA+ find it far less readable), while the pdf output sits pretty much unused.
All (or virtually all) TLA+ symbols have unicode characters. How about letting the Toolbox present the unicode representation of the escaped symbols, i.e., display ∈ when the file says \in ? Better yet, as nearly all modern text editors support unicode, how about supporting unicode as a legal, alternative representation in all tools, namely, the tla file could contain \cup, \union, or ∪ to represent union? The toolbox would then have an option of saving the symbols to the file as unicode or keeping the ASCII representation. Agda also works with unicode symbols (but I think that is the only valid representation).
Ron
--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+u...@googlegroups.com.
To post to this group, send email to tla...@googlegroups.com.
Visit this group at https://groups.google.com/group/tlaplus.
For more options, visit https://groups.google.com/d/optout.
2. Add an option in the toolbox so that it replaces, say, \in to ∈ as I type. Then, it uses program 1 to run SANY/TLC. I see no reason why this should be a read-only mode, and there is no complex indentation logic here (the file produced is unicode with correct indentation, and then program 1 converts it to ASCII with correct indentation).
That's a bit over-simplifying. For example, you could have...x \in { s \in S : /\ \/ A(s)\/ B(s)/\ C(s) }If you replace "\in" in the first line by the corresponding Unicode symbol, you break indentation.
The Toolbox's Decompose Proof command has to solve the problem of maintaining indentation while expanding definitions in a proof step.
For users of the TLA+ Toolbox only. Not everybody fits into the proposed
box.
Nor would the Unicode conversion box fit the following
pred(S) == \A value \in S: \/ x = 1
(*NoteThisNiceCommentHere*)\/ x = 2
One workaround would be to pad the replacements with spaces, e.g. "\in"
-> " ∈ ".
What you are proposing to do involves modifying the core of SANY and
TLC. These programs were written on a shoestring and are neither well
structured nor well documented. They now have very few unknown bugs
because they have been largely unchanged for 15 years. Any plan to
make such extensive modifications needs to include plans for
extensively (and intelligently) testing the new version to make sure
that it doesn't introduce any bugs for ASCII specs. (For example, I
have worked to avoid having to make even the smallest changes to the
syntax based on experience with the prover because I am afraid of any
change to the JavaCC code.)
Now to get to your proposal. There seem to be two viable approaches:
Note that the ASCII file could have arbitrary information required to
display it encoded in special comments at the end of lines.
2. Put the Unicode in the .tla files. This potentially requires
changes to code scattered throughout SANY and TLC, making it hard to
avoid introducing bugs. One problem is in the communication between
the Toolbox and the tools. This is all done with stdio and stderr.
Do those interfaces support Unicode? If not, then thousands of print
and read statements in a hundred or so Java files need to be modified.
----
In any case, a lot of Toolbox code needs to be rewritten. You will
need to find someone to do that, because neither Markus nor I will
have time to do more than answer questions.
Cheers,
Leslie
L.
Ron,What you are proposing to do involves modifying the core of SANY and
TLC.
expect the advantages of ASCII (for example, the ability to do serious
editing in Emacs) mean that I wouldn't use unicode symbols in my
specs.
So, I think you should find out how many users would find
your proposal a significant improvement.
Now to get to your proposal. There seem to be two viable approaches:
This means that there is no need for the ASCII to be easy to read.
For example, it would be quite
all right for the spec displayed as follows (where & stands for the
\in symbol)pred(S) == \A value & S: \/ x == 1
(*NoteThisNiceCommentHere*)\/ x == 2to produce this in the ASCII filepred(S) == \A value \in S: \/ x == 1
(*NoteThisNiceComment Here*)\/ x == 2
Note that the ASCII file could have arbitrary information required to
display it encoded in special comments at the end of lines.
This would require almost no changes to the existing tools. The
Toolbox could translate locations in the ASCII file to locations in
the displayed text for displaying locations of errors reported by TLC
and of proof obligations reported by TLAPS.
2. Put the Unicode in the .tla files. This potentially requires
changes to code scattered throughout SANY and TLC, making it hard to
avoid introducing bugs.
One problem is in the communication between
the Toolbox and the tools. This is all done with stdio and stderr.
Do those interfaces support Unicode?
In any case, a lot of Toolbox code needs to be rewritten. You will
need to find someone to do that, because neither Markus nor I will
have time to do more than answer questions.
P.S. The alignment algorithm of the pretty-printer does not guarantee
correctness.