slgdelay.h File Reference

#include "debugs/debug_delay.h"

Data Structures

struct  AS_info
struct  delay_element
struct  delay_list
struct  pos_neg_de_list

Defines

#define NEG_DELAY   0
#define delay_negatively(SUBGOAL)
#define delay_positively(SUBGOAL, ANSWER, MAKE_SUBSF)
#define asi_pdes(X)   (X) -> pdes
#define asi_subgoal(X)   (X) -> subgoal
#define asi_dl_list(X)   (X) -> dl_list
#define create_as_info(ANS, SUBG)
#define de_subgoal(X)   (X) -> subgoal
#define de_ans_subst(X)   (X) -> ans_subst
#define de_next(X)   (X) -> next
#define de_pnde(X)   (X) -> pnde
#define de_subs_fact_leaf(X)   (X) -> subs_fact_leaf
#define dl_de_list(X)   (X) -> de_list
#define dl_next(X)   (X) -> next
#define dl_asl(X)   (X) -> asl
#define pnde_dl(X)   (X) -> dl
#define pnde_de(X)   (X) -> de
#define pnde_prev(X)   (X) -> prev
#define pnde_next(X)   (X) -> next
#define UNCONDITIONAL_MARK   0x3
#define Delay(X)   (ASI) ((word) (TN_Child(X)) & ~UNCONDITIONAL_MARK)
#define is_conditional_answer(ANS)   (Child(ANS) && !((word) (Child(ANS)) & UNCONDITIONAL_MARK))
#define is_unconditional_answer(ANS)   (!Child(ANS) || ((word) (Child(ANS)) & UNCONDITIONAL_MARK))
#define was_simplifiable(SUBG, ANS)
#define is_failing_delay_element(SUBG, ANS)
#define mark_conditional_answer(ANS, SUBG, NEW_DL)
#define unmark_conditional_answer(ANS)
#define most_general_answer(ANS)   IsEscapeNode(ANS)

Typedefs

typedef delay_elementDE
typedef delay_listDL
typedef pos_neg_de_listPNDE
typedef AS_infoASI

Functions

xsbBool answer_is_junk (CPtr)
void abolish_wfs_space (void)
void simplify_neg_fails (VariantSF)
void do_delay_stuff (NODEptr, VariantSF, xsbBool)
unsigned long allocated_de_space (int *num_blocks)
unsigned long unused_de_space (void)
unsigned long allocated_dl_space (int *num_blocks)
unsigned long unused_dl_space (void)
void simplify_pos_unsupported (NODEptr)
void release_all_dls (ASI)

Variables

xsbBool neg_delay

Define Documentation

#define asi_dl_list X   )     (X) -> dl_list
 

#define asi_pdes X   )     (X) -> pdes
 

#define asi_subgoal X   )     (X) -> subgoal
 

#define create_as_info ANS,
SUBG   ) 
 

Value:

asi = (ASI) mem_alloc(sizeof(struct AS_info),TABLE_SPACE);      \
    Child(ANS) = (NODEptr) asi;                 \
    asi_pdes(asi) = NULL;                       \
    asi_subgoal(asi) = SUBG;                    \
    asi_dl_list(asi) = NULL

#define de_ans_subst X   )     (X) -> ans_subst
 

#define de_next X   )     (X) -> next
 

#define de_pnde X   )     (X) -> pnde
 

#define de_subgoal X   )     (X) -> subgoal
 

#define de_subs_fact_leaf X   )     (X) -> subs_fact_leaf
 

#define Delay X   )     (ASI) ((word) (TN_Child(X)) & ~UNCONDITIONAL_MARK)
 

#define delay_negatively SUBGOAL   ) 
 

Value:

{                                       \
  Cell new_delay_cons_cell;                                             \
                                                                        \
  new_delay_cons_cell = makelist(hreg);                                 \
  sreg = hreg+2;                                                        \
  follow(hreg++) = makecs(sreg);                                        \
  follow(hreg++) = (delayreg == NULL) ? makenil : (Cell) delayreg;      \
  new_heap_functor(sreg, delay_psc);                                    \
  cell(sreg) = makeaddr(SUBGOAL); sreg++;                               \
  cell(sreg) = makeaddr(NEG_DELAY); sreg++;                             \
  cell(sreg) = makeaddr(NEG_DELAY); sreg++; /* NOT STRINGS */           \
  hreg = sreg;                                                          \
  delayreg = (CPtr) new_delay_cons_cell;                                \
}

