T.O.C. Index Bug Report ASCEND IV Home

library Library

Chapter 4 Library


The Library window (

Figure 4-1) in allows the user to read types into the system from files, compile types into instances, and delete types.

Types are the templates used to create simulations. They come in two flavors: ATOM, which has a value associated with the instance name when it is instantiated, and MODEL, which has no value. ATOMs, further, come in vanilla and UNIVERSAL flavors. Universal atoms have a single compiled instance which is global to all simulations created.

Both ATOMS and MODELS are defined in source files. By convention, source files are named with the endings .asc and .lib, though other extensions may be used.

In the ASCEND Library window, source files appears in the upper left box. On the other hand, the types defined in the highlighted source file appear in the upper right box. A double-button2 in either box will compile the highlighted type definition. It doesn't reselect. The upper left box should perhaps have double-button2 bound to reread the selected source module. The ASCEND fundamental type such as integer, real, etc., are not shown in the library window, since their definition is performed internally, not by using a specific source file. The lower box of the ASCEND Library window contains the name of the simulations that have been compiled and can be run.

The data structure used to store type definitions is sketched in Figure 4-2.

4.1 Menu Bar

The menu bar on the Library window has seven entries: File, Edit, Display, Find, View, Export and Help.

4.1.1 The file Menu

Read types from file
This loads type definitions into the system. The file selection dialog is used to select a source file.

The names of types are unique within the system. A new definition of a type overwrites the old definition of a type in all cases. If the new definition and the old definition were read from files of the same name, this overwrite will be done silently. If the new definition comes from a different file, the overwrite will be done noisily.

This is incorrect, but perhaps is as it ought to be
Existing types which refined or had parts that were of the old type definition will now refine or have parts which are of the new type. e.g. If you reread system.asc (and hence solver_var) everybody in the interface library who pointed at the old solver_var type will now point at the new solver_var type.

Instances already compiled using the definitions that have been overwritten will continue to point at a copy of the old definition the system has squirreled away somewhere. These squirreled away copies will not necessarily be the same as what is in the interface type library if you have reread a file with a newer type definition. This may cause refinement of the old instance to fail. In general if you redefine a type, you will probably want to reinstantiate things that depend on that type.

Close window
It just closes the ASCEND's Library window.

4.1.2 The Edit Menu

Create simulation
Create (or instantiate) a simulation based on a type definition. Anytime that the compile button is selected, the compile dialog window shown in Figure 4-3 will ask for the name which will be used to identify the simulation. All simulation created can be seen and in the lower box of the ASCEND Library window. This box can contain any number of simulations.

There is a second way to create a simulation through the Script window. This option is explained in the ASCEND Script window document.

Delete Simulation
Once a simulation has been loaded into the lower box of the Library window, it can easily be removed by selecting this option from the Edit menu.

Delete all types
Destroys all simulations and deletes all types. This option has no effect in the fundamental definitions.

4.1.3 The Display Menu

Most of the options in the Display Menu will be enabled only if a type definition has been selected, this is because the tasks performed in the menu are implicitly associated with a type definition.

Code
Displays the source code of the selected type in the ASCEND Display Window.

Ancestry
Allows the use of the Type Refinement Hierarchy Window. See the section corresponding to this topic.

Refinement hierarchy
Displays the refinement hierarchy of the selected type in the ASCEND Display window.

External Functions
It reports any external function defined from a loaded package library. The list of external functions (if any) is displayed in the window from which ASCEND IV was started

Hide Type
Any type definition which is selected to be hidden will be ignored for browsing purposes. Internally, the selection of this option consists in setting to zero a binary flag included in the type description of the highlighted type definition.

UnHide Type
Reverses the action of ``hiding'' a type. As a consequence, such a type will be considered for browsing purposes. Hide Type and UnHide Type are never enabled at the same time (for the same type definition) because they have opposite meaning. The default for all the type definitions (except fundamentals) is to be ``unhidden''.

Both Hide Type and UnHide Type have two selections as a submenu. The user can ask for the un/hiding of only the selected type, or for the un/hiding of the selected type and its refinements.

