The CiaoPP high-level interface

Author(s): CiaoPP development team.

This module defines the high-level interface for CiaoPP, which makes it easy to perform some analysis and transformation tasks, such as checking program assertions (i.e., types, modes, determinacy, non-failure, cost, etc.), and performing optimizations such as specialization and parallelization. The results can be observed both as CiaoPP messages and as a transformed annotated program.

In the emacs environment these actions can be performed by clicking on the corresponding button in the toolbar or in the CiaoPP menus. The high-level interface allows calling these actions as predicates from a CiaoPP top-level shell:

  • auto_check_assert(File): check assertions in File
  • auto_analyze(File): analyze File
  • auto_optimize(File): optimize File

The actions above can be controlled by a set of preprocessor flags. Note that, depending on some of these flags, processing can be of one module or also all the related modules. The default values of the CiaoPP flags can be changed with the following predicates:

  • customize(all): select (interactively) the values for the different options (do not perform any action).
  • set_menu_flag/3: select flag values non-interactively.

The emacs environment offers a graphical version of these menus.

These 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 the menu changing the Menu Level flag to naive or expert. The following predicates provide handy shortcuts to perform customization and preprocessing actions:

  • customize_and_preprocess(File): enter a menu to select the preprocessing action and options to be performed on file File (or File and its related modules), select the different options, and then perform the action.

  • again: perform again the last actions selected for customize_and_preprocess/1 on the same file (useful for re-processing after changing a file).

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 default 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 preprocessing. 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: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)true1/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.

                            PREDICATEaidomain/1
                            No further documentation available for this predicate. The predicate is multifile.