slgdelay.c File Reference

#include "xsb_config.h"
#include "xsb_debug.h"
#include <stdio.h>
#include <stdlib.h>
#include "debugs/debug_delay.h"
#include "auxlry.h"
#include "cell_xsb.h"
#include "psc_xsb.h"
#include "register.h"
#include "trie_internals.h"
#include "memory_xsb.h"
#include "choice.h"
#include "macro_xsb.h"
#include "tr_utils.h"
#include "inst_xsb.h"
#include "error_xsb.h"
#include "io_builtins_xsb.h"
#include "thread_xsb.h"

Defines

#define new_entry(NEW_ENTRY,RELEASED,NEXT_FREE,CURRENT_BLOCK,CURRENT_BLOCK_TOP,NEXT_FUNCTION,ENTRY_TYPE,BLOCK_SIZE,ABORT_MESG)
#define release_entry(ENTRY_TO_BE_RELEASED,RELEASED,NEXT_FUNCTION)
#define remove_pnde(PNDE_HEAD, PNDE_ITEM)

Functions

static void simplify_neg_succeeds (CTXTdeclc VariantSF)
void simplify_pos_unsupported (CTXTdeclc NODEptr)
static void simplify_pos_unconditional (CTXTdeclc NODEptr)
unsigned long allocated_de_space (int *num_blocks)
static int released_de_num (void)
unsigned long unused_de_space (void)
unsigned long allocated_dl_space (int *num_blocks)
static int released_dl_num (void)
unsigned long unused_dl_space (void)
static DE intern_delay_element (CTXTdeclc Cell delay_elem)
static DL intern_delay_list (CTXTdeclc CPtr dlist)
static void record_de_usage (DL dl)
void do_delay_stuff (CTXTdeclc NODEptr as_leaf, VariantSF subgoal, xsbBool sf_exists)
xsbBool answer_is_junk (CPtr dlist)
static xsbBool remove_de_from_dl (DE de, DL dl)
static xsbBool remove_dl_from_dl_list (DL dl, ASI asi)
static void handle_empty_dl_creation (CTXTdeclc DL dl)
static void handle_unsupported_answer_subst (CTXTdeclc NODEptr as_leaf)
void release_all_dls (ASI asi)
void simplify_neg_fails (CTXTdeclc VariantSF subgoal)
void abolish_wfs_space (CTXTdecl)
void force_answer_true (CTXTdeclc NODEptr as_leaf)
void force_answer_false (CTXTdeclc NODEptr as_leaf)

Variables

static unsigned long de_block_size_glc = 2048 * sizeof(struct delay_element)
static unsigned long dl_block_size_glc = 2048 * sizeof(struct delay_list)
static unsigned long pnde_block_size_glc = 2048 *sizeof(struct pos_neg_de_list)
static char * current_de_block_gl = NULL
static char * current_dl_block_gl = NULL
static char * current_pnde_block_gl = NULL
static DE released_des_gl = NULL
static DL released_dls_gl = NULL
static PNDE released_pndes_gl = NULL
static DE next_free_de_gl = NULL
static DL next_free_dl_gl = NULL
static PNDE next_free_pnde_gl = NULL
static DE current_de_block_top_gl = NULL
static DL current_dl_block_top_gl = NULL
static PNDE current_pnde_block_top_gl = NULL

Define Documentation

#define new_entry NEW_ENTRY,
RELEASED,
NEXT_FREE,
CURRENT_BLOCK,
CURRENT_BLOCK_TOP,
NEXT_FUNCTION,
ENTRY_TYPE,
BLOCK_SIZE,
ABORT_MESG   ) 
 

Value:

if (RELEASED) {                                                 \
    NEW_ENTRY = RELEASED;                                               \
    RELEASED = NEXT_FUNCTION(RELEASED);                                 \
  }                                                                     \
  else if (NEXT_FREE < CURRENT_BLOCK_TOP)                               \
    NEW_ENTRY = NEXT_FREE++;                                            \
  else {                                                                \
    char *new_block;                                                    \
    if ((new_block = (char *) mem_alloc(BLOCK_SIZE + sizeof(Cell),TABLE_SPACE)) == NULL)\
      xsb_abort(ABORT_MESG);                                            \
    *(char **) new_block = CURRENT_BLOCK;                               \
    CURRENT_BLOCK = new_block;                                          \
    NEXT_FREE = (ENTRY_TYPE)(new_block + sizeof(Cell));                 \
    CURRENT_BLOCK_TOP = (ENTRY_TYPE)(new_block + sizeof(Cell) + BLOCK_SIZE);\
    NEW_ENTRY = NEXT_FREE++;                                            \
  }

