"Save as ..." pitfall

(2 posts) (2 voices)
  • Started 1 year ago by merz
  • Latest reply from Leslie Lamport
  • 1 Members Subscribed To Topic

Tags

No tags yet.

  1. Suppose I want to create a variant of a spec MySpec that defines a temporal formula Spec. I edit MySpec.tla and save it as MySpec2.tla, via the "Save as ..." dialog. At this moment, only the frame for MySpec2 is displayed in the toolbox. However, the toolbox treats this file as belonging to MySpec. In particular, when I subsequently create a model and run the model checker, it will use the specification Spec of MySpec.tla, not of MySpec2.tla. If I want to create a model for MySpec2, I must go through the "Open Spec" dialog, even though the specification is (the only one) displayed in the editor.

    It is not clear to me if this is a bug or a feature, but it would be nice if the GUI could give a better feedback of what it considers the current spec.

    Thanks,
    Stephan

    Posted 1 year ago #
  2. What you are doing violates the conception of how the Toolbox is meant to be used, so it is not surprising that it doesn't do what you would like it to do. The Toolbox is built around the concept of a spec, which has a name and a root module. When you have a spec open, the modules you're editing should be part of the spec--that is, the root module or one that it (perhaps indirectly) imports. For example, if you execute the Find Uses command to find all uses of a symbol, you will find its uses in all modules--including ones that import that module. I doubt if the command even works on a module that's not part of the spec.

    The Toolbox allows you to open modules in the root module's directory because (a) if the spec is not parsed, it doesn't know what modules belong to it and (b) you may be creating or editing a file that will later become part of the spec. You should not expect the Toolbox to allow you to do anything with a module that is not part of the spec except edit it.

    Although it would be sensible to run TLC on a non-root module that is part of the spec, we decided not to allow that. We expect users to create multiple models, and having multiple models for multiple modules within the spec would be confusing. If you want to run TLC on a module of a spec other than the root module, you must create a new spec having that module as its root. That is easy enough to do.

    Your request to make the name of the open spec easier to find seems reasonable. Now, you have to open the spec explorer to find it; the open spec is indicated iconically. It should be easy enough to put the spec's name in the window's title bar. I will try to implemkent it when I get a chance. You can find the root module of any spec by right-clicking on the spec in the spec explorer and choosing Properties.

    Posted 1 year ago #

Reply

You must log in to post.