small bug fixes

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1213 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2004-12-16 06:08:57 +00:00
parent 7acacd1618
commit 319207d3c6
5 changed files with 16 additions and 15 deletions

View File

@ -24,22 +24,22 @@ new(black([],[],[],[])).
new(K,V,black(Nil,K,V,Nil)) :-
Nil = black([],[],[],[]).
lookup(Key, Val, black([],_,_,[])) :- !, fail.
lookup(_, _, black([],_,_,[])) :- !, fail.
lookup(Key, Val, Tree) :-
arg(2,Tree,KA),
compare(Cmp,KA,Key),
lookup(Cmp,Key,Val,Tree).
lookup(<, K, V, Tree) :-
lookup(>, K, V, Tree) :-
arg(1,Tree,NTree),
lookup(K, V, NTree).
lookup(>, K, V, Tree) :-
lookup(<, K, V, Tree) :-
arg(4,Tree,NTree),
lookup(K, V, NTree).
lookup(=, K, V, Tree) :-
lookup(=, _, V, Tree) :-
arg(3,Tree,V).
lookupall(Key, Val, black([],_,_,[])) :- !, fail.
lookupall(_, _, black([],_,_,[])) :- !, fail.
lookupall(Key, Val, Tree) :-
arg(2,Tree,KA),
compare(Cmp,KA,Key),
@ -48,7 +48,7 @@ lookupall(Key, Val, Tree) :-
lookupall(>, K, V, Tree) :-
arg(4,Tree,NTree),
lookupall(K, V, NTree).
lookupall(=, K, V, Tree) :-
lookupall(=, _, V, Tree) :-
arg(3,Tree,V).
lookupall(=, K, V, Tree) :-
arg(1,Tree,NTree),
@ -440,7 +440,6 @@ bclean_tree(X1,X,T0,TF) :-
X2 is X1-1,
( rbtree(TI) -> true ; abort),
bclean_tree(X2,X,TI,TF).
tree(X2,X,TI,TF).

View File

@ -51,7 +51,7 @@ static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_CTYPE_H && !defined(_WIN32) && !defined(__CYGWIN__)
#if HAVE_CTYPE_H
#include <ctype.h>
#endif
#if HAVE_LIMITS_H

View File

@ -55,7 +55,7 @@ static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94";
#endif
#include <stdio.h>
#include <stdlib.h>
#if HAVE_CTYPE_H && !defined(_WIN32) && !defined(__CYGWIN__)
#if HAVE_CTYPE_H
#include <ctype.h>
#endif
#if HAVE_STRING_H

View File

@ -228,12 +228,8 @@ extern X_API int PL_set_engine(PL_engine_t,PL_engine_t *);
extern X_API int PL_get_string_chars(term_t, char **, int *);
extern X_API int PL_action(int,...);
extern X_API int Sprintf(char *,...);
extern X_API int Sdprintf(char *,...);
int swi_install(void);

View File

@ -738,7 +738,13 @@ not(G) :- \+ '$execute'(G).
S \= M, % can't try importing from the module itself.
!,
'$exit_undefp',
'$execute'(S:G).
(
'$meta_expansion'(S,M,G,G1,[])
->
'$execute'(S:G1)
;
'$execute'(S:G)
).
'$do_undefp'(G,M) :-
'$is_expand_goal_or_meta_predicate'(G,M),
'$system_catch'(goal_expansion(G, M, NG), user, _, fail), !,