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 flag values. The most usual way consists in calling customize_and_preprocess/1 from the CiaoPP top-level shell with the file name as argument. In the emacs environment 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 calling one of the following predicates:

In the emacs environement these actions can be performed 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)

Analyze the module F with the current analysis options (use customize(analyze) to change these options).

    PREDICATE

    Usage:auto_optimize(F)

    Optimize file F with the current options (use customize(optimize) to change these options).

      PREDICATE

      Usage:auto_check_assert(F)

      Check the assertions in file F, with the current options, giving errors if assertions are violated (use customize(check_assertions) to change these options).

        PREDICATE

        Usage:auto_analyze(F,OFile)

        Same as auto_analyze/1 but the output file will be OFile.

          PREDICATE

          Usage:auto_optimize(F,OFile)

          Same as auto_optimize/1 but the output file will be OFile.

            PREDICATE

            Usage:auto_check_assert(F,OFile)

            Same as auto_check_assrt/1 but the output file will be OFile.

              PREDICATE

              Usage:

              Enter an interactive menu to select the preprocessing action (analysis / assertion checking / transformation / optimization / ...) to be performed by deafult and the different options (i.e., setting the preprocessor flags).

                PREDICATE

                Usage:customize(X)

                Customize is used for changing 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:

                  Select options using customize/0, and then call auto_analyze/1, auto_optimize/1, or auto_check_assert/1 (as determined by the selected options) on the default file. If no default file is defined, prompt for the name of to be processed, which becomes from now on the default file.

                    PREDICATE

                    Usage:customize_and_preprocess(File)

                    Select options using customize/0, and then call auto_analyze/1, auto_optimize/1, or auto_check_assert/1 (as determined by the selected options) with File as argument. File is from now on the default file.

                      PREDICATE

                      Usage:customize_but_dont_save(Option)

                      Same as customize( Option ), but menu flags will not be modified.

                        PREDICATE

                        Usage:

                        Performs the last actions done by customize_and_preprocess/1, on the last file previously analyzed, checked, or optimized

                          PREDICATE

                          Usage:clean_aux_files(File)

                          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:

                          Launch a menu to select module dependencies.

                            PREDICATE

                            Usage:customize_java(X)

                            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_preprocess_java(File)

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

                                PREDICATE

                                Usage:get_menu_configs(X)

                                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)

                                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)

                                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)

                                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:

                                Show all stored configurations.

                                  PREDICATE

                                  Usage:show_menu_config(C)

                                  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

                                  Usage:hook_menu_flag_values(Menu,Flag,Values)

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

                                    The predicate is multifile.

                                    PREDICATE

                                    Usage:hook_menu_check_flag_value(Menu,Flag,Value)

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

                                      The predicate is multifile.

                                      PREDICATE

                                      Usage:hook_menu_flag_help(Menu,Flag,Values)

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

                                        The predicate is multifile.

                                        PREDICATE

                                        Usage:hook_menu_default_option(Menu,Flag,DOpt)

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

                                          The predicate is multifile.

                                          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.