summaryrefslogtreecommitdiff
blob: 4d466c76a9c48ca8eaf0a549e4a569a0238af747 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
diff -ur Yap-5.1.3.orig/LGPL/chr/Makefile.in Yap-5.1.3/LGPL/chr/Makefile.in
--- Yap-5.1.3.orig/LGPL/chr/Makefile.in	2008-04-04 02:26:38.000000000 +1300
+++ Yap-5.1.3/LGPL/chr/Makefile.in	2008-07-27 15:56:49.000000000 +1200
@@ -11,7 +11,7 @@
 SHELL=@SHELL@
 PLBASE=@PLBASE@
 PLARCH=@PLARCH@
-PL=../../yap ../../startup
+PL=LD_LIBRARY_PATH=../..:system YAPSHAREDIR=$(PWD)/../../library ../../yap -b ../../pl/boot.yap
 XPCEBASE=$(PLBASE)/xpce
 PKGDOC=$(PLBASE)/doc/packages
 PCEHOME=../../xpce
@@ -48,43 +48,49 @@
 		$(srcdir)/Benchmarks/bool.chr $(srcdir)/Benchmarks/family.chr $(srcdir)/Benchmarks/fibonacci.chr $(srcdir)/Benchmarks/leq.chr $(srcdir)/Benchmarks/listdom.chr \
 		$(srcdir)/Benchmarks/chrdif.chr
 
+GPLDIR=		$(srcdir)/../../GPL
+LGPLDIR=	$(srcdir)/../../LGPL
+EXTRALIBDIR=	$(srcdir)/../../library
+GPLLIBPL=	$(EXTRALIBDIR)/aggregate.pl $(EXTRALIBDIR)/error.pl $(EXTRALIBDIR)/occurs.yap $(EXTRALIBDIR)/pairs.pl 
+LGPLLIBPL=	$(EXTRALIBDIR)/maplist.pl
+EXTRALIBPL=	$(GPLLIBPL) $(LGPLLIBPL)
+
+BOOTSTRAP=bootstrap('../../pl/init.yap'),module(user),['chr_swi_bootstrap']
+
 all:		chr_translate.pl
 
-chr_translate_bootstrap1.pl: $(srcdir)/chr_translate_bootstrap1.chr
-		$(PL) -f -l chr_swi_bootstrap.yap \
-		      -g "chr_compile_step1('$<','$@'),halt." \
-		      -z 'halt(1).'
-		$(PL) -f -l chr_swi_bootstrap.yap \
-		      -g "chr_compile_step2('$<','$@'),halt." \
-		      -z 'halt(1).'
+chr_translate_bootstrap1.pl: $(srcdir)/chr_translate_bootstrap1.chr $(EXTRALIBPL)
+		echo "$(BOOTSTRAP),chr:chr_compile_step1('$<','$@'),halt." | \
+		      $(PL)
+		echo "$(BOOTSTRAP),chr:chr_compile_step2('$<','$@'),halt." | \
+		      $(PL)
 
 chr_translate_bootstrap2.pl: $(srcdir)/chr_translate_bootstrap2.chr  chr_translate_bootstrap1.pl
-		$(PL) -f -l chr_swi_bootstrap.yap \
-		      -g "chr_compile_step2('$<','$@'),halt." \
-		      -z 'halt(1).'
-		$(PL) -f -l chr_swi_bootstrap.yap \
-		      -g "chr_compile_step3('$<','$@'),halt." \
-		      -z 'halt(1).'
+		echo "$(BOOTSTRAP),chr:chr_compile_step2('$<','$@'),halt." | \
+		      $(PL)
+		echo "$(BOOTSTRAP),chr:chr_compile_step3('$<','$@'),halt." | \
+		      $(PL)
 
 guard_entailment.pl: $(srcdir)/guard_entailment.chr chr_translate_bootstrap2.pl 
-		$(PL) -f -l chr_swi_bootstrap.yap \
-		      -g "chr_compile_step3('$<','$@'),halt." \
-		      -z 'halt(1).'
+		echo "$(BOOTSTRAP),chr:chr_compile_step3('$<','$@'),halt." | \
+		      $(PL)
 
 chr_translate.pl: $(srcdir)/chr_translate.chr chr_translate_bootstrap2.pl guard_entailment.pl
