[m-dev.] for review: Aditi [3]

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jul 16 16:38:09 AEST 1998


On 07-Jul-1998, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
mercury_compile.m:
> -                        mercury_compile__backend_pass(HLDS50, HLDS70, LLDS), !,
> +                        mercury_compile__backend_pass(HLDS50, 
> +                                HLDS70, LLDS), !,

There's no need to wrap that line.

> @@ -1587,7 +1677,6 @@
>          ;
>                  { HLDS = HLDS0 }
>          ).
> -
>  :- pred mercury_compile__maybe_deforestation(module_info, bool, bool,
>          module_info, io__state, io__state).
>  :- mode mercury_compile__maybe_deforestation(in, in, in, out, di, uo) is det.

That looks like an accidental change.

> --- modules.m	1998/07/01 04:09:39	1.81
> +++ modules.m	1998/07/02 01:45:46
> @@ -503,6 +503,8 @@
>                  ; Ext = ".hlds_dump"
>                  ; Ext = ".dependency_graph"
>                  ; Ext = ".order"
> +                ; Ext = ".rla"
> +                ; Ext = ".rl_dump"
>                  % Mmake targets
>                  ; Ext = ".clean"
>                  ; Ext = ".clean_nu"

You should update the documentation in doc/user_guide.texi
about file naming conventions.

> @@ -787,8 +789,8 @@
>          ).
>  
>  % pragma `obsolete', `terminates', `does_not_terminate' 
> -% `termination_info' and `check_termination' declarations
> -% are supposed to go in the interface,
> +% `termination_info', `check_termination' and Aditi pragma
> +% declarations are supposed to go in the interface,
...
> +pragma_allowed_in_interface(memo(_, _), no).
> +pragma_allowed_in_interface(no_memo(_, _), no).
...
> +pragma_allowed_in_interface(supp_magic(_, _), no).
> +pragma_allowed_in_interface(context(_, _), no).
> +pragma_allowed_in_interface(naive(_, _), no).
> +pragma_allowed_in_interface(psn(_, _), no).

The code here isn't consistent with the comment.

> @@ -2106,6 +2121,12 @@
>          io__write_string(DepStream, "\n"),
>  
>          io__write_string(DepStream, MakeVarName),
> +        io__write_string(DepStream, ".rlos = "),
> +        write_compact_dependencies_list(Modules, "$(rlos_subdir)", ".rlo",
> +                                        Basis, DepStream),
> +        io__write_string(DepStream, "\n"),
> +
> +        io__write_string(DepStream, MakeVarName),
>          io__write_string(DepStream, ".pic_os = "),
>          write_compact_dependencies_list(Modules, "$(os_subdir)",

Hmm, there is some argument for only emitting that stuff in the dependency
files if `--aditi' or something like that is specified.
I'm not sure what the best approach is here.

options.m:
> +        inline_alloc            -       bool(no),
> +% RL    - not yet implemented
> +        optimize_rl             -       bool(no),
> +        optimize_rl_cse         -       bool(no),
> +        optimize_rl_invariants  -       bool(no),
> +        detect_rl_streams       -       bool(no)

Is the comment still correct?

> +        io__write_string("\t--dump-rl\n"),
> +        io__write_string("\t\tOutput a human readable representation of Aditi-RL\n"),

How about "... of the generated Aditi-RL code ..."?

Actually the help messages should (1) be commented out for now
and (2) match the description in the Mercury user's guide.

> --- polymorphism.m	1998/06/19 00:42:37	1.138
> +++ polymorphism.m	1998/07/02 05:09:57
...
> +:- type poly_info.
> +
> +:- pred poly_info_init(module_info, pred_info, proc_info, poly_info).
> +:- mode poly_info_init(in, in, in, out) is det.
> +
> +:- pred poly_info_extract(poly_info, pred_info, pred_info,
> +                proc_info, proc_info, module_info).
> +:- mode poly_info_extract(in, in, out, in, out, out) is det.

These need documentation.
(The standard for documentation is higher for exported
predicates than for predicates that are local to a module.)

>  polymorphism__process_pred(PredId, ModuleInfo0, ModuleInfo, IO0, IO) :-
>          module_info_pred_info(ModuleInfo0, PredId, PredInfo),
> -        pred_info_module(PredInfo, PredModule),
> -        pred_info_name(PredInfo, PredName),
> -        pred_info_arity(PredInfo, PredArity),
>          (
> -                polymorphism__no_type_info_builtin(PredModule,
> -                        PredName, PredArity) 
> +                (
> +                        % Leave Aditi aggregates alone, since
> +                        % calls to them must be monomorphic.
> +                        % Other Aditi procedures should still be processed
> +                        % to remove complicated unifications and
> +                        % lambda expressions.
> +                        hlds_pred__pred_info_is_aditi_aggregate(PredInfo)

If calls to them must be monomorphic, where is this checked?

If the type declaration for all Aditi aggregates is monomorphic,
then there should be no harm in processing them -- correct?

> +                ;
> +                        % Leave Aditi relations alone, since they must
> +                        % be monomorphic.
> +                        hlds_pred__pred_info_is_aditi_relation(PredInfo)
> +                ;
> +                        hlds_pred__pred_info_is_aditi_aggregate(PredInfo)

Where is the restriction that they be monomorphic enforced?
(Please document that here.)

> +++ prog_data.m	1998/06/11 01:05:16
> @@ -104,6 +104,12 @@
>                          % PredName, Predicate or Function, Vars/Mode, 
>                          % VarNames, C Code Implementation Info
>  
> +        ;       memo(sym_name, arity)
> +                        % Predname, Arity
> +
> +        ;       no_memo(sym_name, int)
> +                        % Predname, Arity

s/int/arity/

> +
> +        ;       aditi(sym_name, int)
> +                        % Predname, Arity
> +
> +        ;       base_relation(sym_name, int)
> +                        % Predname, Arity
> +                        %
> +                        % Eventually, these should only occur in 
> +                        % automatically generated database interface 
> +                        % files, but for now there's no such thing, 
> +                        % so they can occur in user programs.
> +                        
> +        ;       naive(sym_name, int)
> +                        % Predname, Arity
> +                        % Use naive evaluation.
> +
> +        ;       psn(sym_name, int)
> +                        % Predname, Arity
> +                        % Use predicate semi-naive evaluation.
> +
> +        ;       supp_magic(sym_name, int)
> +                        % Predname, Arity
> +
> +        ;       context(sym_name, int)
> +                        % Predname, Arity
> +
> +        ;       owner(sym_name, int, string)
> +                        % PredName, Arity, String.

s/int/arity/g

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list