The CiaoPP high-level 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 several types of analysis of the program, and performing optimizations such as specialization and parallelization. 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 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 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 environment these actions can be performed by clicking on the corresponding button in the toolbar or in the CiaoPP menus.

The customization menus can be configured to show more or less detailed options, depending on the level of expertise of the user. This can be configured in menu changing the Menu Level flag (naive or expert).


Documentation on exports

Usage:auto_analyze(F)

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

    Usage:auto_optimize(F)

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

      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).

        Usage:auto_analyze(F,OFile)

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

          Usage:auto_optimize(F,OFile)

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

            Usage:auto_check_assert(F,OFile)

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

              PREDICATEcustomize/0

              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).

                PREDICATEcustomize/1

                Usage:customize(X)

                Customize is used for changing the values of the flags used during preprocesing. These flags are grouped into three main classes of actions: analyzing, checking assertions, or optimizing programs. X should be instantiated to one of: analyze, check_assertions, optimize, or all (which allows choosing among the previous three).

                  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.

                    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.

                      Usage:customize_but_dont_save(Option)

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

                        PREDICATEagain/0

                        Usage:

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

                          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.

                          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'.

                            Usage:customize_and_preprocess_java(File)

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

                              Usage:customize_xc(X)

                              Customize is used for changing the values of a set of flags for xc analysis. So far, the value of X is only 'all'.

                                Usage:customize_and_preprocess_xc(File)

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

                                  PREDICATEagain_xc/1

                                  Usage:

                                  Performs the last actions done by customize_and_preprocess_xc/1, on the last file previously processed.

                                    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 atms.

                                    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.

                                    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.

                                    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.

                                    Usage:

                                    Show all stored configurations.

                                      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

                                      No further documentation available for this predicate. The predicate is multifile.

                                      No further documentation available for this predicate. The predicate is multifile.

                                      No further documentation available for this predicate. The predicate is multifile.

                                      No further documentation available for this predicate. The predicate is multifile.