summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/yap/files/yap-5.1.3-chr.patch')
-rw-r--r--dev-lang/yap/files/yap-5.1.3-chr.patch134
1 files changed, 134 insertions, 0 deletions
diff --git a/dev-lang/yap/files/yap-5.1.3-chr.patch b/dev-lang/yap/files/yap-5.1.3-chr.patch
new file mode 100644
index 000000000000..4d466c76a9c4
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.3-chr.patch
@@ -0,0 +1,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).