TLA+ is not so different from real-world programming languages: wewrite (abstract) programs, then we compile/typecheck them, we runthem, we debug them. The workflow for TLA+ should be similar to, say,Haskell. GHC has a compiler, a REPL, and a few command-line tools. Itdoes not have an isolated IDE; nor does it need one. Even tools likeCoq or Isabelle, which have their own little IDEs for interactiveproof assistants, are usually used via other generic IDEs likeEmacs.
The IDE is not exactly isolated. It is a specialization of Eclipse.
The IDE is not exactly isolated. It is a specialization of Eclipse.
And my experience is that when you suggest somebody to learn emacs he looks at you as ifyou wanted to come back to the stone age. I disagree with that obviously but is there a way ofconvincing somebody in a democracy?
I use the IDE under linux and I've never experienced your problem of file opening. Idon't know why. Maybe the way I use it or the version of Eclipse used for the Linux box.
Hi James,
Thanks for taking the time to write up your feedback. And thanks also
for your offer to try to help solve some of the problems you found. I
hope we'll be able to take you up on your offer.
Before getting to specifics, I want to say that I believe your desire
for the command-line interface to come first represents a small
minority view in the general programming community. Gerard Holzmann,
the inventor of the Spin model checker, told me a while ago that when
he put a very simple GUI on Spin, the number of users increased by an
order of magnitude. I have had a number of comments that the Toolbox
does not provide the power they have come to expect from the IDEs they
use to write programs. Although others have complained about the
absence of good documentation for the command line interfaces, no one
else has ever said that the Toolbox should not be the principle method
of using the tools.
However, I have not based my career on copying what other people do.
I have always tried to find what works best, regardless of what others
think should work best. I'm not a fan of screen flash. I started
programming before there were even command-line interfaces. I use
whatever I find most convenient. For example, for manipulating files
I will use either the Windows File Explorer GUI or a Cygwin
command-line shell depending on what I'm doing.
If you think running the TLC model checker from a command line could
be better than running it from the Toolbox, then you do not appreciate
all that you can do from the Toolbox--perhaps because you have just
been writing simple specs and have not yet had serious debugging of
specs to do, and perhaps because of poor documentation. And only a
blind person could prefer running the prover from a command line
rather than from the Toolbox. (We don't have the resources to try to
provide interfaces for disabled people.)
So, we are not going to spend resources trying to improve command-line
interfaces. However, they should be documented better than they are.
That's one of the many things I haven't had time to do and am not
likely to find time in the near future. But the information is easily
accessible, so it's not rocket science.
I'm willing to devote some energy to helping someone produce better
documentation for the Toolbox. I would appreciate any help you can
provide. I suggest that you start by reading the Toolbox's help pages
and tell me what can be done to improve them. What I would like is to
have the Toolbox read the user's mind and, when she doesn't know what
to do next, present her with the appropriate help page. I don't know
how to implement that. Simply presenting the information in a single,
logically structured document doesn't seem to work very well. 25
years ago I found that LaTeX users weren't very good at reading the
manual, and people have gotten a lot less willing to read than they
were then.
You wanted HTML documentation. There are two things that need to be
documented: TLA+ and the tools. I considered alternatives to
LaTeX-produced pdf when I started writing the Hyperbook. HTML would
have been ten times harder to use to produce something that was a
tenth as good. As for the "pretty-printed" version versus the ASCII,
a TLA+ user at Intel wrote that one of the good things about TLA+ is
that if he doesn't understand what a TLA+ construct means, he can
look it up in a math book. Math books don't write math in ASCII, they
use standard mathematical symbols. I want TLA+ users to think in
terms of math, which means thinking in terms of its symbols. You will
soon get to be bilingual, reading math and its TLA+ ASCII versions
equally well. And if you learn TLA+ by reading the Hyperbook, you
will find that the ASCII versions are all sitting there for you to
just copy into the Toolbox.
By the way, I believe the Hyperbook has a page with a table of ASCII
<-> Math translations. It's part of the few-page summary of TLA+ in
Specifying Systems, which is also available as a separate pdf file.
As to the zip file, the only way to write hypertext in pdf is with
hundreds of separate files. You want those files on your own machine;
you don't want to have to be going out over the web for every pop-up.
I don't know any alternative to a zip file.
As to documenting the tools, there seem to be two issues: the
mechanics of the various bells and whistles that the Toolbox provides,
and the more subtle issues that involve understanding TLA+. For the
latter, the Hyperbook seems to be the best medium. The former is what
the help pages try to document, but don't seem to be doing a good job.
Leslie
--
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 http://groups.google.com/group/tlaplus.
For more options, visit https://groups.google.com/d/optout.
I found Adobe Reader to be fairly user hostile software in terms of
usability.
There are other pdf readers. I have found Foxit to be pretty good and
appears to have fewer bugs than Adobe Reader, but I find it somewhat
clunkier.
I think that ... HTML is a lot more feasible today that it would have
been ten years ago.
If anyone knows of a better way to display the Hyperbook than pdf that
is easily available on the three supported platforms and is likely to
still work in 20 years, please let me know about it.
If the sources for the hyperbook and the PlusCal manual are available
publicly with a creative commons license the community can experiment
with pulling the documentation into a new form.
I will be happy to assist anyone who wants to improve the
documentation, including by making the sources of the existing
documents available to them. However, one requirement is that it must
not make it less convenient for me to continue modifying the
documents--especially the Hyperbook. Since I have been developing my
personal LaTeX environment for the past 30 years, this is a
non-trivial requirement.
As I spent more time with TLA and PlusCal, the fractured nature of the
documentation became a bigger hassle for me.
It has been my intention to make the Hyperbook replace at least the
first part of Specifying Systems. Some "fracturing" of the
documentation is inevitable, since few people will want to read things
like the chapters of Specifying Systems on the semantics of TLA+, so
it's not worth the effort of making it as user-friendly as I want the
Hyperbook to be.
The one thing I intensely long for is a REPL;
I don't know what kind of REPL for TLA+ you (and Chris) would like.
Please describe explicit scenarios that you would like to have
supported. Be as fanciful as you like. The only constraint is that
the E(valuate) has to be performed by the TLC model checker, so forget
about anything that involves instantly reporting all errors in a spec
with 10^27 reachable states.
Leslie
I will be happy to assist anyone who wants to improve the
documentation, including by making the sources of the existing
documents available to them.
If you change your way of documenting tlaplus may I suggest that you
don't make a documentation that requires that one connects online to
read it.
The only documentation to which this seems to apply is the
documentation of TLAPS. I intend eventually to replace that with
additional material in the Hyperbook. I trust you realize that the
Toolbox documentation on the Web consists of a copy of its help pages,
put there because help pages aren't going to help someone solve the
problem of the Toolbox not starting.
Leslie
> documentation of TLAPS.
Hi Chris,
I asked for explicit scenarios that you would like implemented--that
is, exactly what keystrokes and button pushes you would perform to
achieve the desired tasks. I want suggestions, not complaints.
Time taken to start TLC. I assume most of the cost is due to spawning
a new JVM on every invocation, and most JVMs are very slow to start.
Simon Zambrovski tried to run TLC inside the Toolbox's JVM, but
failed. He was unable to write the appropriate code to re-initialize
everything so a single instance of TLC could be run more than once.
My memory says that he re-initialized everything he could find to
re-initialize, but it still didn't work.
Lack of a pretty-printer for complex expressions
TLC pretty-prints all values that it outputs. If you think you can do
a better job, it should be easy to find and replace the existing
pretty-printer. In fact, the current one was written by Mark Tuttle
because he didn't like the way Yuan's code was printing values.
However, Mark is a pretty bright guy and I suspect that you wouldn't
do much better. I think you'd find that every change you made to make
it work better on some output will make it do worse on other output.
You might be happier with a structured viewer like the one for values
of variables in the trace explorer.
Leslie
On 23 Nov 2014, at 23:42, Leslie Lamport <tlapl...@gmail.com> wrote:I asked for explicit scenarios that you would like implemented--that
is, exactly what keystrokes and button pushes you would perform to
achieve the desired tasks.
Hi Chris,
You write that a REPL should:
- Allow ... constants and variables to be declared.
- Allow operators to be defined and re-defined...
- Provide a command to display the definition of any symbol.
A set of declarations and definitions is a specification. I therefore
infer that a REPL would maintain a Current Specification that is
modified and viewed by command-line commands.
The first text editor I can remember using was called TECO. In those
days, video displays were too expensive for common use, so one
interacted with a computer using a teletype-style device with a
keyboard and a roll of paper. TECO maintained a current cursor
position, and one edited a file by keyboard commands to move the
cursor and to insert or delete characters at the cursor position. To
see the actual contents of the file, you executed a command to print
part of it--usually a few lines containing the cursor. When CRT
displays became common in the 1970s, they were first used as "glass
teletypes", treating the screen as a virtual roll of paper. People
soon switched to visual editors that made the screen a window on the
file that you edited visually--e.g., Emacs (which was first built on
top of TECO).
Your REPL seems to be a specification editor based on the TECO model,
treating the screen as a glass teletype. (Instead of viewing a few
lines around the cursor, the user displays an individual definition.)
However, unlike text files, specs have a logical structure. So, what
happens if you try to add a syntactically incorrect definition? One
possibility is to produce a syntactically incorrect spec, which you
then fix by actual TECO-style editing commands. However, I presume
that you intend the definition command to fail, so the user would have
to issue a whole new command to add the definition. Since you are
using a virtual paper roll rather than real paper, this is not hard to
do with copy/paste/edit starting from the incorrect command.
People who want a REPL interface apparently think it's a great step
forward to return to the 1960s. I lived through the 60s and I don't
think they were that great (except for the music). So, I will have no
part in implementing a REPL interface for TLA+. If I want to edit a
Current Specification, I will do it by putting the specification in a
buffer and editing it with something like Emacs, not something like
TECO. And TLA+ already provides a syntax for displaying a
specification in that buffer.
I couldn't tell if the Current Specification in your proposal is
actually what the Toolbox thinks is the current spec, so your REPL
command to modify a definition actually changes the .tla file. I
suspect it isn't. In that case, the Current Specification should have
its own buffer. This allows you to play with potential changes to the
spec--or make changes just for debugging purposes--without affecting
the official spec. There are any number of ways of doing this--for
example, with an easy to use repository. With a REPL, if you want to
change a definition in the spec to a modified version that you've
since changed, you will have to search back in the scroll for the
command that created it. With a repository, you could make lots of
checkpoints and go to the appropriate one. Another alternative is to
create new models instead of new checkpoints. As part of a model, the
Toolbox keeps the entire spec that was last checked by the model. I
believe you can open that spec in a read-only editor, but I don't
remember how. (I've never used it.) But it should be easy to add
Toolbox commands to allow the user to edit that saved version and
rerun TLC on it.
- Allow a key-press (presumably Ctrl-C) to promptly interrupt a
long-running evaluation.
That shouldn't be hard to add to the Toolbox, if clicking on a button
is too much work. Since you can have more than one model executing at
a time, there might be some problem in determining which one gets
interrupted.
- Allow explicit temporary local binding (shadowing) of constants and
variables, to test operators. This would only be allowed in commands
that did not have side-effects. i.e. It would not be allowed when
defining or redefining a symbol.
My recollection is that output from Assert(_,_) and PrintT(_) of
complex nested structures would occasionally be so hard to read that I
would copy/paste it into a text editor and manual reformat it a bit,
to clarify a problem.
Your recollection is probably correct. I have to do that sometimes.
No pretty-printer can automatically display a complex value the way I
want to see it because how I want to see the value depends on what I'm
looking for. So I might want the same value to de displayed in two
different ways. Mark's algorithm is not very sophisticated, so it can
probably be improved. But I doubt if it will be easy to make it very
much better.
Using TLC currently requires using the mouse quite a lot, whereas
using TLAPS can be done mostly from the keyboard.
There are many more things you can do with TLC than with TLAPS, so
doing everything with keyboard commands would be pretty complicated.
However, I believe that once a window is selected, any click of a
button on that window could be implemented as a keyboard command. I
don't know how to attach keyboard commands to individual windows.
Anyone who knows how can easily do it; they just have to coordinate
with me.
Cheers,
Leslie
--
I don't know what kind of REPL for TLA+ you (and Chris) would like.
Please describe explicit scenarios that you would like to have
supported. Be as fanciful as you like. The only constraint is that
the E(valuate) has to be performed by the TLC model checker, so forget
about anything that involves instantly reporting all errors in a spec
with 10^27 reachable states.
Hi Chris,
You wrote (approximately):
>>Your REPL seems to be a specification editor based on the TECO model,
>>treating the screen as a glass teletype.
It's more than that, because of
(1) the ability to very easily evaluate expressions at any time, using
the definitions you've built up so far.
(2) the speed of iteration (including staying focused on the keyboard,
rarely using the mouse).
This REPL business is a time-wasting distraction. Anyone who would
rather write a specification (or a program) in TECO rather than in
Emacs is so many standard deviations outside of normal that I'm not
concerned with his or her preferences. Emacs is not a REPL, but when
I use it I rarely use the mouse. I'm not focused on the keyboard; I'm
focused on the document I'm writing--something that would be hard to
do if I couldn't see it. (I've used a REPL theorem prover. It was a
nightmare because I was creating a current state with my typing, but
there was no easy way to see that state because all I could do was
type commands that would show me little pieces of it--like individual
definitions.)
So, whatever specification a user creates will be by editing the .tla
file using a window on the file, as in Emacs. So, lets consider (1).
After setting up a suitable model, when editing in the Toolbox, at any
time with two mouse clicks you can go to the Evaluate Constant
Expression part of a model, type an expression, run it (one more mouse
click), and read its value. This is not what I'd call difficult. As
for (2), iteration consists of going back to where I was in the
spec--1 mouse click. The speed of iteration is a problem because the
only way to evaluate an expression is by running TLC, which requires
starting a new JVM. No interface change is going to eliminate that
problem. Fixing it requires a significant rewrite of TLC, and perhaps
of SANY if you want to avoid reparsing the entire spec--or use of
another tool.
So, all a REPL buys you is eliminating three mouse clicks with a
little typing. Even I could probably figure out how to replace those
mouse clicks with keystrokes--if someone can specify precisely what
those keystrokes should do. (For example, what if there are multiple
models open?)
So far, I don't think that the current discussion has revealed any
gaps in the functionality that the Toolbox provides. It has pointed
out two problems:
1. The functionality is not well document.
2. It should be possible to use keystrokes instead of some
mouse clicks.
3. Evaluation with TLC takes too long.
I'm open to precise, well thought-out suggestions for improving 1 and
2. It would be great if someone would volunteer to solve 3, now that
Markus has suggested how it might be done.
Leslie
Dear Çagatay,
Thanks for taking the time to write down your ideas. What I will do
now is show you how to do what I think you want in the current
Toolbox. It won't be nearly as convenient as you want, but I think it
will show that we don't need any fundamental change to the logical
structure of the Toolbox. If I'm right, then you can get what you
want by improving the Toolbox interface.
First of all, your proposal is based on a misconception of what is
required to evaluate an expression. In general, evaluating an
expression requires a model to specify the values of declared
constants and a pair of states to specify the values of primed and
unprimed declared variables. Constant expressions can be evaluated on
a model. Expressions with constants and unprimed variables can be
evaluated on a state in a model. (The state may contain model
values.) You cannot evaluate anything on "the initial state" of a
specification because a specification can permit many initial states
(often infinitely many). It follows from this that your notebook must
exist within a model of a specification.
I believe you have a single specification--the one you're writing--and
you want to be able to open multiple notebooks on it. Let's call that
single specification S. Make each notebook a separate specification.
The root module EXTENDS S and contains any definitions and
declarations you want to add. The interface you described has a
single model for this notebook specification, although you can have
multiple models. The notebook's changes to the definitions of S are
made in the model (see the Advanced Model page).
Put the constant expressions you want evaluated in the notebook as the
elements of a tuple in the model's Evaluate Constant Expression
section. Arbitrary expressions (including primed expressions) can be
evaluated on error traces in the Error-Trace Exploration section of
the TLC Errors window. (You need to have the error window to enter
those expressions, but once entered they appear whenever the error
window is opened.)
- Instead of making a notebook a new specification, perhaps
it could be the copy of the spec saved with a model, as I
suggested in a response to Chris.
- The method of entering and displaying the values of
constant expressions and non-constant expressions could be
made more consistent--e.g., multiple constant expressions
enabled by check boxes.
- Some mouse clicking should be replaced by keystrokes.
As I've indicated before, instant evaluation won't be possible without
significant changes to TLC. You'll probably have to click or type a
command to re-evaluate expressions when the spec changes, although
it's possible to do it when you save changes to the spec. Moreover,
if evaluation of one expression fails with an error, then the
evaluation of everything will probably fail.
However, before worrying about convenience, you should try this method
of implementing what I think you want to do. The design of the
Toolbox was based on 10 years of experience using TLA+ and TLC.
Using the Toolbox this way will let you see if you really want
to do what you now think you do. And let us know what you find out.
Leslie
Dear Çagatay,
Thanks for taking the time to write down your ideas. What I will do
now is show you how to do what I think you want in the current
Toolbox. It won't be nearly as convenient as you want, but I think it
will show that we don't need any fundamental change to the logical
structure of the Toolbox. If I'm right, then you can get what you
want by improving the Toolbox interface.
Arbitrary expressions (including primed expressions) can be
evaluated on error traces in the Error-Trace Exploration section of
the TLC Errors window.
However, before worrying about convenience, you should try this method
of implementing what I think you want to do. The design of the
Toolbox was based on 10 years of experience using TLA+ and TLC.
Using the Toolbox this way will let you see if you really want
to do what you now think you do.