fix min list
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1882 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
039067068e
commit
498c7a6d42
@ -10,8 +10,11 @@
|
|||||||
* File: c_interface.c *
|
* File: c_interface.c *
|
||||||
* comments: c_interface primitives definition *
|
* comments: c_interface primitives definition *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2007-05-14 16:44:11 $,$Author: vsc $ *
|
* Last rev: $Date: 2007-05-15 11:33:51 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.93 2007/05/14 16:44:11 vsc
|
||||||
|
* improve external interface
|
||||||
|
*
|
||||||
* Revision 1.92 2007/04/18 23:01:16 vsc
|
* Revision 1.92 2007/04/18 23:01:16 vsc
|
||||||
* fix deadlock when trying to create a module with the same name as a
|
* fix deadlock when trying to create a module with the same name as a
|
||||||
* predicate (for now, just don't lock modules). obs Paulo Moura.
|
* predicate (for now, just don't lock modules). obs Paulo Moura.
|
||||||
@ -314,7 +317,7 @@ X_API Term STD_PROTO(YAP_BufferToAtomList, (char *));
|
|||||||
X_API void STD_PROTO(YAP_Error,(int, Term, char *, ...));
|
X_API void STD_PROTO(YAP_Error,(int, Term, char *, ...));
|
||||||
X_API Term STD_PROTO(YAP_RunGoal,(Term));
|
X_API Term STD_PROTO(YAP_RunGoal,(Term));
|
||||||
X_API int STD_PROTO(YAP_RestartGoal,(void));
|
X_API int STD_PROTO(YAP_RestartGoal,(void));
|
||||||
X_API int STD_PROTO(YAP_ShutdownGoal,(void));
|
X_API int STD_PROTO(YAP_ShutdownGoal,(int));
|
||||||
X_API int STD_PROTO(YAP_GoalHasException,(Term *));
|
X_API int STD_PROTO(YAP_GoalHasException,(Term *));
|
||||||
X_API void STD_PROTO(YAP_ClearExceptions,(void));
|
X_API void STD_PROTO(YAP_ClearExceptions,(void));
|
||||||
X_API int STD_PROTO(YAP_ContinueGoal,(void));
|
X_API int STD_PROTO(YAP_ContinueGoal,(void));
|
||||||
@ -1129,7 +1132,7 @@ YAP_RestartGoal(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
X_API int
|
X_API int
|
||||||
YAP_ShutdownGoal(void)
|
YAP_ShutdownGoal(int backtrack)
|
||||||
{
|
{
|
||||||
BACKUP_MACHINE_REGS();
|
BACKUP_MACHINE_REGS();
|
||||||
|
|
||||||
@ -1146,11 +1149,14 @@ YAP_ShutdownGoal(void)
|
|||||||
#endif
|
#endif
|
||||||
/* just force backtrack */
|
/* just force backtrack */
|
||||||
B = cut_pt;
|
B = cut_pt;
|
||||||
|
if (backtrack) {
|
||||||
P = FAILCODE;
|
P = FAILCODE;
|
||||||
Yap_exec_absmi(TRUE);
|
Yap_exec_absmi(TRUE);
|
||||||
/* recover stack space */
|
/* recover stack space */
|
||||||
H = cut_pt->cp_h;
|
H = cut_pt->cp_h;
|
||||||
TR = cut_pt->cp_tr;
|
TR = cut_pt->cp_tr;
|
||||||
|
}
|
||||||
|
/* we can always recover the stack */
|
||||||
ENV = cut_pt->cp_env;
|
ENV = cut_pt->cp_env;
|
||||||
ASP = (CELL *)(cut_pt+1);
|
ASP = (CELL *)(cut_pt+1);
|
||||||
ASP += EnvSizeInCells;
|
ASP += EnvSizeInCells;
|
||||||
|
6
C/exec.c
6
C/exec.c
@ -402,12 +402,6 @@ p_execute(void)
|
|||||||
return do_execute(t, CurrentModule);
|
return do_execute(t, CurrentModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
Yap_Execute(Term t)
|
|
||||||
{ /* '$execute'(Goal) */
|
|
||||||
return do_execute(t, CurrentModule);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
heap_store(Term t)
|
heap_store(Term t)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
<h2>Yap-5.1.2:</h2>
|
<h2>Yap-5.1.2:</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li> FIXED: min_list (obs from Angelika, Bernd & Niels).</li>
|
||||||
<li> FIXED: issues with C-Interface (obs from Trevor Walker).</li>
|
<li> FIXED: issues with C-Interface (obs from Trevor Walker).</li>
|
||||||
<li> FIXED: mktime needs to know if daylight time savings are on
|
<li> FIXED: mktime needs to know if daylight time savings are on
|
||||||
(obs from Bernd Gutmann).</li>
|
(obs from Bernd Gutmann).</li>
|
||||||
|
@ -12798,11 +12798,12 @@ Look for the next solution to the current query by forcing YAP to
|
|||||||
backtrack to the latest goal. Notice that slots allocated since the last
|
backtrack to the latest goal. Notice that slots allocated since the last
|
||||||
@code{YAP_RunGoal} will become invalid.
|
@code{YAP_RunGoal} will become invalid.
|
||||||
|
|
||||||
@item @code{int} YAP_ShutdownGoal(@code{void})
|
@item @code{int} YAP_ShutdownGoal(@code{int backtrack})
|
||||||
@findex YAP_ShutdownGoal/0
|
@findex YAP_ShutdownGoal/0
|
||||||
Clean up the current goal. All it space should be recovered and any
|
Clean up the current goal. If
|
||||||
pointers to the goal will become invalid. Also notice that slots
|
@code{backtrack} is true, stack space will be recovered and bindings
|
||||||
allocated since the goal was started will be invalid.
|
will be undone. In both cases, any slots allocated since the goal was
|
||||||
|
created will become invalid.
|
||||||
|
|
||||||
@item @code{int} YAP_Reset(@code{void})
|
@item @code{int} YAP_Reset(@code{void})
|
||||||
@findex YAP_Reset/0
|
@findex YAP_Reset/0
|
||||||
|
@ -222,8 +222,8 @@ extern X_API YAP_Term PROTO(YAP_RunGoal,(YAP_Term));
|
|||||||
/* int YAP_RestartGoal(void) */
|
/* int YAP_RestartGoal(void) */
|
||||||
extern X_API YAP_Bool PROTO(YAP_RestartGoal,(void));
|
extern X_API YAP_Bool PROTO(YAP_RestartGoal,(void));
|
||||||
|
|
||||||
/* int YAP_ShutdownGoal(void) */
|
/* int YAP_ShutdownGoal(int) */
|
||||||
extern X_API YAP_Bool PROTO(YAP_ShutdownGoal,(void));
|
extern X_API YAP_Bool PROTO(YAP_ShutdownGoal,(int));
|
||||||
|
|
||||||
/* int YAP_ContinueGoal(void) */
|
/* int YAP_ContinueGoal(void) */
|
||||||
extern X_API YAP_Bool PROTO(YAP_ContinueGoal,(void));
|
extern X_API YAP_Bool PROTO(YAP_ContinueGoal,(void));
|
||||||
|
@ -335,7 +335,7 @@ max_list([H|L],Max0,Max) :-
|
|||||||
).
|
).
|
||||||
|
|
||||||
min_list([H|L],Max) :-
|
min_list([H|L],Max) :-
|
||||||
max_list(L,H,Max).
|
min_list(L,H,Max).
|
||||||
|
|
||||||
min_list([],Max,Max).
|
min_list([],Max,Max).
|
||||||
min_list([H|L],Max0,Max) :-
|
min_list([H|L],Max0,Max) :-
|
||||||
|
Reference in New Issue
Block a user