-		$(PL) -f -l chr_swi_bootstrap.yap \
-		      -g "chr_compile_step3('$<','$@'),halt." \
-		      -z 'halt(1).'
-		$(PL) -f -p chr=. -l chr_swi_bootstrap.yap \
-		      -g "chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt." \
-		      -z 'halt(1).'
-		$(PL) -f -p chr=. -l chr_swi_bootstrap.yap \
-		      -g "chr_compile_step4('$<','$@'),halt." \
-		      -z 'halt(1).'
+		echo "$(BOOTSTRAP),chr:chr_compile_step3('$<','$@'),halt." | \
+		      $(PL)
+		echo "$(BOOTSTRAP),chr:chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt." | \
+		      $(PL)
+		echo "$(BOOTSTRAP),asserta(user:file_search_path(chr,'.')),chr:chr_compile_step4('$<','$@'),halt." | \
+		      $(PL)
 
 chr.pl:		chr_swi.pl
 		cp $< $@
 
+$(GPLLIBPL): $(EXTRALIBDIR)/%: $(GPLDIR)/%
+		cp $< $@
+$(LGPLLIBPL): $(EXTRALIBDIR)/%: $(LGPLDIR)/%
+		cp $< $@
+
 install:	chr_translate.pl guard_entailment.pl
 		mkdir -p $(DESTDIR)$(CHRDIR)
 		$(INSTALL) -m 644 $(LIBPL) $(DESTDIR)$(CHRDIR)
diff -ur Yap-5.1.3.orig/LGPL/chr/chr_translate.chr Yap-5.1.3/LGPL/chr/chr_translate.chr
--- Yap-5.1.3.orig/LGPL/chr/chr_translate.chr	2008-03-14 06:43:13.000000000 +1300
+++ Yap-5.1.3/LGPL/chr/chr_translate.chr	2008-07-27 16:09:24.000000000 +1200
@@ -8756,7 +8756,7 @@
 		( NbIndexedArgs > 10 ->
 			findall([Index],member(Index,IndexedArgs),Indexes)
 		;
-			findall(Index,(sublist(Index,IndexedArgs), Index \== []),UnsortedIndexes),
+			findall(Index,(chr_sublist(Index,IndexedArgs), Index \== []),UnsortedIndexes),
 			predsort(longer_list,UnsortedIndexes,Indexes)
 		),
 		% EXPERIMENTAL HEURISTIC		
diff -ur Yap-5.1.3.orig/LGPL/chr/chr_translate_bootstrap2.chr Yap-5.1.3/LGPL/chr/chr_translate_bootstrap2.chr
--- Yap-5.1.3.orig/LGPL/chr/chr_translate_bootstrap2.chr	2008-03-14 11:37:07.000000000 +1300
+++ Yap-5.1.3/LGPL/chr/chr_translate_bootstrap2.chr	2008-07-27 16:10:15.000000000 +1200
@@ -3648,7 +3648,7 @@
 	  is_attached(C),
 	  get_store_type(C,default) ->
 		get_indexed_arguments(C,IndexedArgs),
-		findall(Index,(sublist(Index,IndexedArgs), Index \== []),Indexes),
+		findall(Index,(chr_sublist(Index,IndexedArgs), Index \== []),Indexes),
 		assumed_store_type(C,multi_store([multi_hash(Indexes),global_ground]))	
 	;
 		true
diff -ur Yap-5.1.3.orig/LGPL/chr/hprolog.pl Yap-5.1.3/LGPL/chr/hprolog.pl
--- Yap-5.1.3.orig/LGPL/chr/hprolog.pl	2008-03-14 11:37:07.000000000 +1300
+++ Yap-5.1.3/LGPL/chr/hprolog.pl	2008-07-27 16:08:23.000000000 +1200
@@ -8,7 +8,7 @@
 	    split_at/4,			% +N, +List, -FirstElements, -LastElements
 	    max_go_list/2,		% +List, -Max
 	    or_list/2,			% +ListOfInts, -BitwiseOr
-	    sublist/2,			% ?Sublist, +List
+	    chr_sublist/2,			% ?Sublist, +List
 	    bounded_sublist/3,		% ?Sublist, +List, +Bound
 	    chr_delete/3,
 	    init_store/2,
@@ -157,8 +157,8 @@
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-sublist(L, L).
-sublist(Sub, [H|T]) :-
+chr_sublist(L, L).
+chr_sublist(Sub, [H|T]) :-
 	'$sublist1'(T, H, Sub).
 
 '$sublist1'(Sub, _, Sub).