This commit is contained in:
vscosta 2016-04-05 02:52:50 +01:00
parent a5951daea9
commit 4d3d9c408d
11 changed files with 1161 additions and 1225 deletions

View File

@ -1,32 +0,0 @@
// cmake template file
/* Define to 1 if you have the <cuddInt.h> header file. */
#ifndef HAVE_CUDDINT_H
/* #undef HAVE_CUDDINT_H */
#endif
/* Define to 1 if you have the <cudd/cuddInt.h> header file. */
#ifndef HAVE_CUDD_CUDDINT_H
#define HAVE_CUDD_CUDDINT_H 1
#endif
/* Define to 1 if you have the <cudd/cudd.h> header file. */
#ifndef HAVE_CUDD_CUDD_H
#define HAVE_CUDD_CUDD_H 1
#endif
/*Define to 1 if you have the <cudd.h> header file. */
#ifndef HAVE_CUDD_H
/* #undef HAVE_CUDD_H */
#endif
/* Define to 1 if you have the <cudd/util.h> header file. */
#ifndef HAVE_CUDD_UTIL_H
#define HAVE_CUDD_UTIL_H 1
#endif
/* Define to 1 if you have the <util.h> header file. */
#ifndef HAVE_UTIL_H
#define HAVE_UTIL_H 1
#endif

View File

@ -1,2 +0,0 @@
#define HAVE_RAPTOR2_RAPTOR2_H 1
/* #undef HAVE_RAPTOR_H */

View File

@ -1,26 +0,0 @@
/*--------------------------------------------------------------------------
* This file is autogenerated from rconfig.h.cmake
* during the cmake configuration of your project. If you need to make changes
* edit the original file NOT THIS FILE.
* --------------------------------------------------------------------------*/
#ifndef RCONFIG_H
#define RCONFIG_H
/* Define to 1 if you have the <alloca.h> header file. */
#ifndef HAVE_R_H
#define HAVE_R_H 1
#endif
/* Define to 1 if you have the <alloca.h> header file. */
#ifndef HAVE_R_EMBEDDED_H
#define HAVE_R_EMBEDDED_H 1
#endif
/* Define to 1 if you have the <alloca.h> header file. */
#ifndef HAVE_R_INTERFACE_H
#define HAVE_R_INTERFACE_H 1
#endif
#endif

View File

@ -5,7 +5,7 @@
/* Define to 1 if you have the <openssl/ripemd.h> header file. */ /* Define to 1 if you have the <openssl/ripemd.h> header file. */
#ifndef HAVE_APR_1_APR_MD5_H #ifndef HAVE_APR_1_APR_MD5_H
#define HAVE_APR_1_APR_MD5_H 1 /* #undef HAVE_APR_1_APR_MD5_H */
#endif #endif

View File

