[m-rev.] for review: Aditi and `--highlevel-code'

Simon Taylor stayl at cs.mu.OZ.AU
Mon Mar 17 12:34:07 AEDT 2003


On 05-Mar-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 05-Mar-2003, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 
> > Make Aditi work with `--highlevel-code'.
> ...
> > compiler/purity.m:
> > 	Convert calls to private_builtin.unsafe_type_cast into
> > 	unsafe_cast goals.
> 
> That should be mentioned in the comments at the top of purity.m,
> and in compiler/notes/compiler_design.html.

Done.

> Otherwise, the log message sounds fine.  I haven't looked at the diff.

I'll commit this now.

Simon.


Index: purity.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/purity.m,v
retrieving revision 1.55
diff -u -u -r1.55 purity.m
--- purity.m	15 Mar 2003 03:09:08 -0000	1.55
+++ purity.m	16 Mar 2003 05:11:51 -0000
@@ -17,15 +17,9 @@
 %  This includes treating procedures with different clauses for
 %  different modes as impure, unless promised pure.
 %
-%  This module also does two final parts of type analysis:
-%	- it resolves predicate overloading
-%	  (perhaps it ought to also resolve function overloading,
-%	  converting unifications that are function calls into
-%	  HLDS call instructions, but currently that is done
-%	  in polymorphism.m)
-%	- it checks for unbound type variables and if there are any,
-%	  it reports an error (or a warning, binding them to the type `void');
-%	  similarly it checks for unsatisfied type class constraints.
+%  This module also calls post_typecheck.m to perform the final parts of
+%  type analysis, including resolution of predicate and function overloading
+%  (see the comments in that file).
 %
 %  These actions cannot be done until after type inference is complete,
 %  so they need to be a separate "post-typecheck pass"; they are done
@@ -35,6 +29,10 @@
 %  It needs to be done somewhere after quantification analysis and
 %  before mode analysis, and this is convenient place to do it.
 %
+%  This pass also converts calls to `private_builtin.unsafe_type_cast'
+%  into `generic_call(unsafe_cast, ...)' goals.
+%
+%-----------------------------------------------------------------------------%
 %
 %  The aim of Mercury's purity system is to allow one to declare certain parts
 %  of one's program to be impure, thereby forbidding the compiler from making
@@ -113,8 +111,7 @@
 %	It may also be nice to allow semipure function calls to occur
 %	inline (since ordering is not an issue for them).
 %
-
-
+%-----------------------------------------------------------------------------%
 :- module check_hlds__purity.
 :- interface.
 
@@ -130,7 +127,8 @@
 % 			;	(impure).
 
 %  Purity check a whole module.  Also do the post-typecheck stuff
-%  described above, and eliminate double negations.
+%  described above, and eliminate double negations and calls
+%  to `private_builtin.unsafe_type_cast/2'.
 %  The first argument specifies whether there were any type
 %  errors (if so, we suppress some diagnostics in post_typecheck.m
 %  because they are usually spurious).
Index: notes/compiler_design.html
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/notes/compiler_design.html,v
retrieving revision 1.82
diff -u -u -r1.82 compiler_design.html
--- notes/compiler_design.html	22 Feb 2003 13:54:43 -0000	1.82
+++ notes/compiler_design.html	5 Mar 2003 11:53:21 -0000
@@ -410,6 +410,8 @@
 	and to check for unbound type variables.
 	Elimination of double negation is also done here; that needs to
 	be done after quantification analysis and before mode analysis.
+	Calls to `private_builtin__unsafe_type_cast/2' are converted
+	into `generic_call(unsafe_cast, ...)' goals here.
 
 <dt> polymorphism transformation
 
@@ -664,6 +666,9 @@
 <li> conversion of Aditi procedures into disjunctive normal form (dnf.m).
   The supplementary magic sets and context transformations are only defined
   for predicates in DNF.
+
+<li> transformation of Aditi builtins into normal calls to predicates
+  in extras/aditi/aditi_private_builtin.m (aditi_builtin_ops.m).
 
 <li> supplementary magic sets or supplementary context transformation of
 	Aditi procedures (magic.m, magic_util.m, context.m).
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list