The CiaoPP user menu interface

Author(s): David Trallero Mena.

This module defines a simplified user-level interface for CiaoPP. It complements the more expert oriented interface defined in The CiaoPP low-level programming interface. This is also the interface called by the shortcuts available in menus and toolbars in the emacs mode.

The idea of this interface is to make it easy to perform some fundamental, prepackaged tasks, such as checking assertions in programs (i.e., types, modes, determinacy, non-failure, cost, etc.), performing optimizations such as specialization and parallelization, and performing several types of analysis of the program. The results can be observed as new or transformed assertions and predicates in a new version of the program.

In order to use CiaoPP, the user must provide two kinds of information: first, a number of preprocessing options must be set if necessary in order to configure the system; and then, the action that has to be done must be selected (analysis, assertion checking, optimization). Those options are controlled by a set of so-called flags. By default, all flags are initialized to the appropriate values in most of the cases. If the value of any of the flags has to be changed by the user, the flag must be changed before performing the corresponding action. There are two ways to change the flags value. The most usual way consists in calling customize_and_exec/1 from the CiaoPP top-level shell with the file name as argument. In emacs this can be done most easily by clicking on the options button in the toolbar or in the CiaoPP menus. It will prompt (with help) for the value of the different options and flags.

The second way to change flag values consist in executing in the CiaoPP top-level shell a number of calls to set_menu_flag/3 with the right values, and then to call one of the following predicates:

In emacs these actions can be done most easily by clicking on the corresponding button in the toolbar or in the CiaoPP menus.

The customization menus can be made to show more or less detail depending on the level of expertise of the user. This can be configured in the customization menu itself.

Documentation on exports

PREDICATE

Usage: auto_analyze(F)

  • Description: Analyze the module F with the default analysis options (use customize(analyze) to change these options).

PREDICATE

Usage: auto_optimize(F)

  • Description: Optimize file F with default options (use customize(optimize) to change these options).

PREDICATE

Usage: auto_check_assert(F)

  • Description: Check the assertions in file F giving errors if assertions are violated (use customize(check_assertions) to change these options).

PREDICATE

Usage: auto_analyze(F,OFile)

  • Description: Same as auto_analyze/1 but the output file will be generated with OFile name.

PREDICATE

Usage: auto_optimize(F,OFile)

  • Description: Same as auto_optimize/1 but the output file will be generated with OFile name.

PREDICATE

Usage: auto_check_assert(F,OFile)

  • Description: Same as auto_check_assrt/1 but the output file will be generated with OFile name.

PREDICATE

Usage: customize(X)

  • Description: Customize is used for change the values of a set of flags. These flags are grouped into analyze, check assertions and optimize. X should take the values: analyze, check_assertions or optimize.

PREDICATE

Usage: customize_and_exec(File)

PREDICATE

Usage: customize_but_dont_save(Option)

  • Description: It is like doing customize( Option ), but menu flags will not be modified.

PREDICATE

Usage:

  • Description: Performs the last actions done by customize_and_exec/1, on the last file previously analyzed, checked, or optimized

PREDICATE

Usage: clean_aux_files(File)

  • Description: Deletes any auxiliary file regarding File or its related files (e.g., imported modules in a modular program).
  • The following properties should hold at call time:
    (atom/1)File is currently instantiated to an atom.

PREDICATE

Usage:

  • Description: Launch a menu to select module dependencies.

PREDICATE

Usage: customize_java(X)

  • Description: Customize is used for change the values of a set of flags in case of java analysis. So far, the value of X is only 'all'.

PREDICATE

Usage: customize_and_exec_java(File)

  • Description: It is like doing customize_java(all), and then calling with File as argument.

PREDICATE

Usage: get_menu_configs(X)

  • Description: Returns a list of atoms in X with the name of stored configurations.
  • The following properties should hold at call time:
    (var/1)X is a free variable.
  • The following properties should hold upon exit:
    (list/2)X is a list of atoms.

PREDICATE

Usage: save_menu_config(Name)

  • Description: Save the current flags configuration under the Name key.
  • The following properties should hold at call time:
    (atm/1)Name is an atom.

PREDICATE

Usage: remove_menu_config(Name)

  • Description: Remove the configuration stored with the Name key (the same provided in save_menu_config/1).
  • The following properties should hold at call time:
    (atm/1)Name is an atom.

PREDICATE

Usage: restore_menu_config(Name)

  • Description: Restore the configuration saved with the Name key (the same provided in save_menu_config/1).
  • The following properties should hold at call time:
    (atm/1)Name is an atom.

PREDICATE

Usage:

  • Description: Show all stored configurations.

PREDICATE

Usage: show_menu_config(C)

  • Description: Show specific configuration values pointed by C key (the same provided in save_menu_config/1).
  • The following properties should hold at call time:
    (atm/1)C is an atom.

(UNDOC_REEXPORT)
get_menu_flag/3:
Imported from menu_generator (see the corresponding documentation for details).

(UNDOC_REEXPORT)
get_menu_flag/3:
Imported from menu_generator (see the corresponding documentation for details).

(UNDOC_REEXPORT)
set_menu_flag/3:
Imported from menu_generator (see the corresponding documentation for details).

(UNDOC_REEXPORT)
set_menu_flag/3:
Imported from menu_generator (see the corresponding documentation for details).

(UNDOC_REEXPORT)
menu_branch/4:
Imported from menu_rt (see the corresponding documentation for details).

(UNDOC_REEXPORT)
menu_branch/3:
Imported from menu_rt (see the corresponding documentation for details).

(UNDOC_REEXPORT)
true/2:
Imported from menu_rt (see the corresponding documentation for details).

(UNDOC_REEXPORT)
true/1:
Imported from menu_rt (see the corresponding documentation for details).

(UNDOC_REEXPORT)
functor1/2:
Imported from menu_rt (see the corresponding documentation for details).

Documentation on multifiles

PREDICATE

The predicate is multifile.

Usage: hook_menu_flag_values(Menu,Flag,Values)

  • Description: Menu hook that determines the possible Values that a Flag can have in menu Menu.

PREDICATE

The predicate is multifile.

Usage: hook_menu_check_flag_value(Menu,Flag,Value)

  • Description: Menu hook that checks if Value is a correct option for Flag in menu Menu.

PREDICATE

The predicate is multifile.

Usage: hook_menu_flag_help(Menu,Flag,Values)

  • Description: Menu hook that determines the Help text for a Flag in menu Menu.

PREDICATE

The predicate is multifile.

Usage: hook_menu_default_option(Menu,Flag,DOpt)

  • Description: Menu hook that determines the default option DOpt for the Flag in menu Menu.

Known bugs and planned improvements

  • 1 commented out the question for error file since we are generating it in any case (not yet implemented)
  • 2 when auto_cthecks has the value 'on' (instead of 'auto'), the result of compile_time checking is not fully handled yet
  • needed_to_prove/3 is a weird predicate, it must be more easy to read. --EMM.