Hide/Show Fundamentals
This special option is given because fundamental types do not appear as definitions in the ascend libraries, but we still may want to able/enable such types for browsing purposes. When this button is selected, the window shown in Figure 4-4 will be used to perform the desired hiding or unhiding of any of the fundamental types.

4.1.4 The Find Menu

Type by name
Finds

a type by its name.

Type by fuzzy name
Finds all type names that match a word (provided by the user) in any fuzzy way. For instance, the name column could give as a result the following list: demo_column, mw_demo_column, plot_column, etc. The fuzzy name is defined in a dialog window similar to that used in the Find Type by name option.

Pending statements
There are three selections under the Pending Statements submenu, these are To Display, To Console, and To File. Pendings in a simulation are relations that have not yet been fully processed by ASCEND's compiler. It is the modeler's job to correct the pending relations in order to arrive at a fully functional simulation. Corrections may be made by either creating a model which refines the current model or by editing ASCEND code and starting over. This option gives the user access to information about the type and location of the pending statements.

To Display
By selecting the To Display option, all of the simulation pendings are displayed in the Display window.

To Console
By selecting the To Console option, all of the simulation pendings are displayed in the window from which ASCEND IV was started.

To File
By selecting the To File option, the File select box is opened and the user is asked to enter the name of the file in which to save the model pendings.

4.1.5 The View Menu

This option has the same application in all of the ASCEND windows and is explained as a general tool in a companion document.

4.1.6 The export Menu

There are three selections under this submenu, these are Simulation to Browser, Simulation to Solver, and Simulation to Probe.

Simulation to Browser
By selecting the Simulation to Browser option, the simulation highlighted in the lower box of the Library window is loaded into the Browser. From the Browser, the model can be explored in more detail.

Simulation to Solver
By selecting the Simulation to Solver option, the simulation highlighted in the lower box of the Library window is loaded into the Solver. (Note that exporting to the solver causes a degrees of freedom analysis to be carried out.)

Simulation to Probe
By selecting the Simulation to Probe option, all of the variables of the simulation highlighted in the lower box of the Library window are loaded into the Probe. This is not recommended as there are usually more variables in a model than the user would wish to view at one time. However, if the user does wish to look at all of the variables and their current values, the Simulation to Probe option can be useful.

4.1.7 The help Menu

On LIBRARY
Brings up a browser pointing to the information provided in this document.

4.2 Type Refinement Hierarchy Window

The type tree is a directed acyclic graph (DAG) based on the type hierarchy currently defined in the interface Library. Selection of the option Display Ancestry for any selected type gives the entire refinement hierarchy for that type, by enabling the use of the window shown in Figure 4-6.

The current focus in the hierarchy is indicated by a rectangle around the type name and the Current type.

The buttons on the left in the type window operate on the currently selected type:

`Atoms' shows the types of ATOMic parts in the selected type definition. It also shows the incremental code for the type. You can select from the part types list to look at a different hierarchy.

`Code' shows the internally stored code of the selected type. The expressions, both algebraic and logical, are in reverse Polish notation. This is different from the way the code of the Library Display Code button shows it. Comparison of the two is sometimes a useful debugging tool.

`Parts' (Figure 4-7)shows

the types of MODEL parts in the selected type definition. It also shows the incremental code for the type.

The `<<<` (or backtrack) button backs up to the previously displayed type hierarchy, if there is one.

`Roots' (Figure 4-8) shows the existing root types, that is, the existing types which are not refinements of anything.

While ASCEND is building the graph, you may see a spew in the window from which ASCEND was started about orphaned types. This means there are types in the Library which are refinements of older types which are no longer in the Library.

While ASCEND is getting the Atom or Model parts list for a type, part types names which are undefined will be spewed.

When an older type is replaced in the Library by a new one of the same name, the old one is squirreled away where types that refined it can still see it. The only way to get current types to look at the new definition without touching the source files for the current types is to delete all types and reread the entire Library.


Last Modified: 02:52pm EDT, September 30, 1997
9/26/97 Release 0.8 authors T.O.C. Index Bug Report ASCEND IV Home