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:
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:
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:
Analyze the module F with the current analysis options (use customize(analyze) to change these options).
Optimize file F with the current options (use customize(optimize) to change these options).
Check the assertions in file F, with the current options, giving errors if assertions are violated (use customize(check_assertions) to change these options).
Same as auto_analyze/1 but the output file will be OFile.
Same as auto_optimize/1 but the output file will be OFile.
Same as auto_check_assrt/1 but the output file will be OFile.
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).
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).
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.
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.
Same as customize(Option), but menu flags will not be modified.
Performs the last actions done by customize_and_preprocess/1, on the last file previously analyzed, checked, or optimized
Save the current flags configuration under the Name key.
Remove the configuration stored with the Name key (the same provided in save_menu_config/1).
Restore the configuration saved with the Name key (the same provided in save_menu_config/1).
Show all stored configurations.
Show specific configuration values pointed by C key (the same provided in save_menu_config/1).