[m-rev.] diff: fix dice

Zoltan Somogyi zs at csse.unimelb.edu.au
Wed Jun 4 13:36:52 AEST 2008


tests/debugger/dice.exp2:
	Fix the failure of this test case. The old .exp2 file for this test
	case was a valid output for this program but not with the input in
	dice.inp; it was valid output for a version of dice.inp that did not
	include "-m dice" in the dice command's argument list, and thus did not
	restrict output to the predicates of the dice module.

	The new .exp2 file is just the .exp file with a few additional lines
	for the merge predicate:

	merge([], [], []).
	merge([S | Ss], [], [S | Ss]).
	merge([], [S | Ss], [S | Ss]).
	merge([A | As], [B | Bs], [C | Cs]) :- ...

	The old output assumed that the switch arm for Headvar__1 = []
	was optimized to Headvar__3 := Headvar__2. It may have been at one
	point in time, but since the HLDS code representing it is

	( % cannot_fail switch on `HeadVar__2'
		% HeadVar__2 has functor list.[]/0
		HeadVar__3 = list.[]
	;
		% HeadVar__2 has functor list.[|]/2
		HeadVar__3 = HeadVar__2
	)

	such an optimization cannot be required. The new contents of the .exp2
	file is what you expect from this HLDS.

--- dice.exp	2007-01-06 22:00:13.000000000 +1100
+++ dice.exp2	2008-06-04 13:10:13.000000000 +1000
@@ -11,6 +11,7 @@
 pred dice.merge/3-0      CALL                 dice.m:64   18 (3)    7      0.28
 pred dice.merge/3-0      EXIT                 dice.m:64   18 (3)    7      0.28
 pred dice.merge/3-0      <s1-2;>              dice.m:64    8 (3)    3      0.27
+pred dice.merge/3-0      <s1-2;s2-2;>         dice.m:66    8 (3)    3      0.27
 pred dice.merge/3-0      <s2-2;>              dice.m:64   10 (3)    4      0.29
 pred dice.merge/3-0      <s2-2;c2;s2-2;>      dice.m:67   10 (3)    4      0.29
 pred dice.merge/3-0      <s2-2;c2;s2-2;c4;?;> dice.m:69   10 (3)    4      0.29
@@ -37,6 +38,7 @@
 pred dice.merge/3-0      CALL                 dice.m:64   18 (3)    7      0.28
 pred dice.merge/3-0      EXIT                 dice.m:64   18 (3)    7      0.28
 pred dice.merge/3-0      <s1-2;>              dice.m:64    8 (3)    3      0.27
+pred dice.merge/3-0      <s1-2;s2-2;>         dice.m:66    8 (3)    3      0.27
 pred dice.msort_n/4-0    <e;e;>               dice.m:55    8 (3)    3      0.27
 pred dice.msort_n/4-0    CALL                 dice.m:37   19 (3)    7      0.27
 pred dice.msort_n/4-0    EXIT                 dice.m:37   19 (3)    7      0.27
@@ -61,6 +63,7 @@
 pred dice.merge/3-0      CALL                 dice.m:64   18 (3)    7      0.28
 pred dice.merge/3-0      EXIT                 dice.m:64   18 (3)    7      0.28
 pred dice.merge/3-0      <s1-2;>              dice.m:64    8 (3)    3      0.27
+pred dice.merge/3-0      <s1-2;s2-2;>         dice.m:66    8 (3)    3      0.27
 pred dice.msort_n/4-0    <e;e;>               dice.m:55    8 (3)    3      0.27
 pred dice.msort_n/4-0    CALL                 dice.m:37   19 (3)    7      0.27
 pred dice.msort_n/4-0    EXIT                 dice.m:37   19 (3)    7      0.27
@@ -96,6 +99,7 @@
 pred dice.msort_n/4-0    <e;t;>               dice.m:50   11 (3)    4      0.27
 pred dice.msort_n/4-0    <e;t;s2-2;>          dice.m:47   11 (3)    4      0.27
 pred dice.merge/3-0      <s1-2;>              dice.m:64    8 (3)    3      0.27
+pred dice.merge/3-0      <s1-2;s2-2;>         dice.m:66    8 (3)    3      0.27
 pred dice.msort_n/4-0    <e;e;>               dice.m:55    8 (3)    3      0.27
 pred dice.merge/3-0      <s2-2;c2;s2-2;c4;t;> dice.m:71   10 (3)    3      0.23
 pred dice.merge/3-0      <s2-2;c2;s2-2;c4;e;> dice.m:74    0 (0)    1      1.00
--------------------------------------------------------------------------
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