[m-rev.] diff: change argument order in stack and pqueue modules

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jan 24 16:22:04 AEDT 2012


(Code that needs to maintain compatibility with 11.07 should use the
predicates in the svpqueue and svstack modules.)

Branches: main

Change the argument order of some predicates in the stack and pqueue modules in
order to make them more conducive to the use of state variable notation.

library/pqueue.m:
library/stack.m:
 	Change the argument ordering as above.

 	Rename some variables in stack.m.

library/svpqueue.m:
library/svstack.m:
 	Make the predicates exported by these modules as obsolete.

NEWS:
 	Announce the above changes.

compiler/code_info.m:
compiler/delay_info.m:
compiler/ml_gen_info.m:
compiler/mode_constraint_robdd.m:
compiler/mode_ordering.m:
 	Conform to the above changes.

Julien.

Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.397
diff -u -r1.397 code_info.m
--- compiler/code_info.m	17 Jan 2012 15:49:44 -0000	1.397
+++ compiler/code_info.m	23 Jan 2012 06:06:48 -0000
@@ -1762,7 +1762,7 @@
                  (
                      CurfrMaxfr = must_be_equal,
                      ResumeKnown = resume_point_known(has_been_done),
-                    stack.pop(ResumePoints, TopResumePoint, RestResumePoints),
+                    stack.pop(TopResumePoint, ResumePoints, RestResumePoints),
                      stack.is_empty(RestResumePoints),
                      TopResumePoint = stack_only(_, do_fail)
                  ->
@@ -2032,7 +2032,7 @@
  ite_enter_then(HijackInfo, ITEResumePoint, ThenCode, ElseCode, !CI) :-
      get_fail_info(!.CI, FailInfo0),
      FailInfo0 = fail_info(ResumePoints0, ResumeKnown0, CurfrMaxfr, _, Allow),
-    stack.det_pop(ResumePoints0, _, ResumePoints),
+    stack.det_pop(_, ResumePoints0, ResumePoints),
      HijackInfo = ite_info(HijackResumeKnown, OldCondEnv, HijackType,
          MaybeRegionInfo),
      (
@@ -2299,7 +2299,7 @@
          Allow),
      stack.det_top(ResumePoints0, TopResumePoint),
      clone_resume_point(TopResumePoint, NewResumePoint, !CI),
-    stack.push(ResumePoints0, NewResumePoint, ResumePoints),
+    stack.push(NewResumePoint, ResumePoints0, ResumePoints),
      FailInfo = fail_info(ResumePoints, resume_point_known(has_been_done),
          CurfrMaxfr, CondEnv, Allow),
      set_fail_info(FailInfo, !CI),
@@ -2678,7 +2678,7 @@
      ;
          true
      ),
