[m-rev.] diff: fix fact_table.m portability bug

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Jul 22 16:26:58 AEST 2003


On 21-Jul-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> compiler/fact_table.m:
> 	Set LC_ALL to C before invoking "sort".
> 	This is needed on Red Hat Linux 8.0 to ensure that
> 	"sort" uses the traditional lexicographical ordering.

I forgot a test case.

Branches: main
Estimated hours taken: 0.25

tests/hard_coded/Mmakefile:
tests/hard_coded/factt_sort_test.m:
tests/hard_coded/factt_sort_test.facts:
tests/hard_coded/factt_sort_test.exp:
	Add a regression test for the bug with fact table determinism
	inference that I fixed yesterday.

Workspace: /home/ceres/fjh/mercury
Index: tests/hard_coded/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.199
diff -u -d -r1.199 Mmakefile
--- tests/hard_coded/Mmakefile	13 Jun 2003 05:39:47 -0000	1.199
+++ tests/hard_coded/Mmakefile	22 Jul 2003 06:21:57 -0000
@@ -53,6 +53,7 @@
 	expand \
 	export_test \
 	factt \
+	factt_sort_test \
 	failure_unify \
 	field_syntax \
 	float_field \
Index: tests/hard_coded/factt_sort_test.exp
===================================================================
RCS file: tests/hard_coded/factt_sort_test.exp
diff -N tests/hard_coded/factt_sort_test.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/hard_coded/factt_sort_test.exp	22 Jul 2003 06:21:26 -0000
@@ -0,0 +1,4 @@
+1102 => 51316
+1103 => 51317
+1104 => fail
+1105 => 51291
Index: tests/hard_coded/factt_sort_test.facts
===================================================================
RCS file: tests/hard_coded/factt_sort_test.facts
diff -N tests/hard_coded/factt_sort_test.facts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/hard_coded/factt_sort_test.facts	21 Jul 2003 04:56:32 -0000
@@ -0,0 +1,103 @@
+
+unicode_to_big5(0x00C4, 0x0041).
+unicode_to_big5(0x00C5, 0x0041).
+unicode_to_big5(0x00C6, 0x0041).
+unicode_to_big5(0x00C7, 0x0043).
+unicode_to_big5(0x00C8, 0x885D).
+unicode_to_big5(0x00C9, 0x885B).
+unicode_to_big5(0x00CA, 0x8866).
+unicode_to_big5(0x00CB, 0x0045).
+unicode_to_big5(0x00CC, 0x0049).
+unicode_to_big5(0x00CD, 0x0049).
+unicode_to_big5(0x00CE, 0x0049).
+unicode_to_big5(0x00CF, 0x0049).
+unicode_to_big5(0x00D0, 0x0044).
+unicode_to_big5(0x00D1, 0x004E).
+unicode_to_big5(0x00D2, 0x8861).
+unicode_to_big5(0x00D3, 0x885F).
+unicode_to_big5(0x00D4, 0x004F).
+unicode_to_big5(0x00D5, 0x004F).
+unicode_to_big5(0x00D6, 0x004F).
+unicode_to_big5(0x00D7, 0xA1D1).
+unicode_to_big5(0x00D8, 0x004F).
+unicode_to_big5(0x00D9, 0x0055).
+unicode_to_big5(0x00DA, 0x0055).
+unicode_to_big5(0x00DB, 0x0055).
+unicode_to_big5(0x00DC, 0x0055).
+unicode_to_big5(0x00DD, 0x0059).
+unicode_to_big5(0x00DE, 0x0054).
+unicode_to_big5(0x00DF, 0x0073).
+unicode_to_big5(0x00E0, 0x886A).
+unicode_to_big5(0x00E1, 0x8868).
+unicode_to_big5(0x00E2, 0x0061).
+unicode_to_big5(0x00E3, 0x0061).
+unicode_to_big5(0x00E4, 0x0061).
+unicode_to_big5(0x00E5, 0x0061).
+unicode_to_big5(0x00E6, 0x0061).
+unicode_to_big5(0x00E7, 0x0063).
+unicode_to_big5(0x00E8, 0x886F).
+unicode_to_big5(0x00E9, 0x886D).
+unicode_to_big5(0x00EA, 0x88A7).
+unicode_to_big5(0x00EB, 0x0065).
+unicode_to_big5(0x00EC, 0x8873).
+unicode_to_big5(0x00ED, 0x8871).
+unicode_to_big5(0x00EE, 0x0069).
+unicode_to_big5(0x00EF, 0x0069).
+unicode_to_big5(0x00F0, 0x0065).
+unicode_to_big5(0x00F1, 0x006E).
+unicode_to_big5(0x00F2, 0x8877).
+unicode_to_big5(0x00F3, 0x8875).
+unicode_to_big5(0x00F4, 0x006F).
+unicode_to_big5(0x00F5, 0x006F).
+unicode_to_big5(0x00F6, 0x006F).
+unicode_to_big5(0x00F7, 0xA1D2).
+unicode_to_big5(0x00F8, 0xC8FB).
+unicode_to_big5(0x00F9, 0x887B).
+unicode_to_big5(0x00FA, 0x8879).
+unicode_to_big5(0x00FB, 0x0075).
+unicode_to_big5(0x00FC, 0x88A2).
+unicode_to_big5(0x00FD, 0x0079).
+unicode_to_big5(0x00FE, 0x0074).
+unicode_to_big5(0x00FF, 0x0079).
+unicode_to_big5(0x0100, 0x8856).
+unicode_to_big5(0x0101, 0x8867).
+unicode_to_big5(0x0112, 0x885A).
+unicode_to_big5(0x0113, 0x886C).
+unicode_to_big5(0x011A, 0x885C).
+unicode_to_big5(0x011B, 0x886E).
+unicode_to_big5(0x012B, 0x8870).
+unicode_to_big5(0x014B, 0xC8FC).
+unicode_to_big5(0x014C, 0x885E).
+unicode_to_big5(0x014D, 0x8874).
+unicode_to_big5(0x0153, 0xC8FA).
+unicode_to_big5(0x016B, 0x8878).
+unicode_to_big5(0x01CD, 0x8858).
+unicode_to_big5(0x01CE, 0x8869).
+unicode_to_big5(0x01D0, 0x8872).
+unicode_to_big5(0x01D1, 0x8860).
+unicode_to_big5(0x01D2, 0x8876).
+unicode_to_big5(0x01D4, 0x887A).
+unicode_to_big5(0x01D6, 0x887C).
+unicode_to_big5(0x01D8, 0x887D).
+unicode_to_big5(0x01DA, 0x887E).
+unicode_to_big5(0x01DC, 0x88A1).
+unicode_to_big5(0x0250, 0xC8F6).
+unicode_to_big5(0x0251, 0x886B).
+unicode_to_big5(0x0254, 0xC8F8).
+unicode_to_big5(0x025B, 0xC8F7).
+unicode_to_big5(0x0261, 0x88A8).
+unicode_to_big5(0x026A, 0xC8FE).
+unicode_to_big5(0x0275, 0xC8F9).
+unicode_to_big5(0x0283, 0xC8F5).
+unicode_to_big5(0x028A, 0xC8FD).
+unicode_to_big5(0x02C6, 0xC6D9).
+unicode_to_big5(0x02C7, 0xA3BE).
+unicode_to_big5(0x044E, 0xC874).
+unicode_to_big5(0x044F, 0xC875).
+unicode_to_big5(0x0451, 0xC85B).
+unicode_to_big5(0x1EBE, 0x8863).
+unicode_to_big5(0x1EBF, 0x88A4).
+unicode_to_big5(0x1EC0, 0x8865).
+unicode_to_big5(0x1EC1, 0x88A6).
+unicode_to_big5(0x2013, 0xA156).
+
Index: tests/hard_coded/factt_sort_test.m
===================================================================
RCS file: tests/hard_coded/factt_sort_test.m
diff -N tests/hard_coded/factt_sort_test.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/hard_coded/factt_sort_test.m	22 Jul 2003 06:21:16 -0000
@@ -0,0 +1,35 @@
+% This is a regression test.
+% It 
+
+:- module factt_sort_test.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io, io).
+:- mode main(di, uo) is det.
+
+:- implementation.
+:- import_module list, string.
+
+main(!IO) :-
+	test(0x044E, !IO),
+	test(0x044F, !IO),
+	test(0x0450, !IO),
+	test(0x0451, !IO).
+
+:- pred test(int, io, io).
+:- mode test(in, di, uo) is det.
+
+test(X, !IO) :-
+	( unicode_to_big5(X, Y) ->
+		format("%d => %d\n", [i(X), i(Y)], !IO)
+	;
+		format("%d => fail\n", [i(X)], !IO)
+	).
+
+:- pred unicode_to_big5(int, int).
+:- mode unicode_to_big5(in, out) is semidet.
+
+:- pragma fact_table(unicode_to_big5/2, "factt_sort_test.facts").

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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