#define release_entry ENTRY_TO_BE_RELEASED,
RELEASED,
NEXT_FUNCTION   ) 
 

Value:

{                                       \
  NEXT_FUNCTION(ENTRY_TO_BE_RELEASED) = RELEASED;                       \
  RELEASED = ENTRY_TO_BE_RELEASED;                                      \
}

#define remove_pnde PNDE_HEAD,
PNDE_ITEM   ) 
 

Value:

{               \
  PNDE *pnde_head_ptr;                                  \
  PNDE next;                                            \
                                                        \
  pnde_head_ptr = &(PNDE_HEAD);                         \
  next = pnde_next(PNDE_ITEM);                          \
  if (*pnde_head_ptr == PNDE_ITEM)                      \
    *pnde_head_ptr = next;                              \
  else {                                                \
    pnde_next(pnde_prev(PNDE_ITEM)) = next;             \
    if (next)                                           \
      pnde_prev(next) = pnde_prev(PNDE_ITEM);           \
  }                                                     \
  release_entry(PNDE_ITEM, released_pndes_gl, pnde_next);       \
}


Function Documentation

void abolish_wfs_space CTXTdecl   ) 
 

unsigned long allocated_de_space int num_blocks  ) 
 

unsigned long allocated_dl_space int num_blocks  ) 
 

xsbBool answer_is_junk CPtr  dlist  ) 
 

void do_delay_stuff CTXTdeclc NODEptr  as_leaf,
VariantSF  subgoal,
xsbBool  sf_exists
 

void force_answer_false CTXTdeclc NODEptr  as_leaf  ) 
 

void force_answer_true CTXTdeclc NODEptr  as_leaf  ) 
 

static void handle_empty_dl_creation CTXTdeclc DL  dl  )  [static]
 

static void handle_unsupported_answer_subst CTXTdeclc NODEptr  as_leaf  )  [static]
 

static DE intern_delay_element CTXTdeclc Cell  delay_elem  )  [static]
 

static DL intern_delay_list CTXTdeclc CPtr  dlist  )  [static]
 

static void record_de_usage DL  dl  )  [static]
 

void release_all_dls ASI  asi  ) 
 

static int released_de_num void   )  [static]
 

static int released_dl_num void   )  [static]
 

static xsbBool remove_de_from_dl DE  de,
DL  dl
[static]
 

static xsbBool remove_dl_from_dl_list DL  dl,
ASI  asi
[static]
 

void simplify_neg_fails CTXTdeclc VariantSF  subgoal  ) 
 

static void simplify_neg_succeeds CTXTdeclc  VariantSF  )  [static]
 

static void simplify_pos_unconditional CTXTdeclc  NODEptr  )  [static]
 

void simplify_pos_unsupported CTXTdeclc  NODEptr  ) 
 

unsigned long unused_de_space void   ) 
 

unsigned long unused_dl_space void   ) 
 


Variable Documentation

char* current_de_block_gl = NULL [static]
 

DE current_de_block_top_gl = NULL [static]
 

char* current_dl_block_gl = NULL [static]
 

DL current_dl_block_top_gl = NULL [static]
 

char* current_pnde_block_gl = NULL [static]
 

PNDE current_pnde_block_top_gl = NULL [static]
 

unsigned long de_block_size_glc = 2048 * sizeof(struct delay_element) [static]
 

unsigned long dl_block_size_glc = 2048 * sizeof(struct delay_list) [static]
 

DE next_free_de_gl = NULL [static]
 

DL next_free_dl_gl = NULL [static]
 

PNDE next_free_pnde_gl = NULL [static]
 

unsigned long pnde_block_size_glc = 2048 *sizeof(struct pos_neg_de_list) [static]
 

DE released_des_gl = NULL [static]
 

DL released_dls_gl = NULL [static]
 

PNDE released_pndes_gl = NULL [static]
 


Generated on Wed Jul 26 13:26:54 2006 for XSB by  doxygen 1.4.5