next up previous contents index
Next: Object Dependencies and Up: Library ML Functions Previous: Library Editing

Theory Commands

  Each theory has an identifier and is associated with a file  . Each theory also has a set of immediate ancestors which it is dependent on. Commands are provided to set up new theories, load theories, dump theories, and print theories.

Theories are named by ML strings. The conventions for naming theories are the same as for naming library objects explained at the beginning of this section. Each theory is associated with a file. The value of the ML reference variable theory_filenames : (string # string) list  is a list of pairs of theory names and names of associated files. The filenames include a full pathname, but do not have any extension. For example, a valid filename string is ~nuprl/lib/standard/core_1 . The actual file associated with a theory is this name with a .thy extension. Examine the theory_filenames variable to find out the theories that Nuprl knows about at a given time.

set_theory_filename theory-name file-name

  show_theory_filename theory-name  

Theory dependencies  are recorded by the value of the theory_ancestors : (string # string list) list  reference variable. Each entry in this list is a pair of a theory's name and a list of names of other theories that the theory is immediately dependent on. There are ML functions to compute the closure  of this graph  as and when necessary.

set_theory_ancestors theory-name theory-ancestor-list

  show_theory_ancestors theory-name

Typically one adds a few dummy theories  to theory_ancestors to simplify the description of the ordering of theories.

The theories loaded in a Nuprl session are generally a subset of the theories that Nuprl knows about. Between sessions, modified theories should always be explicitly saved. The functions for loading and dumping theories are: load_theory theory-name

  load_theories_with_ancestors theory-name-list   dump_theory theory-name  

Other utility functions are: list_theories () 

delete_theory theory-name

  short_print_theory theory-name   long_print_theory theory-name  

The theory theory-name always begins with comment object theory-name _begin  and ends with comment object theory-name _end . The names of these objects are important. Most of the theory functions rely on these delimiter objects being named the way they are. However, the user is free to alter the contents of these objects to his or her liking. A useful function is:

add_theory_delimiters

Add delimiter objects for the new theory theory-name to the end of the library.  

There are variants on the load functions which check (and therefore expand) theorem objects at load time. They are: load_fully_theory theory-name

  load_fully_theories_with_ancestors theory-name-list



next up previous contents index
Next: Object Dependencies and Up: Library ML Functions Previous: Library Editing



Karla Consroe
Wed Oct 23 13:48:45 EDT 1996