#define delay_positively SUBGOAL,
ANSWER,
MAKE_SUBSF   ) 
 

Value:

{                       \
  Cell new_delay_cons_cell;                                             \
                                                                        \
  new_delay_cons_cell = makelist(hreg);                                 \
  sreg = hreg + 2;                                                      \
  follow(hreg++) = makecs(sreg);                                        \
  follow(hreg++) = (delayreg == NULL) ? makenil : (Cell) delayreg;      \
  new_heap_functor(sreg, delay_psc);                                    \
  cell(sreg++) = makeaddr(SUBGOAL);                                     \
  cell(sreg++) = makeaddr(ANSWER);                                      \
  follow(sreg++) = MAKE_SUBSF;                                          \
  hreg = sreg;                                                          \
  delayreg = (CPtr) new_delay_cons_cell;                                \
}

#define dl_asl X   )     (X) -> asl
 

#define dl_de_list X   )     (X) -> de_list
 

#define dl_next X   )     (X) -> next
 

#define is_conditional_answer ANS   )     (Child(ANS) && !((word) (Child(ANS)) & UNCONDITIONAL_MARK))
 

#define is_failing_delay_element SUBG,
ANS   ) 
 

Value:

((ANS == NULL) ? (is_completed(SUBG) && has_answer_code(SUBG) &&        \
                      subgoal_unconditionally_succeeds(SUBG))           \
                   : (IsDeletedNode(ANS)))

#define is_unconditional_answer ANS   )     (!Child(ANS) || ((word) (Child(ANS)) & UNCONDITIONAL_MARK))
 

#define mark_conditional_answer ANS,
SUBG,
NEW_DL   ) 
 

Value:

if (Child(ANS) == NULL) {                                               \
    create_as_info(ANS, SUBG);                                          \
  }                                                                     \
  else {                                                                \
    asi = Delay(ANS);                                                   \
  }                                                                     \
  dl_next(NEW_DL) = asi_dl_list(asi);                                   \
  asi_dl_list(asi) = NEW_DL;                                            \
  dl_asl(NEW_DL) = ANS

#define most_general_answer ANS   )     IsEscapeNode(ANS)
 

#define NEG_DELAY   0
 

#define pnde_de X   )     (X) -> de
 

#define pnde_dl X   )     (X) -> dl
 

#define pnde_next X   )     (X) -> next
 

#define pnde_prev X   )     (X) -> prev
 

#define UNCONDITIONAL_MARK   0x3
 

#define unmark_conditional_answer ANS   ) 
 

Value:

/*-- NEEDS CHANGE --*/          \
    Child(ANS) = (NODEptr) ((word) (Child(ANS)) | UNCONDITIONAL_MARK)

#define was_simplifiable SUBG,
ANS   ) 
 

Value:

((ANS == NULL) ? (is_completed(SUBG) && subgoal_fails(SUBG))    \
                   : (is_unconditional_answer(ANS)))


Typedef Documentation

typedef struct AS_info * ASI
 

typedef struct delay_element* DE
 

typedef struct delay_list* DL
 

typedef struct pos_neg_de_list* PNDE
 


Function Documentation

void abolish_wfs_space void   ) 
 

unsigned long allocated_de_space int num_blocks  ) 
 

unsigned long allocated_dl_space int num_blocks  ) 
 

xsbBool answer_is_junk CPtr   ) 
 

void do_delay_stuff NODEptr  ,
VariantSF  ,
xsbBool 
 

void release_all_dls ASI   ) 
 

void simplify_neg_fails VariantSF   ) 
 

void simplify_pos_unsupported NODEptr   ) 
 

unsigned long unused_de_space void   ) 
 

unsigned long unused_dl_space void   ) 
 


Variable Documentation

xsbBool neg_delay
 


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