@ -1,16 +1,16 @@
/* Define if you have libreadline */ /* Define if you have libreadline */
#ifndef HAVE_LIBREADLINE #ifndef HAVE_LIBREADLINE
#define HAVE_LIBREADLINE 1 /* #undef HAVE_LIBREADLINE */
#endif #endif
/* Define to 1 if you have the <readline/history.h> header file. */ /* Define to 1 if you have the <readline/history.h> header file. */
#ifndef HAVE_READLINE_HISTORY_H #ifndef HAVE_READLINE_HISTORY_H
#define HAVE_READLINE_HISTORY_H 1 /* #undef HAVE_READLINE_HISTORY_H */
#endif #endif
/* Define to 1 if you have the <readline/readline.h> header file. */ /* Define to 1 if you have the <readline/readline.h> header file. */
#ifndef HAVE_READLINE_READLINE_H #ifndef HAVE_READLINE_READLINE_H
#define HAVE_READLINE_READLINE_H 1 /* #undef HAVE_READLINE_READLINE_H */
#endif #endif
#if defined(HAVE_LIBREADLINE) && defined(HAVE_READLINE_READLINE_H) #if defined(HAVE_LIBREADLINE) && defined(HAVE_READLINE_READLINE_H)
@ -43,12 +43,12 @@ you don't. */
/* Define to 1 if you have the `rl_begin_undo_group' function. */ /* Define to 1 if you have the `rl_begin_undo_group' function. */
#ifndef HAVE_RL_BEGIN_UNDO_GROUP #ifndef HAVE_RL_BEGIN_UNDO_GROUP
#define HAVE_RL_BEGIN_UNDO_GROUP 1 /* #undef HAVE_RL_BEGIN_UNDO_GROUP */
#endif #endif
/* Define to 1 if you have the `rl_clear_pending_input' function. */ /* Define to 1 if you have the `rl_clear_pending_input' function. */
#ifndef HAVE_RL_CLEAR_PENDING_INPUT #ifndef HAVE_RL_CLEAR_PENDING_INPUT
#define HAVE_RL_CLEAR_PENDING_INPUT 1 /* #undef HAVE_RL_CLEAR_PENDING_INPUT */
#endif #endif
/* Define to 1 if the system has the type `rl_completion_func_t'). */ /* Define to 1 if the system has the type `rl_completion_func_t'). */
@ -68,7 +68,7 @@ you don't. */
/* Define to 1 if you have the `rl_discard_argument' function. */ /* Define to 1 if you have the `rl_discard_argument' function. */
#ifndef HAVE_RL_DISCARD_ARGUMENT #ifndef HAVE_RL_DISCARD_ARGUMENT
#define HAVE_RL_DISCARD_ARGUMENT 1 /* #undef HAVE_RL_DISCARD_ARGUMENT */
#endif #endif
/* Define to 1 if you have the `rl_done' variable. */ /* Define to 1 if you have the `rl_done' variable. */
@ -78,12 +78,12 @@ you don't. */
/* Define to 1 if you have the `rl_filename_completion_function' function. */ /* Define to 1 if you have the `rl_filename_completion_function' function. */
#ifndef HAVE_RL_FILENAME_COMPLETION_FUNCTION #ifndef HAVE_RL_FILENAME_COMPLETION_FUNCTION
#define HAVE_RL_FILENAME_COMPLETION_FUNCTION 1 #define HAVE_RL_FILENAME_COMPLETION_FUNCTION
#endif #endif
/* Define to 1 if you have the `rl_free_line_state' function. */ /* Define to 1 if you have the `rl_free_line_state' function. */
#ifndef HAVE_RL_FREE_LINE_STATE #ifndef HAVE_RL_FREE_LINE_STATE
#define HAVE_RL_FREE_LINE_STATE 1 /* #undef HAVE_RL_FREE_LINE_STATE */
#endif #endif
/* Define to 1 if the system has the type `rl_hook_func_t'. */ /* Define to 1 if the system has the type `rl_hook_func_t'. */
@ -93,20 +93,20 @@ you don't. */
/* Define to 1 if you have the `rl_insert_close' function. */ /* Define to 1 if you have the `rl_insert_close' function. */
#ifndef HAVE_RL_INSERT_CLOSE #ifndef HAVE_RL_INSERT_CLOSE
#define HAVE_RL_INSERT_CLOSE 1 /* #undef HAVE_RL_INSERT_CLOSE */
#endif #endif
/* Define to 1 if you have the `rl_reset_after_signal' function. */ /* Define to 1 if you have the `rl_reset_after_signal' function. */
#ifndef HAVE_RL_RESET_AFTER_SIGNAL #ifndef HAVE_RL_RESET_AFTER_SIGNAL
#define HAVE_RL_RESET_AFTER_SIGNAL 1 /* #undef HAVE_RL_RESET_AFTER_SIGNAL */
#endif #endif
/* Define to 1 if you have the `rl_set_keyboard_input_timeout' function. */ /* Define to 1 if you have the `rl_set_keyboard_input_timeout' function. */
#ifndef HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT #ifndef HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT
#define HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT 1 /* #undef HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT */
#endif #endif
/* Define to 1 if you have the `rl_set_prompt' function. */ /* Define to 1 if you have the `rl_set_prompt' function. */
#ifndef HAVE_RL_SET_PROMPT #ifndef HAVE_RL_SET_PROMPT
#define HAVE_RL_SET_PROMPT 1 /* #undef HAVE_RL_SET_PROMPT */
#endif #endif

