handle all opcodes in restore/1 and fix ord_union/2 bug.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@17 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
3a3a0ff465
commit
6f3d55651c
16
C/save.c
16
C/save.c
@ -2104,6 +2104,7 @@ RestoreClause(Clause *Cl)
|
||||
case _p_slr_vv:
|
||||
case _p_arg_vv:
|
||||
case _p_func2s_vv:
|
||||
case _p_func2f_xx:
|
||||
pc->u.xxx.x = XAdjust(pc->u.xxx.x);
|
||||
pc->u.xxx.x1 = XAdjust(pc->u.xxx.x1);
|
||||
pc->u.xxx.x2 = XAdjust(pc->u.xxx.x2);
|
||||
@ -2140,6 +2141,13 @@ RestoreClause(Clause *Cl)
|
||||
pc->u.xcx.xi = XAdjust(pc->u.xcx.xi);
|
||||
pc = NEXTOP(pc,xcx);
|
||||
break;
|
||||
/* instructions type xyx */
|
||||
case _p_func2f_xy:
|
||||
pc->u.xyx.x = XAdjust(pc->u.xyx.x);
|
||||
pc->u.xyx.x1 = XAdjust(pc->u.xyx.x1);
|
||||
pc->u.xyx.y2 = YAdjust(pc->u.xyx.y2);
|
||||
pc = NEXTOP(pc,xyx);
|
||||
break;
|
||||
/* instructions type yxx */
|
||||
case _p_plus_y_vv:
|
||||
case _p_minus_y_vv:
|
||||
@ -2151,11 +2159,19 @@ RestoreClause(Clause *Cl)
|
||||
case _p_slr_y_vv:
|
||||
case _p_arg_y_vv:
|
||||
case _p_func2s_y_vv:
|
||||
case _p_func2f_yx:
|
||||
pc->u.yxx.y = YAdjust(pc->u.yxx.y);
|
||||
pc->u.yxx.x1 = XAdjust(pc->u.yxx.x1);
|
||||
pc->u.yxx.x2 = XAdjust(pc->u.yxx.x2);
|
||||
pc = NEXTOP(pc,yxx);
|
||||
break;
|
||||
/* instructions type yyx */
|
||||
case _p_func2f_yy:
|
||||
pc->u.yyx.y1 = YAdjust(pc->u.yyx.y1);
|
||||
pc->u.yyx.y2 = YAdjust(pc->u.yyx.y2);
|
||||
pc->u.yyx.x = XAdjust(pc->u.yyx.x);
|
||||
pc = NEXTOP(pc,yyx);
|
||||
break;
|
||||
/* instructions type yxc */
|
||||
case _p_plus_y_vc:
|
||||
case _p_minus_y_cv:
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
<H2 ALIGN=CENTER>Yap-4.3.19:</H2>
|
||||
<UL>
|
||||
<LI> FIXED: ord_union/2 should not use use merge/3 but instead
|
||||
ord_union/3 (report from Nicos Angelopoulos).
|
||||
<LI> FIXED: statistics/0 should report to user_error (report from Nicos
|
||||
Angelopoulos).
|
||||
<LI> FIXED: database could copy compiled floats,longs, and bigs
|
||||
|
14
docs/yap.tex
14
docs/yap.tex
@ -6537,15 +6537,19 @@ True when @var{Numbers} is a list of integers, and @var{Total} is their sum.
|
||||
@cindex ordered set
|
||||
|
||||
The following ordered set manipulation routines are available once
|
||||
included with the @code{use_module(library(ordsets))} command.
|
||||
included with the @code{use_module(library(ordsets))} command. An
|
||||
ordered set is represented by a list having unique and ordered
|
||||
elements. Output arguments are guaranteed to be ordered sets, if the
|
||||
relevant inputs are. This is a slightly patched version of Richard
|
||||
O'Keefe's original library.
|
||||
|
||||
@table @code
|
||||
@item list_to_ord_set(+@var{List}, ?@var{Set})
|
||||
@findex list_to_ord_set/2
|
||||
@syindex list_to_ord_set/2
|
||||
@cnindex list_to_ord_set/2
|
||||
Holds when @var{Set} is the ordered representation of the set represented
|
||||
by the unordered representation @var{List}.
|
||||
Holds when @var{Set} is the ordered representation of the set
|
||||
represented by the unordered representation @var{List}.
|
||||
|
||||
@item merge(+@var{List1}, +@var{List2}, -@var{Merged})
|
||||
@findex merge/3
|
||||
@ -6553,6 +6557,10 @@ by the unordered representation @var{List}.
|
||||
@cnindex merge/3
|
||||
Holds when @var{Merged} is the stable merge of the two given lists.
|
||||
|
||||
Notice that @code{merge/3} will not remove duplicates, so merging
|
||||
ordered sets will not necessarily result in an ordered set. Use
|
||||
@code{ord_union/3} instead.
|
||||
|
||||
@item ord_add_element(+@var{Set1}, +@var{Element}, ?@var{Set2})
|
||||
@findex ord_add_element/3
|
||||
@syindex ord_add_element/3
|
||||
|
@ -316,16 +316,16 @@ ord_member(>,El,[H|T]) :-
|
||||
ord_union([], []).
|
||||
ord_union([Set|Sets], Union) :-
|
||||
length([Set|Sets], NumberOfSets),
|
||||
merge_all(NumberOfSets, [Set|Sets], Union, []).
|
||||
ord_union_all(NumberOfSets, [Set|Sets], Union, []).
|
||||
|
||||
merge_all(N,Sets0,Union,Sets) :-
|
||||
ord_union_all(N,Sets0,Union,Sets) :-
|
||||
( N=:=1 -> Sets0=[Union|Sets]
|
||||
; N=:=2 -> Sets0=[Set1,Set2|Sets],
|
||||
merge(Set1,Set2,Union)
|
||||
ord_union(Set1,Set2,Union)
|
||||
; A is N>>1,
|
||||
Z is N-A,
|
||||
merge_all(A, Sets0, X, Sets1),
|
||||
merge_all(Z, Sets1, Y, Sets),
|
||||
merge(X, Y, Union)
|
||||
ord_union_all(A, Sets0, X, Sets1),
|
||||
ord_union_all(Z, Sets1, Y, Sets),
|
||||
ord_union(X, Y, Union)
|
||||
).
|
||||
|
||||
|
Reference in New Issue
Block a user