[m-dev.] diff: remove support for `:- assertion' declarations.

Peter Ross petdr at cs.mu.OZ.AU
Tue Nov 16 18:39:07 AEDT 1999


Hi,

===================================================================


Estimated hours taken: 1

Completely remove support for `:- assertion' declarations.  

configure.in:
    The up-to-date check must now ensure that `:- promise' declarations
    can be parsed, and the declarations don't have to have every
    variable explicitly quantified.

compiler/mercury_to_mercury.m:
compiler/prog_io.m:
library/ops.m:
    Remove the support for parsing `:- assertion' declarations.

doc/reference_manual.texi:
library/int.m:
    s/assertion/promise/

Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.189
diff -u -r1.189 configure.in
--- configure.in	1999/11/11 00:05:09	1.189
+++ configure.in	1999/11/16 07:00:34
@@ -77,15 +77,18 @@
 	cat > conftest.m << EOF
 		% this module contains features which didn't work in
 		% previous versions of the Mercury compiler
+		% Use [[ ]] for lists.
 		:- module conftest.
 		:- interface.
 		:- import_module io.
 		:- pred main(io__state::di, io__state::uo) is det.
 		:- implementation.
-		:- import_module int.
+		:- import_module list.
+		% Check that promise declarations can be parsed
+		% and that every variable in the assertion doesn't
+		% need to be explicitly quantified.
+		:- promise all [[H,T,L]] (list__last([[H|T]], L)).
 		main --> 
-			% check that we have int__xor.
-			{ _X = int__xor(2,2) },
 			print("Hello, world\n").
 EOF
 	if
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.163
diff -u -r1.163 mercury_to_mercury.m
--- mercury_to_mercury.m	1999/11/12 09:08:37	1.163
+++ mercury_to_mercury.m	1999/11/16 03:53:25
@@ -2838,8 +2838,6 @@
 mercury_unary_prefix_op("\\+").
 mercury_unary_prefix_op("aditi_bottom_up").
 mercury_unary_prefix_op("aditi_top_down").
-	% XXX assertion bootstrap
-mercury_unary_prefix_op("assertion").
 mercury_unary_prefix_op("delete").
 mercury_unary_prefix_op("dynamic").
 mercury_unary_prefix_op("end_module").
Index: compiler/prog_io.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/prog_io.m,v
retrieving revision 1.184
diff -u -r1.184 prog_io.m
--- prog_io.m	1999/11/12 09:08:45	1.184
+++ prog_io.m	1999/11/16 03:53:36
@@ -1042,11 +1042,6 @@
 	parse_pragma(ModuleName, VarSet, Pragma, Result0),
 	check_no_attributes(Result0, Attributes, Result).
 
-	% XXX assertion bootstrap
-process_decl(ModuleName, VarSet, "assertion", Assertion, Attributes, Result):-
-	parse_assertion(ModuleName, VarSet, Assertion, Result0),
-	check_no_attributes(Result0, Attributes, Result).
-
 process_decl(ModuleName, VarSet, "promise", Assertion, Attributes, Result):-
 	parse_assertion(ModuleName, VarSet, Assertion, Result0),
 	check_no_attributes(Result0, Attributes, Result).
Index: doc/reference_manual.texi
===================================================================
RCS file: /home/staff/zs/imp/mercury/doc/reference_manual.texi,v
retrieving revision 1.157
diff -u -r1.157 reference_manual.texi
--- reference_manual.texi	1999/10/29 07:24:41	1.157
+++ reference_manual.texi	1999/11/16 06:55:52
@@ -369,7 +369,7 @@
 :- typeclass
 :- instance
 :- pragma
-:- assertion
+:- promise
 :- module
 :- interface
 :- implementation
Index: library/int.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/int.m,v
retrieving revision 1.63
diff -u -r1.63 int.m
--- int.m	1999/11/03 04:14:26	1.63
+++ int.m	1999/11/16 05:47:15
@@ -201,10 +201,10 @@
 %-----------------------------------------------------------------------------%
 
 	% commutivity of +
-:- assertion all [A,B,C] ( C = B + A <=> C = A + B ).
+:- promise all [A,B,C] ( C = B + A <=> C = A + B ).
 
 	% commutivity of *
-:- assertion all [A,B,C] ( C = B * A <=> C = A * B ).
+:- promise all [A,B,C] ( C = B * A <=> C = A * B ).
 
 %-----------------------------------------------------------------------------%
 
Index: library/ops.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/ops.m,v
retrieving revision 1.26
diff -u -r1.26 ops.m
--- ops.m	1999/11/12 09:12:42	1.26
+++ ops.m	1999/11/16 03:53:53
@@ -172,8 +172,6 @@
 ops__op_table("aditi_top_down", before, fx, 500). % Mercury extension
 ops__op_table("all", before, fxy, 950).		% Mercury/NU-Prolog extension
 ops__op_table("and", after, xfy, 720).		% NU-Prolog extension
-	% XXX assertion bootstrap
-ops__op_table("assertion", before, fx, 1199).	% Mercury extension
 ops__op_table("div", after, yfx, 400).		% standard ISO Prolog
 ops__op_table("else", after, xfy, 1170).	% Mercury/NU-Prolog extension
 ops__op_table("end_module", before, fx, 1199).	% Mercury extension

----
 +----------------------------------------------------------------------+
 | Peter Ross      M Sci/Eng Melbourne Uni                              |
 | petdr at cs.mu.oz.au  WWW: www.cs.mu.oz.au/~petdr/ ph: +61 3 9344 9158  |
 +----------------------------------------------------------------------+
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list