View File

@ -1,183 +0,0 @@
# - Try to find the CUD BDD RDF parsing library (http://librdf.org/CUDD /)
# Once done this will define
#
# CUDD_FOUND - system has CUDD
# CUDD_LIBRARIES - Link these to use CUDD
# CUDD_INCLUDE_DIR - Include directory for using CUDD
#
#
# Based on FindFontconfig Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
MACRO ( FIND_CUDD )
ENDMACRO ()
# Check if we have cached results in case the last round was successful.
if ( NOT( CUDD_INCLUDE_DIR AND CUDD_LIBRARIES ) OR NOT CUDD_FOUND )
set( CUDD_LDFLAGS )
find_package(PkgConfig)
find_path(CUDD_INCLUDE_DIR
NAMES cudd.h cudd.cudd.h
$ENV{CUDD_DIR}/include
$ENV{CUDD_DIR}
/usr/local/yap/include
/usr/local/Yap/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include/
/sw/include # Fink
/opt/local/include # MacPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
NO_DEFAULT_PATHS
)
find_path(CUDD_INCLUDE_DIR
NAMES cudd.h
)
find_library(CUDD_INTERFACE_LIBRARY
NAMES cudd
PATHS
$ENV{CUDD_DIR}/lib
$ENV{CUDD_DIR}/lib64
$ENV{CUDD_DIR}/lib-dbg
$ENV{CUDD_DIR}
$ENV{CUDD_DIR}/cudd
/usr/local/yap/lib
/usr/local/Yap/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/usr/local/lib/cudd
/usr/local/lib64/cudd
/usr/lib/cudd
/usr/lib64/cudd
/usr/freeware/lib64
)
if ( CUDD_INTERFACE_LIBRARY AND CUDD_INCLUDE_DIR )
set( CUDD_FOUND ON )
list( APPEND CUDD_LIBRARIES ${CUDD_INTERFACE_LIBRARY} )
endif ()
find_library(CUDD_UTIL_LIBRARY
NAMES cuddutil util
PATHS
$ENV{CUDD_DIR}/lib
$ENV{CUDD_DIR}/lib64
$ENV{CUDD_DIR}/lib-dbg
$ENV{CUDD_DIR}
$ENV{CUDD_DIR}/util
/usr/local/yap/lib
/usr/local/Yap/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/usr/local/lib/util
/usr/local/lib64/util
/usr/lib/util
/usr/lib64/util
/usr/freeware/lib64
)
if ( CUDD_UTIL_LIBRARY )
list( APPEND CUDD_LIBRARIES ${CUDD_UTIL_LIBRARY} )
endif ()
find_library(CUDD_ST_LIBRARY
NAMES cuddst st
PATHS
$ENV{CUDD_DIR}/lib
$ENV{CUDD_DIR}/lib64
$ENV{CUDD_DIR}/lib-dbg
$ENV{CUDD_DIR}
$ENV{CUDD_DIR}/st
/usr/local/yap/lib
/usr/local/Yap/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/usr/lib/st
/usr/lib64/st
/usr/freeware/lib64
)
if ( CUDD_ST_LIBRARY )
list( APPEND CUDD_LIBRARIES ${CUDD_ST_LIBRARY} )
endif ()
find_library(CUDD_EPD_LIBRARY
NAMES epd
PATHS
$ENV{CUDD_DIR}/lib
$ENV{CUDD_DIR}/lib64
$ENV{CUDD_DIR}/lib-dbg
$ENV{CUDD_DIR}
$ENV{CUDD_DIR}/epd
/usr/local/yap/lib
/usr/local/Yap/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/usr/lib/epd
/usr/lib64/epd
/usr/freeware/lib64
)
if ( CUDD_MTR_LIBRARY )
list( APPEND CUDD_LIBRARIES ${CUDD_MTR_LIBRARY} )
endif ()
find_library(CUDD_MTR_LIBRARY
NAMES mtr
PATHS
$ENV{CUDD_DIR}/lib
$ENV{CUDD_DIR}/lib64
$ENV{CUDD_DIR}/lib-dbg
$ENV{CUDD_DIR}
$ENV{CUDD_DIR}/mtr
/usr/local/yap/lib
/usr/local/Yap/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/usr/lib/mtr
/usr/lib64/mtr
/usr/freeware/lib64
)
if ( CUDD_MTR_LIBRARY )
list( APPEND CUDD_LIBRARIES ${CUDD_MTR_LIBRARY} )
endif ()
endif () # Check for cached values

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -190,14 +190,13 @@ form
variable=value variable=value
*/ */
#include "config.h"
#include "cudd_config.h"
#include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h>
#include <time.h> #include <time.h>
#include "config.h"
#include "cudd_config.h"
#if HAVE_UTIL_H #if HAVE_UTIL_H
#include <util.h> #include <util.h>
#endif #endif
@ -218,26 +217,27 @@ variable=value
#endif #endif
#include "general.h" #include "general.h"
#define IsHigh(manager, node) HIGH(manager) == node #define IsHigh(manager, node) HIGH(manager) == node
#define IsLow(manager, node) LOW(manager) == node #define IsLow(manager, node) LOW(manager) == node
#define HIGH(manager) Cudd_ReadOne(manager) #define HIGH(manager) Cudd_ReadOne(manager)
#define LOW(manager) Cudd_Not(Cudd_ReadOne(manager)) #define LOW(manager) Cudd_Not(Cudd_ReadOne(manager))
#define NOT(node) Cudd_Not(node) #define NOT(node) Cudd_Not(node)
#define GetIndex(node) Cudd_NodeReadIndex(node) #define GetIndex(node) Cudd_NodeReadIndex(node)
#define GetMVar(manager, index, value, varmap) equality(manager,index,value,varmap)//Cudd_bddIthVar(manager, index) #define GetMVar(manager, index, value, varmap) \
equality(manager, index, value, varmap) // Cudd_bddIthVar(manager, index)
#define GetVar(manager, index) Cudd_bddIthVar(manager, index) #define GetVar(manager, index) Cudd_bddIthVar(manager, index)
#define NewVar(manager) Cudd_bddNewVar(manager) #define NewVar(manager) Cudd_bddNewVar(manager)
#define KillBDD(manager) Cudd_Quit(manager) #define KillBDD(manager) Cudd_Quit(manager)
#define GetVarCount(manager) Cudd_ReadSize(manager) #define GetVarCount(manager) Cudd_ReadSize(manager)
#define DEBUGON _debug = 1 #define DEBUGON _debug = 1
#define DEBUGOFF _debug = 0 #define DEBUGOFF _debug = 0
#define RAPIDLOADON _RapidLoad = 1 #define RAPIDLOADON _RapidLoad = 1
#define RAPIDLOADOFF _RapidLoad = 0 #define RAPIDLOADOFF _RapidLoad = 0
#define SETMAXBUFSIZE(size) _maxbufsize = size #define SETMAXBUFSIZE(size) _maxbufsize = size
#define BDDFILE_ERROR -1 #define BDDFILE_ERROR -1
#define BDDFILE_OTHER 0 #define BDDFILE_OTHER 0
#define BDDFILE_SCRIPT 1 #define BDDFILE_SCRIPT 1
#define BDDFILE_NODEDUMP 2 #define BDDFILE_NODEDUMP 2
extern int _RapidLoad; extern int _RapidLoad;
extern int _debug; extern int _debug;
@ -253,11 +253,10 @@ typedef struct _bddfileheader {
int filetype; int filetype;
} bddfileheader; } bddfileheader;
typedef struct typedef struct {
{ int nVal, nBit, init;
int nVal,nBit,init; double *probabilities;
double * probabilities; int *booleanVars;
int * booleanVars;
} variable; } variable;
typedef struct _namedvars { typedef struct _namedvars {
@ -268,11 +267,10 @@ typedef struct _namedvars {
double *dvalue; double *dvalue;
int *ivalue; int *ivalue;
void **dynvalue; void **dynvalue;
variable * mvars; variable *mvars;
int * bVar2mVar; int *bVar2mVar;
} namedvars; } namedvars;
typedef struct _hisnode { typedef struct _hisnode {
DdNode *key; DdNode *key;
double dvalue; double dvalue;
@ -296,27 +294,31 @@ typedef struct _nodeline {
/* Initialization */ /* Initialization */
DdManager* simpleBDDinit(int varcnt); DdManager *simpleBDDinit(int varcnt);
/* BDD Generation */ /* BDD Generation */
DdNode* D_BDDAnd(DdManager *manager, DdNode *bdd1, DdNode *bdd2); DdNode *D_BDDAnd(DdManager *manager, DdNode *bdd1, DdNode *bdd2);
DdNode* D_BDDNand(DdManager *manager, DdNode *bdd1, DdNode *bdd2); DdNode *D_BDDNand(DdManager *manager, DdNode *bdd1, DdNode *bdd2);
DdNode* D_BDDOr(DdManager *manager, DdNode *bdd1, DdNode *bdd2); DdNode *D_BDDOr(DdManager *manager, DdNode *bdd1, DdNode *bdd2);
DdNode* D_BDDNor(DdManager *manager, DdNode *bdd1, DdNode *bdd2); DdNode *D_BDDNor(DdManager *manager, DdNode *bdd1, DdNode *bdd2);
DdNode* D_BDDXor(DdManager *manager, DdNode *bdd1, DdNode *bdd2); DdNode *D_BDDXor(DdManager *manager, DdNode *bdd1, DdNode *bdd2);
DdNode* D_BDDXnor(DdManager *manager, DdNode *bdd1, DdNode *bdd2); DdNode *D_BDDXnor(DdManager *manager, DdNode *bdd1, DdNode *bdd2);
DdNode* FileGenerateBDD(DdManager *manager, namedvars varmap, bddfileheader fileheader); DdNode *FileGenerateBDD(DdManager *manager, namedvars varmap,
DdNode* OnlineGenerateBDD(DdManager *manager, namedvars *varmap); bddfileheader fileheader);
DdNode* LineParser(DdManager *manager, namedvars varmap, DdNode **inter, int maxinter, char *function, int iline); DdNode *OnlineGenerateBDD(DdManager *manager, namedvars *varmap);
DdNode* OnlineLineParser(DdManager *manager, namedvars *varmap, DdNode **inter, int maxinter, char *function, int iline); DdNode *LineParser(DdManager *manager, namedvars varmap, DdNode **inter,
DdNode* BDD_Operator(DdManager *manager, DdNode *bdd1, DdNode *bdd2, char Operator, int inegoper); int maxinter, char *function, int iline);
DdNode *OnlineLineParser(DdManager *manager, namedvars *varmap, DdNode **inter,
int maxinter, char *function, int iline);
DdNode *BDD_Operator(DdManager *manager, DdNode *bdd1, DdNode *bdd2,
char Operator, int inegoper);
int getInterBDD(char *function); int getInterBDD(char *function);
char* getFileName(const char *function); char *getFileName(const char *function);
int GetParam(char *inputline, int iParam); int GetParam(char *inputline, int iParam);
int LoadVariableData(namedvars varmap, char *filename); int LoadVariableData(namedvars varmap, char *filename);
int LoadMultiVariableData(DdManager * mgr,namedvars varmap, char *filename); int LoadMultiVariableData(DdManager *mgr, namedvars varmap, char *filename);
/* Named variables */ /* Named variables */
@ -325,48 +327,61 @@ namedvars InitNamedMultiVars(int varcnt, int varstart, int bvarcnt);
void EnlargeNamedVars(namedvars *varmap, int newvarcnt); void EnlargeNamedVars(namedvars *varmap, int newvarcnt);
int AddNamedVarAt(namedvars varmap, const char *varname, int index); int AddNamedVarAt(namedvars varmap, const char *varname, int index);
int AddNamedVar(namedvars varmap, const char *varname); int AddNamedVar(namedvars varmap, const char *varname);
int AddNamedMultiVar(DdManager *mgr,namedvars varmap, const char *varnamei, int *value); int AddNamedMultiVar(DdManager *mgr, namedvars varmap, const char *varnamei,
void SetNamedVarValuesAt(namedvars varmap, int index, double dvalue, int ivalue, void *dynvalue); int *value);
int SetNamedVarValues(namedvars varmap, const char *varname, double dvalue, int ivalue, void *dynvalue); void SetNamedVarValuesAt(namedvars varmap, int index, double dvalue, int ivalue,
void *dynvalue);
int SetNamedVarValues(namedvars varmap, const char *varname, double dvalue,
int ivalue, void *dynvalue);
int GetNamedVarIndex(const namedvars varmap, const char *varname); int GetNamedVarIndex(const namedvars varmap, const char *varname);
int RepairVarcnt(namedvars *varmap); int RepairVarcnt(namedvars *varmap);
char* GetNodeVarName(DdManager *manager, namedvars varmap, DdNode *node); char *GetNodeVarName(DdManager *manager, namedvars varmap, DdNode *node);
char* GetNodeVarNameDisp(DdManager *manager, namedvars varmap, DdNode *node); char *GetNodeVarNameDisp(DdManager *manager, namedvars varmap, DdNode *node);
int all_loaded(namedvars varmap, int disp); int all_loaded(namedvars varmap, int disp);
/* Traversal */ /* Traversal */
DdNode* HighNodeOf(DdManager *manager, DdNode *node); DdNode *HighNodeOf(DdManager *manager, DdNode *node);
DdNode* LowNodeOf(DdManager *manager, DdNode *node); DdNode *LowNodeOf(DdManager *manager, DdNode *node);
/* Traversal - History */ /* Traversal - History */
hisqueue* InitHistory(int varcnt); hisqueue *InitHistory(int varcnt);
void ReInitHistory(hisqueue *HisQueue, int varcnt); void ReInitHistory(hisqueue *HisQueue, int varcnt);
void AddNode(hisqueue *HisQueue, int varstart, DdNode *node, double dvalue, int ivalue, void *dynvalue); void AddNode(hisqueue *HisQueue, int varstart, DdNode *node, double dvalue,
hisnode* GetNode(hisqueue *HisQueue, int varstart, DdNode *node); int ivalue, void *dynvalue);
hisnode *GetNode(hisqueue *HisQueue, int varstart, DdNode *node);
int GetNodeIndex(hisqueue *HisQueue, int varstart, DdNode *node); int GetNodeIndex(hisqueue *HisQueue, int varstart, DdNode *node);
void onlinetraverse(DdManager *manager, namedvars varmap, hisqueue *HisQueue, DdNode *bdd); void onlinetraverse(DdManager *manager, namedvars varmap, hisqueue *HisQueue,
DdNode *bdd);
/* Save-load */ /* Save-load */
bddfileheader ReadFileHeader(char *filename); bddfileheader ReadFileHeader(char *filename);
int CheckFileVersion(const char *version); int CheckFileVersion(const char *version);
DdNode * LoadNodeDump(DdManager *manager, namedvars varmap, FILE *inputfile); DdNode *LoadNodeDump(DdManager *manager, namedvars varmap, FILE *inputfile);
DdNode * LoadNodeRec(DdManager *manager, namedvars varmap, hisqueue *Nodes, FILE *inputfile, nodeline current); DdNode *LoadNodeRec(DdManager *manager, namedvars varmap, hisqueue *Nodes,
DdNode * GetIfExists(DdManager *manager, namedvars varmap, hisqueue *Nodes, char *varname, int nodenum); FILE *inputfile, nodeline current);
DdNode *GetIfExists(DdManager *manager, namedvars varmap, hisqueue *Nodes,
char *varname, int nodenum);
int SaveNodeDump(DdManager *manager, namedvars varmap, DdNode *bdd, char *filename); int SaveNodeDump(DdManager *manager, namedvars varmap, DdNode *bdd,
void SaveExpand(DdManager *manager, namedvars varmap, hisqueue *Nodes, DdNode *Current, FILE *outputfile); char *filename);
void SaveExpand(DdManager *manager, namedvars varmap, hisqueue *Nodes,
DdNode *Current, FILE *outputfile);
void ExpandNodes(hisqueue *Nodes, int index, int nodenum); void ExpandNodes(hisqueue *Nodes, int index, int nodenum);
/* Export */ /* Export */
int simpleBDDtoDot(DdManager *manager, DdNode *bdd, char *filename); int simpleBDDtoDot(DdManager *manager, DdNode *bdd, char *filename);
int simpleNamedBDDtoDot(DdManager *manager, namedvars varmap, DdNode *bdd, char *filename); int simpleNamedBDDtoDot(DdManager *manager, namedvars varmap, DdNode *bdd,
char *filename);
DdNode * equality(DdManager *mgr,int varIndex,int value,namedvars varmap); DdNode *equality(DdManager *mgr, int varIndex, int value, namedvars varmap);
hisnode* GetNodei1(int *bVar2mVar,hisqueue *HisQueue, int varstart, DdNode *node); hisnode *GetNodei1(int *bVar2mVar, hisqueue *HisQueue, int varstart,
void AddNode1(int *bVar2mVar, hisqueue *HisQueue, int varstart, DdNode *node, double dvalue, int ivalue, void *dynvalue); DdNode *node);
hisnode* GetNode1(int *bVar2mVar,hisqueue *HisQueue, int varstart, DdNode *node); void AddNode1(int *bVar2mVar, hisqueue *HisQueue, int varstart, DdNode *node,
double dvalue, int ivalue, void *dynvalue);
hisnode *GetNode1(int *bVar2mVar, hisqueue *HisQueue, int varstart,
DdNode *node);

View File

@ -1,4 +1,3 @@
package pt.up.fc.dcc.yap;
/**** using sqlite /**** using sqlite
For example,the following: For example,the following:
@ -25,6 +24,9 @@ The SQLiteStatement.simpleQueryForBlobFileDescriptor() API is not available. The
****/ ****/
import pt.up.fc.dcc.Yap.*;
import android.app.Activity; import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
@ -45,12 +47,14 @@ import org.sqlite.database.sqlite.SQLiteOpenHelper;
import org.sqlite.database.SQLException; import org.sqlite.database.SQLException;
import org.sqlite.database.DatabaseErrorHandler; import org.sqlite.database.DatabaseErrorHandler;
class DoNotDeleteErrorHandler implements DatabaseErrorHandler { class DoNotDeleteErrorHandler implements DatabaseErrorHandler {
private static final String TAG = "DoNotDeleteErrorHandler"; private static final String TAG = "DoNotDeleteErrorHandler";
public void onCorruption(SQLiteDatabase dbObj) { public void onCorruption(SQLiteDatabase dbObj) {
Log.e(TAG, "Corruption reported by sqlite on database: " + dbObj.getPath()); Log.e(TAG, "Corruption reported by sqlite on database: " + dbObj.getPath());
} }
} }
public class JavaYap extends Activity public class JavaYap extends Activity
{ {
TextView outputText = null; TextView outputText = null;
@ -242,8 +246,7 @@ public class JavaYap extends Activity
System.loadLibrary("android"); System.loadLibrary("android");
System.loadLibrary("log"); System.loadLibrary("log");
System.loadLibrary("gmp"); System.loadLibrary("gmp");
System.loadLibrary("sqliteX"); System.loadLibrary("YapDroid");
System.loadLibrary("example");
} }
private static native void load(AssetManager mgr); private static native void load(AssetManager mgr);

View File

@ -1360,6 +1360,12 @@ not(G) :- \+ '$execute'(G).
'$check_callable'(_,_). '$check_callable'(_,_).
'$bootstrap' :-
bootstrap('init.yap').
module(user),
'$live'.
bootstrap(F) :- bootstrap(F) :-
% '$open'(F, '$csult', Stream, 0, 0, F), % '$open'(F, '$csult', Stream, 0, 0, F),
% '$file_name'(Stream,File), % '$file_name'(Stream,File),