From b1ee4dfb0dedfa4fbf48ecd5fdcef5481cb5c87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 22 Mar 2012 22:06:47 +0000 Subject: [PATCH 1/6] fix debugging info (use flags, not global variable).:: --- C/tracer.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/C/tracer.c b/C/tracer.c index 74da2a1bc..d8e686db1 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -52,17 +52,7 @@ send_tracer_message(char *start, char *name, Int arity, char *mname, CELL *args) if (args) { for (i= 0; i < arity; i++) { if (i > 0) fprintf(GLOBAL_stderr, ","); -#if DEBUG -#if COROUTINING - Yap_Portray_delays = TRUE; -#endif -#endif - Yap_plwrite(args[i], NULL, 15, Handle_vars_f, 1200); -#if DEBUG -#if COROUTINING - Yap_Portray_delays = FALSE; -#endif -#endif + Yap_plwrite(args[i], NULL, 15, Handle_vars_f|AttVar_Portray_f, 1200); } if (arity) { fprintf(GLOBAL_stderr, ")"); From 756bba9bc50ccc3d7d0e8d7be3bd00623dc89251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 22 Mar 2012 22:09:08 +0000 Subject: [PATCH 2/6] fix by UN to do type checking on sort. --- pl/sort.yap | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pl/sort.yap b/pl/sort.yap index cbbc7ca1e..5b09c4379 100644 --- a/pl/sort.yap +++ b/pl/sort.yap @@ -54,6 +54,27 @@ length(L, M) :- M is N + 1, NL = [_|L], '$$_length2'(L, O, M) ). sort(L,O) :- + '$skip_list'(L,NL,RL), + ( RL == [] -> true ; + var(RL) -> '$do_error'(instantiation_error,sort(L,O)) ; + '$do_error'(type_error(list,L),sort(L,O)) + ), + ( + nonvar(O) + -> + ( + O == [] + -> + L == [] + ; + '$skip_list'(O,NO,RO), + ( RO == [] -> NO =< NL ; + var(RO) -> NO =< NL ; + '$do_error'(type_error(list,O),sort(L,O)) + ) + ) + ; true + ), '$sort'(L,O). msort(L,O) :- From 4d5c70b64b6585c9c227580660e97e36d4019c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 22 Mar 2012 22:10:23 +0000 Subject: [PATCH 3/6] fix operator handling (by UN). --- pl/utils.yap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl/utils.yap b/pl/utils.yap index 83306a5d3..46ff54fec 100644 --- a/pl/utils.yap +++ b/pl/utils.yap @@ -99,7 +99,7 @@ '$check_op_name'(P,T,'|',G) :- ( integer(P), - P < 1001 + P < 1001, P > 0 ; atom_codes(T,[_,_]) ), !, From 1e2abadd784615f952c895e1fb1ae90b2a53ec2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 22 Mar 2012 22:12:13 +0000 Subject: [PATCH 4/6] patch by UN: op/3 typo in error --- pl/utils.yap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl/utils.yap b/pl/utils.yap index 46ff54fec..28e519b35 100644 --- a/pl/utils.yap +++ b/pl/utils.yap @@ -93,7 +93,7 @@ '$check_op_name'(_,_,',',G) :- !, '$do_error'(permission_error(modify,operator,','),G). '$check_op_name'(_,_,'[]',G) :- !, - '$do_error'(permispsion_error(create,operator,'[]'),G). + '$do_error'(permission_error(create,operator,'[]'),G). '$check_op_name'(_,_,'{}',G) :- !, '$do_error'(permission_error(create,operator,'{}'),G). '$check_op_name'(P,T,'|',G) :- From 65e61cfefdd342bcecd62c73658f5c6c73318a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 22 Mar 2012 22:13:11 +0000 Subject: [PATCH 5/6] patch by UN: op/3 typo in error --- pl/threads.yap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl/threads.yap b/pl/threads.yap index 2d84b7692..cf856b671 100644 --- a/pl/threads.yap +++ b/pl/threads.yap @@ -209,7 +209,7 @@ thread_create(Goal, Id, Options) :- % vsc: ????? thread_defaults(Defaults) :- nonvar(Defaults), !, - '$do_error'(uninstantion_error(Defaults), thread_defaults(Defaults)). + '$do_error'(uninstantiation_error(Defaults), thread_defaults(Defaults)). thread_defaults([stack(Stack), trail(Trail), system(System), detached(Detached), at_exit(AtExit)]) :- recorded('$thread_defaults',[Stack, Trail, System, Detached, AtExit], _). From 573c11e8b217c1cccf8e21fd7adc458fcb2c4bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 22 Mar 2012 22:15:07 +0000 Subject: [PATCH 6/6] patch by UN: Avoid writing quoted for bar. Conforms to 6.3.4.3 of ISO/IEC 13211-1:1995/Cor 2:2012 --- C/write.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/C/write.c b/C/write.c index 93b8f30c6..0c078ad93 100644 --- a/C/write.c +++ b/C/write.c @@ -1014,13 +1014,15 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str wrputc(')', wglb->stream); lastw = separator; } - /* avoid quoting commas */ - if (strcmp(RepAtom(atom)->StrOfAE,",")) - putAtom(atom, wglb->Quote_illegal, wglb); - else { + /* avoid quoting commas and bars */ + if (!strcmp(RepAtom(atom)->StrOfAE,",")) { wrputc(',', wglb->stream); lastw = separator; - } + } else if (!strcmp(RepAtom(atom)->StrOfAE,"|")) { + wrputc('|', wglb->stream); + lastw = separator; + } else + putAtom(atom, wglb->Quote_illegal, wglb); if (bracket_right) { wrputc('(', wglb->stream); lastw = separator;