-    stack.push(ResumePoints0, ResumePoint, ResumePoints),
+    stack.push(ResumePoint, ResumePoints0, ResumePoints),
      (
          CodeModel = model_non,
          pick_stack_resume_point(ResumePoint, _, StackLabel),
@@ -2703,7 +2703,7 @@
      get_fail_info(!.CI, FailInfo0),
      FailInfo0 = fail_info(ResumePoints0, ResumeKnown, CurfrMaxfr,
          CondEnv, Allow),
-    stack.det_pop(ResumePoints0, _, ResumePoints),
+    stack.det_pop(_, ResumePoints0, ResumePoints),
      FailInfo = fail_info(ResumePoints, ResumeKnown, CurfrMaxfr,
          CondEnv, Allow),
      set_fail_info(FailInfo, !CI).
@@ -2808,7 +2808,7 @@
      get_fail_info(CI, FailInfo),
      FailInfo = fail_info(ResumePoints0, ResumeKnown, _, _, _),
      (
-        stack.pop(ResumePoints0, ResumePoint1, ResumePoints1),
+        stack.pop(ResumePoint1, ResumePoints0, ResumePoints1),
          stack.is_empty(ResumePoints1),
          ResumePoint1 = stack_only(_, do_fail)
      ->
@@ -2988,7 +2988,7 @@
      ),
      ResumePoint = stack_only(StackMap, ResumeAddress),
      stack.init(ResumeStack0),
-    stack.push(ResumeStack0, ResumePoint, ResumeStack),
+    stack.push(ResumePoint, ResumeStack0, ResumeStack),
      get_fail_info(!.CI, FailInfo0),
      FailInfo0 = fail_info(_, _, _, _, Allow),
      FailInfo = fail_info(ResumeStack, ResumeKnown, CurfrMaxfr,
Index: compiler/delay_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/delay_info.m,v
retrieving revision 1.37
diff -u -r1.37 delay_info.m
--- compiler/delay_info.m	16 Aug 2011 03:26:30 -0000	1.37
+++ compiler/delay_info.m	23 Jan 2012 06:05:26 -0000
@@ -238,8 +238,8 @@
      DelayInfo0 = delay_info(CurrentDepth0, DelayedGoalStack0,
          WaitingGoalsTable, PendingGoals, NextSeqNums0),
      map.init(DelayedGoals),
-    stack.push(DelayedGoalStack0, DelayedGoals, DelayedGoalStack),
-    stack.push(NextSeqNums0, 0, NextSeqNums),
+    stack.push(DelayedGoals, DelayedGoalStack0, DelayedGoalStack),
+    stack.push(0, NextSeqNums0, NextSeqNums),
      CurrentDepth = CurrentDepth0 + 1,
      DelayInfo = delay_info(CurrentDepth, DelayedGoalStack,
          WaitingGoalsTable, PendingGoals, NextSeqNums),
@@ -251,11 +251,11 @@
      delay_info_check_invariant(DelayInfo0),
      DelayInfo0 = delay_info(CurrentDepth0, DelayedGoalStack0,
          WaitingGoalsTable0, PendingGoals, NextSeqNums0),
-    stack.det_pop(DelayedGoalStack0, DelayedGoals, DelayedGoalStack),
+    stack.det_pop(DelayedGoals, DelayedGoalStack0, DelayedGoalStack),
      map.keys(DelayedGoals, SeqNums),
      remove_delayed_goals(SeqNums, DelayedGoals, CurrentDepth0,
          WaitingGoalsTable0, WaitingGoalsTable),
-    stack.det_pop(NextSeqNums0, _, NextSeqNums),
+    stack.det_pop(_, NextSeqNums0, NextSeqNums),
      CurrentDepth = CurrentDepth0 - 1,
      map.values(DelayedGoals, DelayedGoalsList),
      DelayInfo = delay_info(CurrentDepth, DelayedGoalStack,
@@ -293,15 +293,15 @@
          WaitingGoalsTable0, PendingGoals, NextSeqNums0),

      % Get the next sequence number
-    stack.det_pop(NextSeqNums0, SeqNum, NextSeqNums1),
+    stack.det_pop(SeqNum, NextSeqNums0, NextSeqNums1),
      NextSeq = SeqNum + 1,
-    stack.push(NextSeqNums1, NextSeq, NextSeqNums),
+    stack.push(NextSeq, NextSeqNums1, NextSeqNums),

      % Store the goal in the delayed goal stack
-    stack.det_pop(DelayedGoalStack0, DelayedGoals0, DelayedGoalStack1),
+    stack.det_pop(DelayedGoals0, DelayedGoalStack0, DelayedGoalStack1),
      map.set(SeqNum, delayed_goal(Vars, Error, Goal),
          DelayedGoals0, DelayedGoals),
-    stack.push(DelayedGoalStack1, DelayedGoals, DelayedGoalStack),
+    stack.push(DelayedGoals, DelayedGoalStack1, DelayedGoalStack),

      % Store indexes to the goal in the waiting goals table
      GoalNum = delay_goal_num(CurrentDepth, SeqNum),
@@ -462,11 +462,11 @@
      PendingGoals0 = [SeqNum | PendingGoals],
      map.set(CurrentDepth, PendingGoals,
          PendingGoalsTable0, PendingGoalsTable),
-    stack.det_pop(DelayedGoalStack0, DelayedGoals0, DelayedGoalStack1),
+    stack.det_pop(DelayedGoals0, DelayedGoalStack0, DelayedGoalStack1),
      map.lookup(DelayedGoals0, SeqNum, DelayedGoal),
      DelayedGoal = delayed_goal(_Vars, _ErrorReason, Goal),
      map.delete(SeqNum, DelayedGoals0, DelayedGoals),
-    stack.push(DelayedGoalStack1, DelayedGoals, DelayedGoalStack),
+    stack.push(DelayedGoals, DelayedGoalStack1, DelayedGoalStack),
      !:DelayInfo = delay_info(CurrentDepth, DelayedGoalStack, WaitingGoals,
          PendingGoalsTable, NextSeqNums),
      delay_info_check_invariant(!.DelayInfo).
Index: compiler/ml_gen_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_gen_info.m,v
retrieving revision 1.4
diff -u -r1.4 ml_gen_info.m
--- compiler/ml_gen_info.m	10 May 2011 04:12:25 -0000	1.4
+++ compiler/ml_gen_info.m	23 Jan 2012 06:03:32 -0000
@@ -573,12 +573,12 @@

  ml_gen_info_push_success_cont(SuccCont, !Info) :-
      ml_gen_info_get_success_cont_stack(!.Info, Stack0),
-    stack.push(Stack0, SuccCont, Stack),
+    stack.push(SuccCont, Stack0, Stack),
      ml_gen_info_set_success_cont_stack(Stack, !Info).

  ml_gen_info_pop_success_cont(!Info) :-
      ml_gen_info_get_success_cont_stack(!.Info, Stack0),
-    stack.det_pop(Stack0, _SuccCont, Stack),
+    stack.det_pop(_SuccCont, Stack0, Stack),
      ml_gen_info_set_success_cont_stack(Stack, !Info).

  ml_gen_info_current_success_cont(Info, SuccCont) :-
Index: compiler/mode_constraint_robdd.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_constraint_robdd.m,v
retrieving revision 1.22
diff -u -r1.22 mode_constraint_robdd.m
--- compiler/mode_constraint_robdd.m	16 Aug 2011 03:26:32 -0000	1.22
+++ compiler/mode_constraint_robdd.m	23 Jan 2012 06:05:59 -0000
@@ -255,7 +255,7 @@

  leave_lambda_goal(!MCI) :-
      LambdaPath0 = !.MCI ^ mci_lambda_path,
-    stack.det_pop(LambdaPath0, _GoalPath, LambdaPath),
+    stack.det_pop(_GoalPath, LambdaPath0, LambdaPath),
      !MCI ^ mci_lambda_path := LambdaPath.

  :- type prog_var_and_level
@@ -414,7 +414,7 @@
                      Key = key(RepVar, PredId, LambdaId0),
                      PredId = MCI ^ mci_pred_id,
                      RepVar = ProgVar `at` GoalId,
-                    stack.push(LambdaId0, GoalId, LambdaId)
+                    stack.push(GoalId, LambdaId0, LambdaId)
                  ->
                      ( map.search(PVM0, LambdaId, Vs0) ->
                          set_of_var.insert(ProgVar, Vs0, Vs),
Index: compiler/mode_ordering.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_ordering.m,v
retrieving revision 1.39
diff -u -r1.39 mode_ordering.m
--- compiler/mode_ordering.m	26 Sep 2011 07:08:56 -0000	1.39
+++ compiler/mode_ordering.m	23 Jan 2012 06:01:39 -0000
@@ -173,7 +173,7 @@

  leave_lambda_goal(!MOI) :-
      LambdaNesting0 = !.MOI ^ moi_lambda_nesting,
-    stack.det_pop(LambdaNesting0, _, LambdaNesting),
+    stack.det_pop(_, LambdaNesting0, LambdaNesting),
      !MOI ^ moi_lambda_nesting := LambdaNesting.

  :- pred mode_order_goal(hlds_goal::in, hlds_goal::out,
Index: library/pqueue.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/pqueue.m,v
retrieving revision 1.31
diff -u -r1.31 pqueue.m
--- library/pqueue.m	18 May 2011 11:23:05 -0000	1.31
+++ library/pqueue.m	23 Jan 2012 05:49:22 -0000
@@ -44,13 +44,13 @@
      % and return the new priority queue.
      %
  :- func pqueue.insert(pqueue(K, V), K, V) = pqueue(K, V).
-:- pred pqueue.insert(pqueue(K, V)::in, K::in, V::in, pqueue(K, V)::out)
+:- pred pqueue.insert(K::in, V::in, pqueue(K, V)::in, pqueue(K, V)::out)
      is det.

      % Remove the smallest item from the priority queue.
      % Fails if the priority queue is empty.
      %
-:- pred pqueue.remove(pqueue(K, V)::in, K::out, V::out, pqueue(K, V)::out)
+:- pred pqueue.remove(K::out, V::out, pqueue(K, V)::in, pqueue(K, V)::out)
      is semidet.

      % As above, but calls error/1 if the priority queue is empty.
@@ -106,11 +106,11 @@

  %---------------------------------------------------------------------------%

-pqueue.insert(PQ1, K, V) = PQ2 :-
-    pqueue.insert(PQ1, K, V, PQ2).
+pqueue.insert(!.PQ, K, V) = !:PQ :-
+    pqueue.insert(K, V, !PQ).

-pqueue.insert(empty, K, V, pqueue(0, K, V, empty, empty)).
-pqueue.insert(pqueue(D0, K0, V0, L0, R0), K, V, PQ) :-
+pqueue.insert(K, V, empty, pqueue(0, K, V, empty, empty)).
+pqueue.insert(K, V, pqueue(D0, K0, V0, L0, R0), PQ) :-
      D = D0 + 1,
      compare(CMP, K, K0),
      ( CMP = (<) ->
@@ -135,24 +135,24 @@
  pqueue.insert_2(K, V, pqueue(D0, K0, V0, L0, R0), pqueue(D1, K1, V1, L1, R1),
          PQ1, PQ2) :-
      ( D0 > D1 ->
-        pqueue.insert(pqueue(D1, K1, V1, L1, R1), K, V, PQ2),
+        pqueue.insert(K, V, pqueue(D1, K1, V1, L1, R1), PQ2),
          PQ1 = pqueue(D0, K0, V0, L0, R0)
      ;
-        pqueue.insert(pqueue(D0, K0, V0, L0, R0), K, V, PQ1),
+        pqueue.insert(K, V, pqueue(D0, K0, V0, L0, R0), PQ1),
          PQ2 = pqueue(D1, K1, V1, L1, R1)
      ).

  %---------------------------------------------------------------------------%

  pqueue.det_remove(K, V, !PQ) :-
-    ( if pqueue.remove(!.PQ, K0, V0, !:PQ) then
+    ( if pqueue.remove(K0, V0, !PQ) then
          K = K0,
          V = V0
        else
          error("pqueue.det_remove/4: empty priority queue")
      ).

-pqueue.remove(pqueue(_, K, V, L0, R0), K, V, PQ) :-
+pqueue.remove(K, V, pqueue(_, K, V, L0, R0), PQ) :-
      pqueue.remove_2(L0, R0, PQ).

  :- pred pqueue.remove_2(pqueue(K, V)::in, pqueue(K, V)::in, pqueue(K, V)::out)
@@ -181,7 +181,7 @@
      pqueue.to_assoc_list(PQ, AL).

  pqueue.to_assoc_list(Q0, L) :-
-    ( pqueue.remove(Q0, K, V, Q1) ->
+    ( pqueue.remove(K, V, Q0, Q1) ->
          pqueue.to_assoc_list(Q1, L0),
          L = [K - V | L0]
      ;
@@ -195,7 +195,7 @@
      pqueue.init(Q).
  pqueue.assoc_list_to_pqueue([K - V | L], Q) :-
      pqueue.assoc_list_to_pqueue(L, Q0),
-    pqueue.insert(Q0, K, V, Q).
+    pqueue.insert(K, V, Q0, Q).

  pqueue.from_assoc_list(List) = PQueue :-
      pqueue.assoc_list_to_pqueue(List, PQueue).
Index: library/stack.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/stack.m,v
retrieving revision 1.28
diff -u -r1.28 stack.m
--- library/stack.m	3 Jan 2012 11:04:48 -0000	1.28
+++ library/stack.m	23 Jan 2012 05:56:42 -0000
@@ -38,18 +38,18 @@
  	%
  :- pred stack.is_full(stack(T)::in) is semidet.

-	% `stack.push(Stack0, Elem, Stack)' is true iff `Stack' is
+	% `stack.push(Elem, Stack0, Stack)' is true iff `Stack' is
  	% the stack which results from pushing `Elem' onto the top
  	% of `Stack0'.
  	%
-:- pred stack.push(stack(T)::in, T::in, stack(T)::out) is det.
+:- pred stack.push(T::in, stack(T)::in, stack(T)::out) is det.
  :- func stack.push(stack(T), T) = stack(T).

-	% `stack.push_list(Stack0, Elems, Stack)' is true iff `Stack'
+	% `stack.push_list(Elems, Stack0, Stack)' is true iff `Stack'
  	% is the stack which results from pushing the elements of the
  	% list `Elems' onto the top of `Stack0'.
  	%
-:- pred stack.push_list(stack(T)::in, list(T)::in, stack(T)::out) is det.
+:- pred stack.push_list(list(T)::in, stack(T)::in, stack(T)::out) is det.
  :- func stack.push_list(stack(T), list(T)) = stack(T).

  	% `stack.top(Stack, Elem)' is true iff `Stack' is a non-empty
@@ -63,16 +63,16 @@
  :- pred stack.det_top(stack(T)::in, T::out) is det.
  :- func stack.det_top(stack(T)) = T.

-	% `stack.pop(Stack0, Elem, Stack)' is true iff `Stack0' is
+	% `stack.pop(Elem, Stack0, Stack)' is true iff `Stack0' is
  	% a non-empty stack whose top element is `Elem', and `Stack'
  	% the stack which results from popping `Elem' off `Stack0'.
  	%
-:- pred stack.pop(stack(T)::in, T::out, stack(T)::out) is semidet.
+:- pred stack.pop(T::out, stack(T)::in, stack(T)::out) is semidet.

  	% `stack.det_pop' is like `stack.pop' except that it will
  	% call error/1 rather than failing if given an empty stack.
  	%
-:- pred stack.det_pop(stack(T)::in, T::out, stack(T)::out) is det.
+:- pred stack.det_pop(T::out, stack(T)::in, stack(T)::out) is det.

  	% `stack.depth(Stack, Depth)' is true iff `Stack' is a stack
  	% containing `Depth' elements.
@@ -92,8 +92,8 @@
  :- type stack(T)
      --->    stack(list(T)).

-stack.init = S :-
-	stack.init(S).
+stack.init = Stack :-
+	stack.init(Stack).

  stack.init(stack([])).

@@ -102,23 +102,25 @@
  stack.is_full(_) :-
  	semidet_fail.

-stack.push(S1, X) = S2 :-
-	stack.push(S1, X, S2).
+stack.push(!.Stack, X) = !:Stack :-
+	stack.push(X, !Stack).

-stack.push(stack(Elems), Elem, stack([Elem | Elems])).
-
-stack.push_list(S1, Xs) = S2 :-
-	stack.push_list(S1, Xs, S2).
-
-stack.push_list(Stack, [], Stack).
-stack.push_list(Stack0, [Elem | Elems], Stack1) :-
-	stack.push(Stack0, Elem, Stack2),
-	stack.push_list(Stack2, Elems, Stack1).
+stack.push(Elem, !Stack) :-
+    !.Stack = stack(Elems),
+    !:Stack = stack([Elem | Elems]).
+
+stack.push_list(!.Stack, Xs) = !:Stack :-
+	stack.push_list(Xs, !Stack).
+
+stack.push_list([], !Stack).
+stack.push_list([Elem | Elems], !Stack) :-
+	stack.push(Elem, !Stack),
+	stack.push_list(Elems, !Stack).

  stack.top(stack([Elem | _]), Elem).

-stack.det_top(S) = X :-
-	stack.det_top(S, X).
+stack.det_top(Stack) = X :-
+	stack.det_top(Stack, X).

  stack.det_top(Stack, Elem) :-
  	(
@@ -128,21 +130,24 @@
  		error("stack.det_top: top of empty stack")
  	).

-stack.pop(stack([Elem | Elems]), Elem, stack(Elems)).
+stack.pop(Elem, !Stack) :-
+    !.Stack = stack([Elem | Elems]),
+    !:Stack = stack(Elems).

-stack.det_pop(Stack0, Elem, Stack) :-
+stack.det_pop( Elem, !Stack) :-
  	(
-        Stack0 = stack([Elem | Elems]),
-        Stack = stack(Elems)
+        !.Stack = stack([Elem | Elems]),
+        !:Stack = stack(Elems)
  	;
-        Stack0 = stack([]),
+        !.Stack = stack([]),
  		error("stack.det_pop: pop from empty stack")
  	).

-stack.depth(S) = N :-
-	stack.depth(S, N).
+stack.depth(Stack) = Depth :-
+	stack.depth(Stack, Depth).

-stack.depth(stack(Elems), Depth) :-
+stack.depth(Stack, Depth) :-
+    Stack = stack(Elems),
  	list.length(Elems, Depth).

  %--------------------------------------------------------------------------%
Index: library/svpqueue.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/svpqueue.m,v
retrieving revision 1.1
diff -u -r1.1 svpqueue.m
--- library/svpqueue.m	18 May 2011 11:23:05 -0000	1.1
+++ library/svpqueue.m	23 Jan 2012 15:44:40 -0000
@@ -29,12 +29,14 @@
      % Insert a value V with key K into a priority queue
      % and return the new priority queue.
      %
+:- pragma obsolete(svpqueue.insert/4).
  :- pred svpqueue.insert(K::in, V::in, pqueue(K, V)::in, pqueue(K, V)::out)
      is det.

      % Remove the smallest item from the priority queue.
      % Fails if the priority queue is empty.
      %
+:- pragma obsolete(svpqueue.remove/4).
  :- pred svpqueue.remove(K::out, V::out, pqueue(K, V)::in, pqueue(K, V)::out)
      is semidet.

@@ -44,10 +46,10 @@
  :- implementation.

  svpqueue.insert(K, V, !PQ) :-
-    pqueue.insert(!.PQ, K, V, !:PQ).
+    pqueue.insert(K, V, !PQ).

  svpqueue.remove(K, V, !PQ) :-
-    pqueue.remove(!.PQ, K, V, !:PQ).
+    pqueue.remove(K, V, !PQ).

  %---------------------------------------------------------------------------%
  :- end_module svpqueue.
Index: library/svstack.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/svstack.m,v
retrieving revision 1.1
diff -u -r1.1 svstack.m
--- library/svstack.m	18 May 2011 11:23:05 -0000	1.1
+++ library/svstack.m	23 Jan 2012 15:43:11 -0000
@@ -29,23 +29,27 @@
      % the stack which results from pushing `Elem' onto the top
      % of `Stack0'.
      %
+:- pragma obsolete(svstack.push/3).
  :- pred svstack.push(T::in, stack(T)::in, stack(T)::out) is det.

      % `svstack.push_list(Elems, Stack0, Stack)' is true iff `Stack'
      % is the stack which results from pushing the elements of the
      % list `Elems' onto the top of `Stack0'.
      %
+:- pragma obsolete(svstack.push_list/3).
  :- pred svstack.push_list(list(T)::in, stack(T)::in, stack(T)::out) is det.

      % `svstack.pop(Elem, Stack0, Stack)' is true iff `Stack0' is
      % a non-empty stack whose top element is `Elem', and `Stack'
      % the stack which results from popping `Elem' off `Stack0'.
      %
+:- pragma obsolete(svstack.pop/3).
  :- pred svstack.pop(T::out, stack(T)::in, stack(T)::out) is semidet.

      % `svstack.det_pop' is like `svstack.pop' except that it will
      % call error/1 rather than failing if given an empty stack.
      %
+:- pragma obsolete(svstack.det_pop/3).
  :- pred svstack.det_pop(T::out, stack(T)::in, stack(T)::out) is det.

  %--------------------------------------------------------------------------%
@@ -56,16 +60,16 @@
  %--------------------------------------------------------------------------%

  svstack.push(E, !S) :-
-    stack.push(!.S, E, !:S). 
+    stack.push(E, !S).

  svstack.push_list(Es, !S) :-
-    stack.push_list(!.S, Es, !:S).
+    stack.push_list(Es, !S).

  svstack.pop(E, !S) :-
-    stack.pop(!.S, E, !:S).
+    stack.pop(E, !S).

  svstack.det_pop(E, !S) :-
-    stack.det_pop(!.S, E, !:S).
+    stack.det_pop(E, !S).

  %--------------------------------------------------------------------------%
  :- end_module svstack.


--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list