This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/swig/yap.c
2014-05-06 09:39:04 +01:00

30 lines
443 B
C

#include <stdio.h>
#include <stdlib.h>
#include "YapInterface.h"
static void init_yap( void );
int yap_prove_string(char *s);
static int yap_on;
int
prove_string(char *s) {
if (!yap_on)
init_yap();
if (YAP_RunGoal(YAP_MkAtomTerm(YAP_LookupAtom(s)))) {
YAP_ShutdownGoal( TRUE );
return TRUE;
}
return FALSE;
}
static void
init_yap( void )
{
if (YAP_FastInit(NULL) == YAP_BOOT_ERROR)
exit(1);
yap_on = TRUE;
}