[m-dev.] for review: fix muz so that it compiles
Thomas Conway
conway at cs.mu.OZ.AU
Thu Oct 14 15:27:02 AEST 1999
Hi
For review by anyone who knows muz at all, or Fergus, of course. :-)
--
Thomas Conway )O+ Every sword has two edges.
Mercurian <conway at cs.mu.oz.au>
muz/*.m:
Fix problems due to the changes a while back in how the
higher order expressions are quantified.
cvs diff: Diffing .
Index: higher_order.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/samples/muz/higher_order.m,v
retrieving revision 1.1
diff -u -r1.1 higher_order.m
--- higher_order.m 1998/11/07 05:42:45 1.1
+++ higher_order.m 1999/10/14 05:03:59
@@ -61,9 +61,10 @@
string_portray_list(F, L) = string_portray_list(F, "[", ", ", "]", L).
string_portray_list(F, Pre, In, Post, L) = S :-
- list__map(pred(I::in, F(I)::out) is det, L, SL),
+ list__map((pred(I::in, O::out) is det :- O = F(I)), L, SL),
list__length(SL, N),
list__duplicate(N - 1, In, InL),
list__append(InL, [Post], InL1),
list__zip(SL, InL1, SL1),
string__append_list([Pre|SL1], S).
+
Index: muz.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/samples/muz/muz.m,v
retrieving revision 1.1
diff -u -r1.1 muz.m
--- muz.m 1998/11/07 05:42:45 1.1
+++ muz.m 1999/10/14 05:24:25
@@ -102,7 +102,7 @@
:- mode main(in, in, di, uo) is det.
main(Option_Table, AL) -->
{Flags0 = get_flags(Option_Table),
- P0 = (pred(I::in, I-Flags0::out) is det),
+ P0 = (pred(I::in, IF::out) is det :- IF = I - Flags0),
list__map(P0, AL, AL1),
MToolkit = toolkit(Flags0),
( MToolkit = no,
@@ -212,7 +212,8 @@
zcheck(F2, Spec, Status1, D, D1),
{(Status1=yes(TSpec1), P0=finish(_, TSpec0)) ->
G = generating_logic(F2),
- HoP = (pred(TP::in, TP-G::out) is det),
+ HoP = (pred(TP::in, TPG::out) is det :-
+ TPG = TP - G),
list__map(HoP, TSpec1, TSpec2),
list__append(TSpec0, TSpec2, TSpec),
P1 = finish(D1, TSpec)
Index: typecheck.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/samples/muz/typecheck.m,v
retrieving revision 1.1
diff -u -r1.1 typecheck.m
--- typecheck.m 1998/11/07 05:42:45 1.1
+++ typecheck.m 1999/10/14 05:22:00
@@ -207,7 +207,8 @@
)},
list__foldl(P0, EL),
{ F = [] ->
- P1 = (pred(I-T::in, I-e(0, ztapply(S, T))::out) is det),
+ P1 = (pred(I-T::in, U::out) is det :-
+ U = I - e(0, ztapply(S, T))),
list__map(P1, LG0, LG)
; makeGeneric(S, F, LG0, LG)
},
@@ -305,7 +306,9 @@
decl_checkCT(decl(L0, X), L, TL) -->
set_check("Declaration expression", X, T),
{list__sort(L0, L1), list__remove_adjacent_dups(L1, L2),
- list__map(pred(I::in, I-T::out) is det, L2, L)},
+ list__map((pred(I::in, O::out) is det :-
+ O = I - T
+ ), L2, L)},
{list__length(L0, N), list__duplicate(N, T, TL)}.
decl_checkCT(include(S), T, [schemaT(T)]) -->
sexpr_check(S, T).
@@ -495,7 +498,7 @@
% 5.16 Function Application
:- import_module higher_order.
expr_check(X, ResultT) -->
- {X = zapply(Ref, Function, Actual)-C},
+ {X = zapply(_Ref, Function, Actual)-C},
expr_check(Function, FunctionT), expr_check(Actual, ActualT),
% If FunctionT has generic parameters and
% not (Function is an ident and the ident is tame)
Index: word.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/samples/muz/word.m,v
retrieving revision 1.1
diff -u -r1.1 word.m
--- word.m 1998/11/07 05:42:45 1.1
+++ word.m 1999/10/14 05:17:34
@@ -134,7 +134,9 @@
flags(zpragma(O, A, M, L), D, P, G)).
add_operators(Op, IdentList, F0, F) :-
- list__map(pred(I::in, I-Op::out) is det, IdentList, AL),
+ list__map((pred(I::in, O::out) is det :-
+ O = I-Op
+ ), IdentList, AL),
map__from_assoc_list(AL, M),
map__overlay(operators(F0), M, Operators),
set_operators(Operators, F0, F).
Index: zparser.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/samples/muz/zparser.m,v
retrieving revision 1.1
diff -u -r1.1 zparser.m
--- zparser.m 1998/11/07 05:42:46 1.1
+++ zparser.m 1999/10/14 05:17:55
@@ -592,7 +592,9 @@
[[zSCH, left_brace, OpToken, N, right_brace], ArgTokens,
[N], ArgTokens, [zSEMICOLON | N_p], ArgTokens,
PredTokens, [zEND]], Tokens0),
- list__map(pred(I::in, I-C::out) is det, Tokens0, Tokens).
+ list__map((pred(I::in, O::out) is det :-
+ O = I-C
+ ), Tokens0, Tokens).
:- pred schema_ref(sexpr, pstate, pstate).
:- mode schema_ref(out, in, out) is semidet.
Index: ztype.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/samples/muz/ztype.m,v
retrieving revision 1.1
diff -u -r1.1 ztype.m
--- ztype.m 1998/11/07 05:42:46 1.1
+++ ztype.m 1999/10/14 05:06:00
@@ -213,7 +213,9 @@
ztapply(_, G) = G :- G = given(_).
ztapply(S, power(T)) = power(ztapply(S, T)).
ztapply(S, cross(L0)) = cross(L) :-
- list__map(pred(T::in, ztapply(S, T)::out) is det, L0, L).
+ list__map((pred(T::in, U::out) is det :-
+ U = ztapply(S, T)
+ ), L0, L).
ztapply(S, schema(DL0)) = schema(DL) :-
list__map(do_decl(ztapply(S)), DL0, DL).
ztapply(S, V) = T :- V = var(I),
@@ -222,7 +224,9 @@
ztapply(_, P) = P :- P = parameter(_).
ztapply(_, unity) = unity.
ztapply(S, abbreviation(I, L0, D, N, T)) = abbreviation(I, L , D, N, T) :-
- list__map(pred(IN::in, ztapply(S, IN)::out) is det, L0, L).
+ list__map((pred(IN::in, OUT::out) is det :-
+ OUT = ztapply(S, IN)
+ ), L0, L).
:- pred do_decl(func(ztype) = ztype, pair(ident, ztype), pair(ident, ztype)).
:- mode do_decl(func(in) = out is det, in, out) is det.
Index: ztype_op.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/samples/muz/ztype_op.m,v
retrieving revision 1.1
diff -u -r1.1 ztype_op.m
--- ztype_op.m 1998/11/07 05:42:46 1.1
+++ ztype_op.m 1999/10/14 05:18:09
@@ -306,7 +306,8 @@
makeGeneric(Subst, F, DL, GDL) :-
list__length(F, FL),
M = formalsMap(F),
- P = (pred(I-T0::in, I-e(FL, T)::out) is det :-
+ P = (pred(I-T0::in, I-O::out) is det :-
+ O = e(FL, T),
makeGType(M, ztapply(Subst, T0), T)),
list__map(P, DL, GDL).
--------------------------------------------------------------------------
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