fix tyes.
This commit is contained in:
parent
1eeb17f6f1
commit
4a5a3d833a
@ -74,7 +74,9 @@ typedef enum
|
|||||||
#define Yap_has_signal(S) Yap_has_signal__(S PASS_REGS)
|
#define Yap_has_signal(S) Yap_has_signal__(S PASS_REGS)
|
||||||
#define Yap_only_has_signal(S) Yap_only_has_signal__(S PASS_REGS)
|
#define Yap_only_has_signal(S) Yap_only_has_signal__(S PASS_REGS)
|
||||||
|
|
||||||
inline static uint64_t
|
INLINE_ONLY inline EXTERN uint64_t SIGNAL_TO_BIT( yap_signals sig);
|
||||||
|
|
||||||
|
INLINE_ONLY inline EXTERN uint64_t
|
||||||
SIGNAL_TO_BIT( yap_signals sig)
|
SIGNAL_TO_BIT( yap_signals sig)
|
||||||
{
|
{
|
||||||
return ((uint64_t)1 << (sig-1));
|
return ((uint64_t)1 << (sig-1));
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
#ifndef YAP_H
|
#ifndef YAP_H
|
||||||
#include "YapTermConfig.h"
|
#include "YapTermConfig.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_STDINT_H
|
#if HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -20,12 +20,23 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef YAP_H
|
||||||
|
|
||||||
/* The YAP main types */
|
/* The YAP main types */
|
||||||
#include "YapTerm.h"
|
#include "YapTerm.h"
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#endif /* YAP_H */
|
||||||
|
|
||||||
/* truth-values */
|
/* truth-values */
|
||||||
/* stdbool defines the booleam type, bool,
|
/* stdbool defines the booleam type, bool,
|
||||||
and the constants false and true */
|
and the constants false and true */
|
||||||
|
#if HAVE_STDINT_H
|
||||||
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
#if HAVE_STDBOOL_H
|
#if HAVE_STDBOOL_H
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#else
|
#else
|
||||||
@ -49,6 +60,9 @@ typedef int _Bool;
|
|||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE false
|
#define FALSE false
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef YAP_Bool
|
||||||
|
typedef bool YAP_Bool;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef YAP_H
|
#ifdef YAP_H
|
||||||
|
|
||||||
@ -72,8 +86,6 @@ typedef int _Bool;
|
|||||||
|
|
||||||
#define YAP_Float Float
|
#define YAP_Float Float
|
||||||
|
|
||||||
#define YAP_Bool bool
|
|
||||||
|
|
||||||
#define YAP_handle_t yhandle_t
|
#define YAP_handle_t yhandle_t
|
||||||
|
|
||||||
#define YAP_PredEntryPtr struct pred_entry *
|
#define YAP_PredEntryPtr struct pred_entry *
|
||||||
@ -92,8 +104,6 @@ typedef unsigned long long YAP_CELL;
|
|||||||
typedef uintptr_t YAP_CELL;
|
typedef uintptr_t YAP_CELL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef bool YAP_Bool;
|
|
||||||
|
|
||||||
typedef YAP_CELL YAP_Term;
|
typedef YAP_CELL YAP_Term;
|
||||||
|
|
||||||
typedef YAP_CELL YAP_Arity;
|
typedef YAP_CELL YAP_Arity;
|
||||||
@ -136,7 +146,6 @@ typedef int (*YAP_agc_hook)(void *_Atom);
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct YAP_thread_attr_struct {
|
typedef struct YAP_thread_attr_struct {
|
||||||
size_t ssize;
|
size_t ssize;
|
||||||
size_t tsize;
|
size_t tsize;
|
||||||
|
@ -41,7 +41,7 @@ typedef std::pair<ParfactorList*, ObservedFormulas*> LiftedNetwork;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
createLiftedNetwork()
|
createLiftedNetwork()
|
||||||
{
|
{
|
||||||
Parfactors parfactors;
|
Parfactors parfactors;
|
||||||
@ -79,7 +79,7 @@ createLiftedNetwork()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
createGroundNetwork()
|
createGroundNetwork()
|
||||||
{
|
{
|
||||||
std::string factorsType ((char*) YAP_AtomName (YAP_AtomOfTerm (YAP_ARG1)));
|
std::string factorsType ((char*) YAP_AtomName (YAP_AtomOfTerm (YAP_ARG1)));
|
||||||
@ -135,7 +135,7 @@ createGroundNetwork()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
runLiftedSolver()
|
runLiftedSolver()
|
||||||
{
|
{
|
||||||
LiftedNetwork* network = (LiftedNetwork*) YAP_IntOfTerm (YAP_ARG1);
|
LiftedNetwork* network = (LiftedNetwork*) YAP_IntOfTerm (YAP_ARG1);
|
||||||
@ -193,7 +193,7 @@ runLiftedSolver()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
runGroundSolver()
|
runGroundSolver()
|
||||||
{
|
{
|
||||||
FactorGraph* fg = (FactorGraph*) YAP_IntOfTerm (YAP_ARG1);
|
FactorGraph* fg = (FactorGraph*) YAP_IntOfTerm (YAP_ARG1);
|
||||||
@ -244,7 +244,7 @@ runGroundSolver()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
setParfactorsParams()
|
setParfactorsParams()
|
||||||
{
|
{
|
||||||
LiftedNetwork* network = (LiftedNetwork*) YAP_IntOfTerm (YAP_ARG1);
|
LiftedNetwork* network = (LiftedNetwork*) YAP_IntOfTerm (YAP_ARG1);
|
||||||
@ -271,7 +271,7 @@ setParfactorsParams()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
setFactorsParams()
|
setFactorsParams()
|
||||||
{
|
{
|
||||||
FactorGraph* fg = (FactorGraph*) YAP_IntOfTerm (YAP_ARG1);
|
FactorGraph* fg = (FactorGraph*) YAP_IntOfTerm (YAP_ARG1);
|
||||||
@ -297,7 +297,7 @@ setFactorsParams()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
setVarsInformation()
|
setVarsInformation()
|
||||||
{
|
{
|
||||||
Var::clearVarsInfo();
|
Var::clearVarsInfo();
|
||||||
@ -327,7 +327,7 @@ setVarsInformation()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
setHorusFlag()
|
setHorusFlag()
|
||||||
{
|
{
|
||||||
std::string option ((char*) YAP_AtomName (YAP_AtomOfTerm (YAP_ARG1)));
|
std::string option ((char*) YAP_AtomName (YAP_AtomOfTerm (YAP_ARG1)));
|
||||||
@ -352,7 +352,7 @@ setHorusFlag()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
freeGroundNetwork()
|
freeGroundNetwork()
|
||||||
{
|
{
|
||||||
delete (FactorGraph*) YAP_IntOfTerm (YAP_ARG1);
|
delete (FactorGraph*) YAP_IntOfTerm (YAP_ARG1);
|
||||||
@ -361,7 +361,7 @@ freeGroundNetwork()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
static YAP_Bool
|
||||||
freeLiftedNetwork()
|
freeLiftedNetwork()
|
||||||
{
|
{
|
||||||
LiftedNetwork* network = (LiftedNetwork*) YAP_IntOfTerm (YAP_ARG1);
|
LiftedNetwork* network = (LiftedNetwork*) YAP_IntOfTerm (YAP_ARG1);
|
||||||
@ -547,7 +547,7 @@ fillSolutionList (const std::vector<Params>& results)
|
|||||||
const Params& beliefs = results[i];
|
const Params& beliefs = results[i];
|
||||||
YAP_Term queryBeliefsL = YAP_TermNil();
|
YAP_Term queryBeliefsL = YAP_TermNil();
|
||||||
for (size_t j = beliefs.size(); j-- > 0; ) {
|
for (size_t j = beliefs.size(); j-- > 0; ) {
|
||||||
YAP_Int sl = YAP_InitSlot (list);
|
YAP_Int sl = YAP_InitSlot (list);
|
||||||
YAP_Term belief = YAP_MkFloatTerm (beliefs[j]);
|
YAP_Term belief = YAP_MkFloatTerm (beliefs[j]);
|
||||||
queryBeliefsL = YAP_MkPairTerm (belief, queryBeliefsL);
|
queryBeliefsL = YAP_MkPairTerm (belief, queryBeliefsL);
|
||||||
list = YAP_GetFromSlot (sl);
|
list = YAP_GetFromSlot (sl);
|
||||||
|
@ -262,7 +262,7 @@ term_to_cudd(DdManager *manager, YAP_Term t)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_term_to_cudd(void)
|
p_term_to_cudd(void)
|
||||||
{
|
{
|
||||||
DdManager *manager;
|
DdManager *manager;
|
||||||
@ -417,7 +417,7 @@ term_to_add(DdManager *manager, YAP_Term t)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_term_to_add(void)
|
p_term_to_add(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = Cudd_Init(0,0,CUDD_UNIQUE_SLOTS,CUDD_CACHE_SLOTS,0);
|
DdManager *manager = Cudd_Init(0,0,CUDD_UNIQUE_SLOTS,CUDD_CACHE_SLOTS,0);
|
||||||
@ -431,16 +431,16 @@ p_term_to_add(void)
|
|||||||
YAP_Unify(YAP_ARG4, YAP_MkIntTerm((YAP_Int)t));
|
YAP_Unify(YAP_ARG4, YAP_MkIntTerm((YAP_Int)t));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int complement(int i)
|
static YAP_Bool complement(int i)
|
||||||
{
|
{
|
||||||
return i == 0 ? 1 : 0;
|
return i == 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int var(DdManager *manager, DdNode *n, YAP_Int *vals ) {
|
static YAP_Bool var(DdManager *manager, DdNode *n, YAP_Int *vals ) {
|
||||||
return (int)vals[Cudd_ReadPerm(manager,Cudd_NodeReadIndex(n))];
|
return (int)vals[Cudd_ReadPerm(manager,Cudd_NodeReadIndex(n))];
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
cudd_eval(DdManager *manager, DdNode *n, YAP_Int *vals )
|
cudd_eval(DdManager *manager, DdNode *n, YAP_Int *vals )
|
||||||
{
|
{
|
||||||
if (Cudd_IsConstant(n)) {
|
if (Cudd_IsConstant(n)) {
|
||||||
@ -461,7 +461,7 @@ cudd_eval(DdManager *manager, DdNode *n, YAP_Int *vals )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
cudd_eval_top(DdManager *manager, DdNode *n, YAP_Int *vals )
|
cudd_eval_top(DdManager *manager, DdNode *n, YAP_Int *vals )
|
||||||
{
|
{
|
||||||
if (Cudd_IsComplement(n)) {
|
if (Cudd_IsComplement(n)) {
|
||||||
@ -471,7 +471,7 @@ cudd_eval_top(DdManager *manager, DdNode *n, YAP_Int *vals )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_eval_cudd(void)
|
p_eval_cudd(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
@ -511,7 +511,7 @@ add_eval(DdManager *manager, DdNode *n, YAP_Int *vals )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_eval_add(void)
|
p_eval_add(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
@ -604,7 +604,7 @@ get_vars(YAP_Term t3)
|
|||||||
return YAP_ArityOfFunctor(YAP_FunctorOfTerm(t3));
|
return YAP_ArityOfFunctor(YAP_FunctorOfTerm(t3));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_cudd_to_term(void)
|
p_cudd_to_term(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
@ -674,7 +674,7 @@ build_prolog_add(DdManager *manager, DdNode *n, YAP_Term *ar, hash_table_entry *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_add_to_term(void)
|
p_add_to_term(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
@ -716,7 +716,7 @@ p_add_to_term(void)
|
|||||||
return YAP_Unify(YAP_ARG4, t);
|
return YAP_Unify(YAP_ARG4, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_cudd_size(void)
|
p_cudd_size(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
@ -784,7 +784,7 @@ build_sp_cudd(DdManager *manager, DdNode *n, double *ar, hash_table_entry_dbl *h
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_cudd_to_p(void)
|
p_cudd_to_p(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
@ -819,7 +819,7 @@ p_cudd_to_p(void)
|
|||||||
return YAP_Unify(YAP_ARG4, YAP_MkFloatTerm(p));
|
return YAP_Unify(YAP_ARG4, YAP_MkFloatTerm(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_cudd_print(void)
|
p_cudd_print(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
@ -836,7 +836,7 @@ p_cudd_print(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_cudd_die(void)
|
p_cudd_die(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
@ -844,7 +844,7 @@ p_cudd_die(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static YAP_Bool
|
||||||
p_cudd_release_node(void)
|
p_cudd_release_node(void)
|
||||||
{
|
{
|
||||||
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
DdManager *manager = (DdManager *)YAP_IntOfTerm(YAP_ARG1);
|
||||||
|
@ -46,9 +46,9 @@ NORET quit(const char *);
|
|||||||
NORET myquit(int, const char *);
|
NORET myquit(int, const char *);
|
||||||
|
|
||||||
/* unify.c */
|
/* unify.c */
|
||||||
int unify(TERM, TERM);
|
int unify(TERM, TERM);
|
||||||
int is_UNIFIABLE(TERM, TERM);
|
int is_UNIFIABLE(TERM, TERM);
|
||||||
int is_IDENTICAL(TERM, TERM);
|
int is_IDENTICAL(TERM, TERM);
|
||||||
|
|
||||||
/* prism.c */
|
/* prism.c */
|
||||||
NORET bp4p_quit(int);
|
NORET bp4p_quit(int);
|
||||||
|
@ -178,7 +178,10 @@ extern BPLONG number_var_exception;
|
|||||||
|
|
||||||
extern BPLONG toam_signal_vec;
|
extern BPLONG toam_signal_vec;
|
||||||
|
|
||||||
#define unify YAP_Unify
|
#define unify YAP_UnifyINT
|
||||||
|
|
||||||
|
extern inline YAP_UnifyINT(YAP_Term t1, YAP_Term t2);
|
||||||
|
extern inline YAP_UnifyINT(YAP_Term t1, YAP_Term t2) { return YAP_Unify(t1,t2); }
|
||||||
|
|
||||||
INLINE_ONLY extern inline char *
|
INLINE_ONLY extern inline char *
|
||||||
bp_term_2_string(TERM t)
|
bp_term_2_string(TERM t)
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#define STUFF_H
|
#define STUFF_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
#ifndef bool
|
||||||
typedef enum { false, true } bool;
|
typedef enum { false, true } bool;
|
||||||
|
#endif
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
#if defined _MSC_VER
|
#if defined _MSC_VER
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 5e423b2d029c9dbf320649b08fc0253d64853257
|
Subproject commit 9becd0f0619379d30b26b14df642872a373f3fa4
|
Reference in New Issue
Block a user