src/misc/espresso/espresso.h File Reference

#include "sparse.h"
#include "mincov.h"
#include "util_hack.h"
Include dependency graph for espresso.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  set_family
struct  cost_struct
struct  pair_struct
struct  symbolic_list_struct
struct  symbolic_label_struct
struct  symbolic_struct
struct  PLA_t
struct  pla_types_struct
struct  cube_struct
struct  cdata_struct

Defines

#define ptime()   util_cpu_time()
#define print_time(t)   util_print_time(t)
#define BPI   32
#define LOGBPI   5
#define WHICH_WORD(element)   (((element) >> LOGBPI) + 1)
#define WHICH_BIT(element)   ((element) & (BPI-1))
#define SET_SIZE(size)   ((size) <= BPI ? 2 : (WHICH_WORD((size)-1) + 1))
#define LOOP(set)   (set[0] & 0x03ff)
#define PUTLOOP(set, i)   (set[0] &= ~0x03ff, set[0] |= (i))
#define LOOPCOPY(set)   LOOP(set)
#define SIZE(set)   (set[0] >> 16)
#define PUTSIZE(set, size)   (set[0] &= 0xffff, set[0] |= ((size) << 16))
#define NELEM(set)   (BPI * LOOP(set))
#define LOOPINIT(size)   ((size <= BPI) ? 1 : WHICH_WORD((size)-1))
#define SET(set, flag)   (set[0] |= (flag))
#define RESET(set, flag)   (set[0] &= ~ (flag))
#define TESTP(set, flag)   (set[0] & (flag))
#define PRIME   0x8000
#define NONESSEN   0x4000
#define ACTIVE   0x2000
#define REDUND   0x1000
#define COVERED   0x0800
#define RELESSEN   0x0400
#define foreach_set(R, last, p)   for(p=R->data,last=p+R->count*R->wsize;p<last;p+=R->wsize)
#define foreach_remaining_set(R, last, pfirst, p)   for(p=pfirst+R->wsize,last=R->data+R->count*R->wsize;p<last;p+=R->wsize)
#define foreach_active_set(R, last, p)   foreach_set(R,last,p) if (TESTP(p, ACTIVE))
#define foreachi_set(R, i, p)   for(p=R->data,i=0;i<R->count;p+=R->wsize,i++)
#define foreachi_active_set(R, i, p)   foreachi_set(R,i,p) if (TESTP(p, ACTIVE))
#define foreach_set_element(p, i, val, base)
#define GETSET(family, index)   ((family)->data + (family)->wsize * (index))
#define set_new(size)   set_clear(ALLOC(unsigned int, SET_SIZE(size)), size)
#define set_full(size)   set_fill(ALLOC(unsigned int, SET_SIZE(size)), size)
#define set_save(r)   set_copy(ALLOC(unsigned int, SET_SIZE(NELEM(r))), r)
#define set_free(r)   FREE(r)
#define is_in_set(set, e)   (set[WHICH_WORD(e)] & (1 << WHICH_BIT(e)))
#define set_remove(set, e)   (set[WHICH_WORD(e)] &= ~ (1 << WHICH_BIT(e)))
#define set_insert(set, e)   (set[WHICH_WORD(e)] |= 1 << WHICH_BIT(e))
#define INLINEset_copy(r, a)   {register int i_=LOOPCOPY(a); do r[i_]=a[i_]; while (--i_>=0);}
#define INLINEset_clear(r, size)   {register int i_=LOOPINIT(size); *r=i_; do r[i_] = 0; while (--i_ > 0);}
#define INLINEset_fill(r, size)
#define INLINEset_and(r, a, b)
#define INLINEset_or(r, a, b)
#define INLINEset_diff(r, a, b)
#define INLINEset_ndiff(r, a, b, fullset)
#define INLINEset_xor(r, a, b)
#define INLINEset_xnor(r, a, b, fullset)
#define INLINEset_merge(r, a, b, mask)
#define INLINEsetp_implies(a, b, when_false)
#define INLINEsetp_disjoint(a, b, when_false)
#define INLINEsetp_equal(a, b, when_false)
#define count_ones(v)
#define bool   int
#define FALSE   0
#define TRUE   1
#define MAYBE   2
#define print_bool(x)   ((x) == 0 ? "FALSE" : ((x) == 1 ? "TRUE" : "MAYBE"))
#define pcube   pset
#define new_cube()   set_new(cube.size)
#define free_cube(r)   set_free(r)
#define pcover   pset_family
#define new_cover(i)   sf_new(i, cube.size)
#define free_cover(r)   sf_free(r)
#define free_cubelist(T)   FREE(T[0]); FREE(T);
#define equal(a, b)   (strcmp(a,b) == 0)
#define CUBELISTSIZE(T)   (((pcube *) T[1] - T) - 3)
#define IN
#define OUT
#define INOUT
#define F_type   1
#define D_type   2
#define R_type   4
#define PLEASURE_type   8
#define EQNTOTT_type   16
#define KISS_type   128
#define CONSTRAINTS_type   256
#define SYMBOLIC_CONSTRAINTS_type   512
#define FD_type   (F_type | D_type)
#define FR_type   (F_type | R_type)
#define DR_type   (D_type | R_type)
#define FDR_type   (F_type | D_type | R_type)
#define COMPL   0x0001
#define ESSEN   0x0002
#define EXPAND   0x0004
#define EXPAND1   0x0008
#define GASP   0x0010
#define IRRED   0x0020
#define REDUCE   0x0040
#define REDUCE1   0x0080
#define SPARSE   0x0100
#define TAUT   0x0200
#define EXACT   0x0400
#define MINCOV   0x0800
#define MINCOV1   0x1000
#define SHARP   0x2000
#define IRRED1   0x4000
#define VERSION   "UC Berkeley, Espresso Version #2.3, Release date 01/31/88"
#define TIME_COUNT   16
#define READ_TIME   0
#define COMPL_TIME   1
#define ONSET_TIME   2
#define ESSEN_TIME   3
#define EXPAND_TIME   4
#define IRRED_TIME   5
#define REDUCE_TIME   6
#define GEXPAND_TIME   7
#define GIRRED_TIME   8
#define GREDUCE_TIME   9
#define PRIMES_TIME   10
#define MINCOV_TIME   11
#define MV_REDUCE_TIME   12
#define RAISE_IN_TIME   13
#define VERIFY_TIME   14
#define WRITE_TIME   15
#define NUMINPUTS   cube.num_binary_vars
#define NUMOUTPUTS   cube.part_size[cube.num_vars - 1]
#define POSITIVE_PHASE(pos)   (is_in_set(PLA->phase, cube.first_part[cube.output]+pos) != 0)
#define INLABEL(var)   PLA->label[cube.first_part[var] + 1]
#define OUTLABEL(pos)   PLA->label[cube.first_part[cube.output] + pos]
#define GETINPUT(c, pos)   ((c[WHICH_WORD(2*pos)] >> WHICH_BIT(2*pos)) & 3)
#define GETOUTPUT(c, pos)   (is_in_set(c, cube.first_part[cube.output] + pos) != 0)
#define PUTINPUT(c, pos, value)
#define PUTOUTPUT(c, pos, value)
#define TWO   3
#define DASH   3
#define ONE   2
#define ZERO   1
#define EXEC(fct, name, S)   {long t=ptime();fct;if(trace)print_trace(S,name,ptime()-t);}
#define EXEC_S(fct, name, S)   {long t=ptime();fct;if(summary)print_trace(S,name,ptime()-t);}
#define EXECUTE(fct, i, S, cost)   {long t=ptime();fct;totals(t,i,S,&(cost));}
#define CUBE_TEMP   10
#define DISJOINT   0x55555555

Typedefs

typedef unsigned int * pset
typedef struct set_family set_family_t
typedef struct set_familypset_family
typedef struct cost_struct cost_t
typedef struct cost_structpcost
typedef struct pair_struct pair_t
typedef struct pair_structppair
typedef struct symbolic_list_struct symbolic_list_t
typedef struct
symbolic_label_struct 
symbolic_label_t
typedef struct symbolic_struct symbolic_t
typedef struct PLA_tpPLA

Functions

int binate_split_select ()
pcover cubeunlist ()
pcube * cofactor ()
pcube * cube1list ()
pcube * cube2list ()
pcube * cube3list ()
pcube * scofactor ()
void massive_count ()
pcover complement ()
pcover simplify ()
void simp_comp ()
int d1_rm_equal ()
int rm2_contain ()
int rm2_equal ()
int rm_contain ()
int rm_equal ()
int rm_rev_contain ()
psetsf_list ()
psetsf_sort ()
pset_family d1merge ()
pset_family dist_merge ()
pset_family sf_contain ()
pset_family sf_dupl ()
pset_family sf_ind_contain ()
pset_family sf_ind_unlist ()
pset_family sf_merge ()
pset_family sf_rev_contain ()
pset_family sf_union ()
pset_family sf_unlist ()
void cube_setup ()
void restore_cube_struct ()
void save_cube_struct ()
void setdown_cube ()
 PLA_labels ()
char * get_word ()
int label_index ()
int read_pla ()
int read_symbolic ()
pPLA new_PLA ()
void PLA_summary ()
void free_PLA ()
void parse_pla ()
void read_cube ()
void skip_line ()
 foreach_output_function ()
int cubelist_partition ()
int so_both_do_espresso ()
int so_both_do_exact ()
int so_both_save ()
int so_do_espresso ()
int so_do_exact ()
int so_save ()
pcover cof_output ()
pcover lex_sort ()
pcover mini_sort ()
pcover random_order ()
pcover size_sort ()
pcover sort_reduce ()
pcover uncof_output ()
pcover unravel ()
pcover unravel_range ()
void so_both_espresso ()
void so_espresso ()
char * fmt_cost ()
char * print_cost ()
char * strsav ()
void copy_cost ()
void cover_cost ()
void fatal ()
void print_trace ()
void size_stamp ()
void totals ()
char * fmt_cube ()
char * fmt_expanded_cube ()
char * pc1 ()
char * pc2 ()
char * pc3 ()
int makeup_labels ()
 kiss_output ()
 kiss_print_cube ()
 output_symbolic_constraints ()
void cprint ()
void debug1_print ()
void debug_print ()
void eqn_output ()
void fpr_header ()
void fprint_pla ()
void pls_group ()
void pls_label ()
void pls_output ()
void print_cube ()
void print_expanded_cube ()
void sf_debug_print ()
 find_equiv_outputs ()
int check_equiv ()
pcover espresso ()
bool essen_cube ()
pcover cb_consensus ()
pcover cb_consensus_dist0 ()
pcover essential ()
pcover minimize_exact ()
pcover minimize_exact_literals ()
bool feasibly_covered ()
int most_frequent ()
pcover all_primes ()
pcover expand ()
pcover find_all_primes ()
void elim_lowering ()
void essen_parts ()
void essen_raising ()
void expand1 ()
void mincov ()
void select_feasible ()
void setup_BB_CC ()
pcover expand_gasp ()
pcover irred_gasp ()
pcover last_gasp ()
pcover super_gasp ()
void expand1_gasp ()
int util_getopt ()
 find_dc_inputs ()
 find_inputs ()
 form_bitvector ()
 map_dcset ()
 map_output_symbolic ()
 map_symbolic ()
pcover map_symbolic_cover ()
 symbolic_hack_labels ()
bool cube_is_covered ()
bool taut_special_cases ()
bool tautology ()
pcover irredundant ()
void mark_irredundant ()
void irred_split_cover ()
sm_matrixirred_derive_table ()
pset minterms ()
void explode ()
void map ()
 output_phase_setup ()
pPLA set_phase ()
pcover opo ()
pcube find_phase ()
pset_family find_covers ()
pset_family form_cover_table ()
pset_family opo_leaf ()
pset_family opo_recur ()
void opoall ()
void phase_assignment ()
void repeated_phase_assignment ()
 generate_all_pairs ()
int ** find_pairing_cost ()
int find_best_cost ()
int greedy_best_cost ()
int minimize_pair ()
int pair_free ()
 pair_all ()
pcover delvar ()
pcover pairvar ()
ppair pair_best_cost ()
ppair pair_new ()
ppair pair_save ()
 print_pair ()
void find_optimal_pairing ()
void set_pair ()
void set_pair1 ()
pcover primes_consensus ()
bool sccc_special_cases ()
pcover reduce ()
pcube reduce_cube ()
pcube sccc ()
pcube sccc_cube ()
pcube sccc_merge ()
bool set_andp ()
bool set_orp ()
bool setp_disjoint ()
bool setp_empty ()
bool setp_equal ()
bool setp_full ()
bool setp_implies ()
char * pbv1 ()
char * ps1 ()
int * sf_count ()
int * sf_count_restricted ()
int bit_index ()
int set_dist ()
int set_ord ()
void set_adjcnt ()
pset set_and ()
pset set_clear ()
pset set_copy ()
pset set_diff ()
pset set_fill ()
pset set_merge ()
pset set_or ()
pset set_xor ()
pset sf_and ()
pset sf_or ()
pset_family sf_active ()
pset_family sf_addcol ()
pset_family sf_addset ()
pset_family sf_append ()
pset_family sf_bm_read ()
pset_family sf_compress ()
pset_family sf_copy ()
pset_family sf_copy_col ()
pset_family sf_delc ()
pset_family sf_delcol ()
pset_family sf_inactive ()
pset_family sf_join ()
pset_family sf_new ()
pset_family sf_permute ()
pset_family sf_read ()
pset_family sf_save ()
pset_family sf_transpose ()
void set_write ()
void sf_bm_print ()
void sf_cleanup ()
void sf_delset ()
void sf_free ()
void sf_print ()
void sf_write ()
bool ccommon ()
bool cdist0 ()
bool full_row ()
int ascend ()
int cactive ()
int cdist ()
int cdist01 ()
int cvolume ()
int d1_order ()
int d1_order_size ()
int desc1 ()
int descend ()
int lex_order ()
int lex_order1 ()
pset force_lower ()
void consensus ()
pcover cb1_dsharp ()
pcover cb_dsharp ()
pcover cb_recur_dsharp ()
pcover cb_recur_sharp ()
pcover cb_sharp ()
pcover cv_dsharp ()
pcover cv_intersect ()
pcover cv_sharp ()
pcover dsharp ()
pcover make_disjoint ()
pcover sharp ()
pset do_sm_minimum_cover ()
pcover make_sparse ()
pcover mv_reduce ()
 qsort ()
 qst ()
pcover find_all_minimal_covers_petrick ()
pcover map_cover_to_unate ()
pcover map_unate_to_cover ()
pset_family exact_minimum_cover ()
pset_family gen_primes ()
pset_family unate_compl ()
pset_family unate_complement ()
pset_family unate_intersect ()
 PLA_permute ()
bool PLA_verify ()
bool check_consistency ()
bool verify ()

Variables

int bit_count [256]
unsigned int debug
bool verbose_debug
char * total_name [TIME_COUNT]
long total_time [TIME_COUNT]
int total_calls [TIME_COUNT]
bool echo_comments
bool echo_unknown_commands
bool force_irredundant
bool skip_make_sparse
bool kiss
bool pos
bool print_solution
bool recompute_onset
bool remove_essential
bool single_expand
bool summary
bool trace
bool unwrap_onset
bool use_random_order
bool use_super_gasp
char * filename
bool debug_exact_minimization
struct pla_types_struct pla_types []
struct cube_struct cube temp_cube_save
struct cdata_struct cdata temp_cdata_save

Define Documentation

#define ACTIVE   0x2000

Definition at line 125 of file espresso.h.

#define bool   int

Definition at line 250 of file espresso.h.

#define BPI   32

Definition at line 59 of file espresso.h.

#define COMPL   0x0001

Definition at line 347 of file espresso.h.

#define COMPL_TIME   1

Definition at line 369 of file espresso.h.

#define CONSTRAINTS_type   256

Definition at line 339 of file espresso.h.

#define count_ones (  ) 
Value:
(bit_count[v & 255] + bit_count[(v >> 8) & 255]\
    + bit_count[(v >> 16) & 255] + bit_count[(v >> 24) & 255])

Definition at line 237 of file espresso.h.

#define COVERED   0x0800

Definition at line 127 of file espresso.h.

#define CUBE_TEMP   10

Definition at line 465 of file espresso.h.

#define CUBELISTSIZE (  )     (((pcube *) T[1] - T) - 3)

Definition at line 325 of file espresso.h.

#define D_type   2

Definition at line 334 of file espresso.h.

#define DASH   3

Definition at line 409 of file espresso.h.

#define DISJOINT   0x55555555

Definition at line 508 of file espresso.h.

#define DR_type   (D_type | R_type)

Definition at line 343 of file espresso.h.

#define EQNTOTT_type   16

Definition at line 337 of file espresso.h.

#define equal ( a,
 )     (strcmp(a,b) == 0)

Definition at line 322 of file espresso.h.

#define ESSEN   0x0002

Definition at line 348 of file espresso.h.

#define ESSEN_TIME   3

Definition at line 371 of file espresso.h.

#define EXACT   0x0400

Definition at line 357 of file espresso.h.

#define EXEC ( fct,
name,
 )     {long t=ptime();fct;if(trace)print_trace(S,name,ptime()-t);}

Definition at line 414 of file espresso.h.

#define EXEC_S ( fct,
name,
 )     {long t=ptime();fct;if(summary)print_trace(S,name,ptime()-t);}

Definition at line 416 of file espresso.h.

#define EXECUTE ( fct,
i,
S,
cost   )     {long t=ptime();fct;totals(t,i,S,&(cost));}

Definition at line 418 of file espresso.h.

#define EXPAND   0x0004

Definition at line 349 of file espresso.h.

#define EXPAND1   0x0008

Definition at line 350 of file espresso.h.

#define EXPAND_TIME   4

Definition at line 372 of file espresso.h.

#define F_type   1

Definition at line 333 of file espresso.h.

#define FALSE   0

Definition at line 251 of file espresso.h.

#define FD_type   (F_type | D_type)

Definition at line 341 of file espresso.h.

#define FDR_type   (F_type | D_type | R_type)

Definition at line 344 of file espresso.h.

#define foreach_active_set ( R,
last,
 )     foreach_set(R,last,p) if (TESTP(p, ACTIVE))

Definition at line 135 of file espresso.h.

#define foreach_remaining_set ( R,
last,
pfirst,
 )     for(p=pfirst+R->wsize,last=R->data+R->count*R->wsize;p<last;p+=R->wsize)

Definition at line 133 of file espresso.h.

#define foreach_set ( R,
last,
 )     for(p=R->data,last=p+R->count*R->wsize;p<last;p+=R->wsize)

Definition at line 131 of file espresso.h.

#define foreach_set_element ( p,
i,
val,
base   ) 
Value:
for(i = LOOP(p); i > 0; )                               \
        for(val = p[i], base = --i << LOGBPI; val != 0; base++, val >>= 1)  \
            if (val & 1)

Definition at line 151 of file espresso.h.

#define foreachi_active_set ( R,
i,
 )     foreachi_set(R,i,p) if (TESTP(p, ACTIVE))

Definition at line 141 of file espresso.h.

#define foreachi_set ( R,
i,
 )     for(p=R->data,i=0;i<R->count;p+=R->wsize,i++)

Definition at line 139 of file espresso.h.

#define FR_type   (F_type | R_type)

Definition at line 342 of file espresso.h.

#define free_cover (  )     sf_free(r)

Definition at line 262 of file espresso.h.

#define free_cube (  )     set_free(r)

Definition at line 259 of file espresso.h.

#define free_cubelist (  )     FREE(T[0]); FREE(T);

Definition at line 263 of file espresso.h.

#define GASP   0x0010

Definition at line 351 of file espresso.h.

#define GETINPUT ( c,
pos   )     ((c[WHICH_WORD(2*pos)] >> WHICH_BIT(2*pos)) & 3)

Definition at line 396 of file espresso.h.

#define GETOUTPUT ( c,
pos   )     (is_in_set(c, cube.first_part[cube.output] + pos) != 0)

Definition at line 398 of file espresso.h.

#define GETSET ( family,
index   )     ((family)->data + (family)->wsize * (index))

Definition at line 157 of file espresso.h.

#define GEXPAND_TIME   7

Definition at line 375 of file espresso.h.

#define GIRRED_TIME   8

Definition at line 376 of file espresso.h.

#define GREDUCE_TIME   9

Definition at line 377 of file espresso.h.

#define IN

Definition at line 328 of file espresso.h.

#define INLABEL ( var   )     PLA->label[cube.first_part[var] + 1]

Definition at line 393 of file espresso.h.

#define INLINEset_and ( r,
a,
 ) 
Value:
{register int i_=LOOP(a); PUTLOOP(r,i_);\
    do r[i_] = a[i_] & b[i_]; while (--i_>0);}

Definition at line 198 of file espresso.h.

#define INLINEset_clear ( r,
size   )     {register int i_=LOOPINIT(size); *r=i_; do r[i_] = 0; while (--i_ > 0);}

Definition at line 193 of file espresso.h.

#define INLINEset_copy ( r,
 )     {register int i_=LOOPCOPY(a); do r[i_]=a[i_]; while (--i_>=0);}

Definition at line 191 of file espresso.h.

#define INLINEset_diff ( r,
a,
 ) 
Value:
{register int i_=LOOP(a); PUTLOOP(r,i_);\
    do r[i_] = a[i_] & ~ b[i_]; while (--i_>0);}

Definition at line 204 of file espresso.h.

#define INLINEset_fill ( r,
size   ) 
Value:
{register int i_=LOOPINIT(size); *r=i_; \
    r[i_]=((unsigned int)(~0))>>(i_*BPI-size); while(--i_>0) r[i_]=~0;}

Definition at line 195 of file espresso.h.

#define INLINEset_merge ( r,
a,
b,
mask   ) 
Value:
{register int i_=LOOP(a); PUTLOOP(r,i_);\
    do r[i_] = (a[i_]&mask[i_]) | (b[i_]&~mask[i_]); while (--i_>0);}

Definition at line 221 of file espresso.h.

#define INLINEset_ndiff ( r,
a,
b,
fullset   ) 
Value:
{register int i_=LOOP(a); PUTLOOP(r,i_);\
    do r[i_] = fullset[i_] & (a[i_] | ~ b[i_]); while (--i_>0);}

Definition at line 207 of file espresso.h.

#define INLINEset_or ( r,
a,
 ) 
Value:
{register int i_=LOOP(a); PUTLOOP(r,i_);\
    do r[i_] = a[i_] | b[i_]; while (--i_>0);}

Definition at line 201 of file espresso.h.

#define INLINEset_xnor ( r,
a,
b,
fullset   ) 
Value:
{register int i_=LOOP(a); PUTLOOP(r,i_);\
    do r[i_] = fullset[i_] & ~ (a[i_] ^ b[i_]); while (--i_>0);}

Definition at line 217 of file espresso.h.

#define INLINEset_xor ( r,
a,
 ) 
Value:
{register int i_=LOOP(a); PUTLOOP(r,i_);\
    do r[i_] = a[i_] ^ b[i_]; while (--i_>0);}

Definition at line 214 of file espresso.h.

#define INLINEsetp_disjoint ( a,
b,
when_false   ) 
Value:
{register int i_=LOOP(a); do if (a[i_]&b[i_]) break; while (--i_>0);\
    if (i_ != 0) when_false;}

Definition at line 227 of file espresso.h.

#define INLINEsetp_equal ( a,
b,
when_false   ) 
Value:
{register int i_=LOOP(a); do if (a[i_]!=b[i_]) break; while (--i_>0);\
    if (i_ != 0) when_false;}

Definition at line 230 of file espresso.h.

#define INLINEsetp_implies ( a,
b,
when_false   ) 
Value:
{register int i_=LOOP(a); do if (a[i_]&~b[i_]) break; while (--i_>0);\
    if (i_ != 0) when_false;}

Definition at line 224 of file espresso.h.

#define INOUT

Definition at line 330 of file espresso.h.

#define IRRED   0x0020

Definition at line 352 of file espresso.h.

#define IRRED1   0x4000

Definition at line 361 of file espresso.h.

#define IRRED_TIME   5

Definition at line 373 of file espresso.h.

#define is_in_set ( set,
 )     (set[WHICH_WORD(e)] & (1 << WHICH_BIT(e)))

Definition at line 166 of file espresso.h.

#define KISS_type   128

Definition at line 338 of file espresso.h.

#define LOGBPI   5

Definition at line 63 of file espresso.h.

#define LOOP ( set   )     (set[0] & 0x03ff)

Definition at line 100 of file espresso.h.

#define LOOPCOPY ( set   )     LOOP(set)

Definition at line 103 of file espresso.h.

#define LOOPINIT ( size   )     ((size <= BPI) ? 1 : WHICH_WORD((size)-1))

Definition at line 113 of file espresso.h.

#define MAYBE   2

Definition at line 253 of file espresso.h.

#define MINCOV   0x0800

Definition at line 358 of file espresso.h.

#define MINCOV1   0x1000

Definition at line 359 of file espresso.h.

#define MINCOV_TIME   11

Definition at line 379 of file espresso.h.

#define MV_REDUCE_TIME   12

Definition at line 380 of file espresso.h.

#define NELEM ( set   )     (BPI * LOOP(set))

Definition at line 112 of file espresso.h.

#define new_cover (  )     sf_new(i, cube.size)

Definition at line 261 of file espresso.h.

 
#define new_cube (  )     set_new(cube.size)

Definition at line 258 of file espresso.h.

#define NONESSEN   0x4000

Definition at line 124 of file espresso.h.

#define NUMINPUTS   cube.num_binary_vars

Definition at line 387 of file espresso.h.

#define NUMOUTPUTS   cube.part_size[cube.num_vars - 1]

Definition at line 388 of file espresso.h.

#define ONE   2

Definition at line 410 of file espresso.h.

#define ONSET_TIME   2

Definition at line 370 of file espresso.h.

#define OUT

Definition at line 329 of file espresso.h.

#define OUTLABEL ( pos   )     PLA->label[cube.first_part[cube.output] + pos]

Definition at line 394 of file espresso.h.

#define pcover   pset_family

Definition at line 260 of file espresso.h.

#define pcube   pset

Definition at line 257 of file espresso.h.

#define PLEASURE_type   8

Definition at line 336 of file espresso.h.

#define POSITIVE_PHASE ( pos   )     (is_in_set(PLA->phase, cube.first_part[cube.output]+pos) != 0)

Definition at line 390 of file espresso.h.

#define PRIME   0x8000

Definition at line 123 of file espresso.h.

#define PRIMES_TIME   10

Definition at line 378 of file espresso.h.

#define print_bool (  )     ((x) == 0 ? "FALSE" : ((x) == 1 ? "TRUE" : "MAYBE"))

Definition at line 254 of file espresso.h.

#define print_time (  )     util_print_time(t)

Definition at line 22 of file espresso.h.

 
#define ptime (  )     util_cpu_time()

Definition at line 21 of file espresso.h.

#define PUTINPUT ( c,
pos,
value   ) 
Value:
c[WHICH_WORD(2*pos)] = (c[WHICH_WORD(2*pos)] & ~(3 << WHICH_BIT(2*pos)))\
                | (value << WHICH_BIT(2*pos))

Definition at line 401 of file espresso.h.

#define PUTLOOP ( set,
 )     (set[0] &= ~0x03ff, set[0] |= (i))

Definition at line 101 of file espresso.h.

#define PUTOUTPUT ( c,
pos,
value   ) 
Value:
c[WHICH_WORD(pos)] = (c[WHICH_WORD(pos)] & ~(1 << WHICH_BIT(pos)))\
                | (value << WHICH_BIT(pos))

Definition at line 404 of file espresso.h.

#define PUTSIZE ( set,
size   )     (set[0] &= 0xffff, set[0] |= ((size) << 16))

Definition at line 105 of file espresso.h.

#define R_type   4

Definition at line 335 of file espresso.h.

#define RAISE_IN_TIME   13

Definition at line 381 of file espresso.h.

#define READ_TIME   0

Definition at line 368 of file espresso.h.

#define REDUCE   0x0040

Definition at line 353 of file espresso.h.

#define REDUCE1   0x0080

Definition at line 354 of file espresso.h.

#define REDUCE_TIME   6

Definition at line 374 of file espresso.h.

#define REDUND   0x1000

Definition at line 126 of file espresso.h.

#define RELESSEN   0x0400

Definition at line 128 of file espresso.h.

#define RESET ( set,
flag   )     (set[0] &= ~ (flag))

Definition at line 119 of file espresso.h.

#define SET ( set,
flag   )     (set[0] |= (flag))

Definition at line 118 of file espresso.h.

#define set_free (  )     FREE(r)

Definition at line 163 of file espresso.h.

#define set_full ( size   )     set_fill(ALLOC(unsigned int, SET_SIZE(size)), size)

Definition at line 161 of file espresso.h.

#define set_insert ( set,
 )     (set[WHICH_WORD(e)] |= 1 << WHICH_BIT(e))

Definition at line 168 of file espresso.h.

#define set_new ( size   )     set_clear(ALLOC(unsigned int, SET_SIZE(size)), size)

Definition at line 160 of file espresso.h.

#define set_remove ( set,
 )     (set[WHICH_WORD(e)] &= ~ (1 << WHICH_BIT(e)))

Definition at line 167 of file espresso.h.

#define set_save (  )     set_copy(ALLOC(unsigned int, SET_SIZE(NELEM(r))), r)

Definition at line 162 of file espresso.h.

#define SET_SIZE ( size   )     ((size) <= BPI ? 2 : (WHICH_WORD((size)-1) + 1))

Definition at line 88 of file espresso.h.

#define SHARP   0x2000

Definition at line 360 of file espresso.h.

#define SIZE ( set   )     (set[0] >> 16)

Definition at line 104 of file espresso.h.

#define SPARSE   0x0100

Definition at line 355 of file espresso.h.

#define SYMBOLIC_CONSTRAINTS_type   512

Definition at line 340 of file espresso.h.

#define TAUT   0x0200

Definition at line 356 of file espresso.h.

#define TESTP ( set,
flag   )     (set[0] & (flag))

Definition at line 120 of file espresso.h.

#define TIME_COUNT   16

Definition at line 367 of file espresso.h.

#define TRUE   1

Definition at line 252 of file espresso.h.

#define TWO   3

Definition at line 408 of file espresso.h.

#define VERIFY_TIME   14

Definition at line 382 of file espresso.h.

#define VERSION   "UC Berkeley, Espresso Version #2.3, Release date 01/31/88"

Definition at line 363 of file espresso.h.

#define WHICH_BIT ( element   )     ((element) & (BPI-1))

Definition at line 84 of file espresso.h.

#define WHICH_WORD ( element   )     (((element) >> LOGBPI) + 1)

Definition at line 83 of file espresso.h.

#define WRITE_TIME   15

Definition at line 383 of file espresso.h.

#define ZERO   1

Definition at line 411 of file espresso.h.


Typedef Documentation

typedef struct cost_struct cost_t
typedef struct pair_struct pair_t
typedef struct cost_struct * pcost
typedef struct pair_struct * ppair
typedef struct PLA_t * pPLA
typedef unsigned int* pset

Definition at line 69 of file espresso.h.

typedef struct set_family * pset_family
typedef struct set_family set_family_t
typedef struct symbolic_struct symbolic_t

Function Documentation

pcover all_primes (  ) 
int ascend (  ) 
int binate_split_select (  ) 
int bit_index (  ) 
int cactive (  ) 
pcover cb1_dsharp (  ) 
pcover cb_consensus (  ) 
pcover cb_consensus_dist0 (  ) 
pcover cb_dsharp (  ) 
pcover cb_recur_dsharp (  ) 
pcover cb_recur_sharp (  ) 
pcover cb_sharp (  ) 
bool ccommon (  ) 
int cdist (  ) 
bool cdist0 (  ) 
int cdist01 (  ) 
bool check_consistency (  ) 
int check_equiv (  ) 
pcover cof_output (  ) 
pcube* cofactor (  ) 
pcover complement (  ) 
void consensus (  ) 
void copy_cost (  ) 
void cover_cost (  ) 
void cprint (  ) 
pcube* cube1list (  ) 
pcube* cube2list (  ) 
pcube* cube3list (  ) 
bool cube_is_covered (  ) 
void cube_setup (  ) 

Definition at line 24 of file cubestr.c.

00025 {
00026     register int i, var;
00027     register pcube p;
00028 
00029     if (cube.num_binary_vars < 0 || cube.num_vars < cube.num_binary_vars)
00030         fatal("cube size is silly, error in .i/.o or .mv");
00031 
00032     cube.num_mv_vars = cube.num_vars - cube.num_binary_vars;
00033     cube.output = cube.num_mv_vars > 0 ? cube.num_vars - 1 : -1;
00034 
00035     cube.size = 0;
00036     cube.first_part = ALLOC(int, cube.num_vars);
00037     cube.last_part = ALLOC(int, cube.num_vars);
00038     cube.first_word = ALLOC(int, cube.num_vars);
00039     cube.last_word = ALLOC(int, cube.num_vars);
00040     for(var = 0; var < cube.num_vars; var++) {
00041         if (var < cube.num_binary_vars)
00042             cube.part_size[var] = 2;
00043         cube.first_part[var] = cube.size;
00044         cube.first_word[var] = WHICH_WORD(cube.size);
00045         cube.size += ABS(cube.part_size[var]);
00046         cube.last_part[var] = cube.size - 1;
00047         cube.last_word[var] = WHICH_WORD(cube.size - 1);
00048     }
00049 
00050     cube.var_mask = ALLOC(pset, cube.num_vars);
00051     cube.sparse = ALLOC(int, cube.num_vars);
00052     cube.binary_mask = new_cube();
00053     cube.mv_mask = new_cube();
00054     for(var = 0; var < cube.num_vars; var++) {
00055         p = cube.var_mask[var] = new_cube();
00056         for(i = cube.first_part[var]; i <= cube.last_part[var]; i++)
00057             set_insert(p, i);
00058         if (var < cube.num_binary_vars) {
00059             INLINEset_or(cube.binary_mask, cube.binary_mask, p);
00060             cube.sparse[var] = 0;
00061         } else {
00062             INLINEset_or(cube.mv_mask, cube.mv_mask, p);
00063             cube.sparse[var] = 1;
00064         }
00065     }
00066     if (cube.num_binary_vars == 0)
00067         cube.inword = -1;
00068     else {
00069         cube.inword = cube.last_word[cube.num_binary_vars - 1];
00070         cube.inmask = cube.binary_mask[cube.inword] & DISJOINT;
00071     }
00072 
00073     cube.temp = ALLOC(pset, CUBE_TEMP);
00074     for(i = 0; i < CUBE_TEMP; i++)
00075         cube.temp[i] = new_cube();
00076     cube.fullset = set_fill(new_cube(), cube.size);
00077     cube.emptyset = new_cube();
00078 
00079     cdata.part_zeros = ALLOC(int, cube.size);
00080     cdata.var_zeros = ALLOC(int, cube.num_vars);
00081     cdata.parts_active = ALLOC(int, cube.num_vars);
00082     cdata.is_unate = ALLOC(int, cube.num_vars);
00083 }

int cubelist_partition (  ) 
pcover cubeunlist (  ) 
pcover cv_dsharp (  ) 
pcover cv_intersect (  ) 
pcover cv_sharp (  ) 
int cvolume (  ) 
int d1_order (  ) 
int d1_order_size (  ) 
int d1_rm_equal (  ) 
pset_family d1merge (  ) 
void debug1_print (  ) 
void debug_print (  ) 
pcover delvar (  ) 
int desc1 (  ) 
int descend (  ) 
pset_family dist_merge (  ) 
pset do_sm_minimum_cover (  ) 
pcover dsharp (  ) 
void elim_lowering (  ) 
void eqn_output (  ) 
pcover espresso (  ) 
bool essen_cube (  ) 
void essen_parts (  ) 
void essen_raising (  ) 
pcover essential (  ) 
pset_family exact_minimum_cover (  ) 
pcover expand (  ) 
void expand1 (  ) 
void expand1_gasp (  ) 
pcover expand_gasp (  ) 
void explode (  ) 
void fatal (  ) 
bool feasibly_covered (  ) 
pcover find_all_minimal_covers_petrick (  ) 
pcover find_all_primes (  ) 
int find_best_cost (  ) 
pset_family find_covers (  ) 
find_dc_inputs (  ) 
find_equiv_outputs (  ) 
find_inputs (  ) 
void find_optimal_pairing (  ) 
int** find_pairing_cost (  ) 
pcube find_phase (  ) 
char* fmt_cost (  ) 
char* fmt_cube (  ) 
char* fmt_expanded_cube (  ) 
pset force_lower (  ) 
foreach_output_function (  ) 
form_bitvector (  ) 
pset_family form_cover_table (  ) 
void fpr_header (  ) 
void fprint_pla (  ) 
void free_PLA (  ) 
bool full_row (  ) 
pset_family gen_primes (  ) 
generate_all_pairs (  ) 
char* get_word (  ) 
int greedy_best_cost (  ) 
sm_matrix* irred_derive_table (  ) 
pcover irred_gasp (  ) 
void irred_split_cover (  ) 
pcover irredundant (  ) 
kiss_output (  ) 
kiss_print_cube (  ) 
int label_index (  ) 
pcover last_gasp (  ) 
int lex_order (  ) 
int lex_order1 (  ) 
pcover lex_sort (  ) 
pcover make_disjoint (  ) 
pcover make_sparse (  ) 
int makeup_labels (  ) 
void map (  ) 
pcover map_cover_to_unate (  ) 
map_dcset (  ) 
map_output_symbolic (  ) 
map_symbolic (  ) 
pcover map_symbolic_cover (  ) 
pcover map_unate_to_cover (  ) 
void mark_irredundant (  ) 
void massive_count (  ) 
void mincov (  ) 
pcover mini_sort (  ) 
pcover minimize_exact (  ) 
pcover minimize_exact_literals (  ) 
int minimize_pair (  ) 
pset minterms (  ) 
int most_frequent (  ) 
pcover mv_reduce (  ) 
pPLA new_PLA (  ) 

Definition at line 644 of file cvrin.c.

00645 {
00646     pPLA PLA;
00647 
00648     PLA = ALLOC(PLA_t, 1);
00649     PLA->F = PLA->D = PLA->R = (pcover) NULL;
00650     PLA->phase = (pcube) NULL;
00651     PLA->pair = (ppair) NULL;
00652     PLA->label = (char **) NULL;
00653     PLA->filename = (char *) NULL;
00654     PLA->pla_type = 0;
00655     PLA->symbolic = NIL(symbolic_t);
00656     PLA->symbolic_output = NIL(symbolic_t);
00657     return PLA;
00658 }

pcover opo (  ) 
pset_family opo_leaf (  ) 
pset_family opo_recur (  ) 
void opoall (  ) 
output_phase_setup (  ) 
output_symbolic_constraints (  ) 
pair_all (  ) 
ppair pair_best_cost (  ) 
int pair_free (  ) 
ppair pair_new (  ) 
ppair pair_save (  ) 
pcover pairvar (  ) 
void parse_pla (  ) 
char* pbv1 (  ) 
char* pc1 (  ) 
char* pc2 (  ) 
char* pc3 (  ) 
void phase_assignment (  ) 
PLA_labels (  ) 
PLA_permute (  ) 
void PLA_summary (  ) 
bool PLA_verify (  ) 
void pls_group (  ) 
void pls_label (  ) 
void pls_output (  ) 
pcover primes_consensus (  ) 
char* print_cost (  ) 
void print_cube (  ) 
void print_expanded_cube (  ) 
print_pair (  ) 
void print_trace (  ) 
char* ps1 (  ) 
qsort (  ) 
qst (  ) 
pcover random_order (  ) 
void read_cube (  ) 
int read_pla (  ) 
int read_symbolic (  ) 
pcover reduce (  ) 
pcube reduce_cube (  ) 
void repeated_phase_assignment (  ) 
void restore_cube_struct (  ) 

Definition at line 148 of file cubestr.c.

00149 {
00150     cube = temp_cube_save;              /* structure copy ! */
00151     cdata = temp_cdata_save;            /*      ""          */
00152 }

int rm2_contain (  ) 
int rm2_equal (  ) 
int rm_contain (  ) 
int rm_equal (  ) 
int rm_rev_contain (  ) 
void save_cube_struct (  ) 

Definition at line 131 of file cubestr.c.

00132 {
00133     temp_cube_save = cube;              /* structure copy ! */
00134     temp_cdata_save = cdata;            /*      ""          */
00135 
00136     cube.first_part = cube.last_part = (int *) NULL;
00137     cube.first_word = cube.last_word = (int *) NULL;
00138     cube.part_size = (int *) NULL;
00139     cube.binary_mask = cube.mv_mask = (pcube) NULL;
00140     cube.fullset = cube.emptyset = (pcube) NULL;
00141     cube.var_mask = cube.temp = (pcube *) NULL;
00142 
00143     cdata.part_zeros = cdata.var_zeros = cdata.parts_active = (int *) NULL;
00144     cdata.is_unate = (bool *) NULL;
00145 }

pcube sccc (  ) 
pcube sccc_cube (  ) 
pcube sccc_merge (  ) 
bool sccc_special_cases (  ) 
pcube* scofactor (  ) 
void select_feasible (  ) 
void set_adjcnt (  ) 
pset set_and (  ) 
bool set_andp (  ) 
pset set_clear (  ) 
pset set_copy (  ) 
pset set_diff (  ) 
int set_dist (  ) 
pset set_fill (  ) 
pset set_merge (  ) 
pset set_or (  ) 
int set_ord (  ) 
bool set_orp (  ) 
void set_pair (  ) 
void set_pair1 (  ) 
pPLA set_phase (  ) 
void set_write (  ) 
pset set_xor (  ) 
void setdown_cube (  ) 

Definition at line 92 of file cubestr.c.

00093 {
00094     register int i, var;
00095 
00096     FREE(cube.first_part);
00097     FREE(cube.last_part);
00098     FREE(cube.first_word);
00099     FREE(cube.last_word);
00100     FREE(cube.sparse);
00101 
00102     free_cube(cube.binary_mask);
00103     free_cube(cube.mv_mask);
00104     free_cube(cube.fullset);
00105     free_cube(cube.emptyset);
00106     for(var = 0; var < cube.num_vars; var++)
00107         free_cube(cube.var_mask[var]);
00108     FREE(cube.var_mask);
00109 
00110     for(i = 0; i < CUBE_TEMP; i++)
00111         free_cube(cube.temp[i]);
00112     FREE(cube.temp);
00113 
00114     FREE(cdata.part_zeros);
00115     FREE(cdata.var_zeros);
00116     FREE(cdata.parts_active);
00117     FREE(cdata.is_unate);
00118 
00119     cube.first_part = cube.last_part = (int *) NULL;
00120     cube.first_word = cube.last_word = (int *) NULL;
00121     cube.sparse = (int *) NULL;
00122     cube.binary_mask = cube.mv_mask = (pcube) NULL;
00123     cube.fullset = cube.emptyset = (pcube) NULL;
00124     cube.var_mask = cube.temp = (pcube *) NULL;
00125 
00126     cdata.part_zeros = cdata.var_zeros = cdata.parts_active = (int *) NULL;
00127     cdata.is_unate = (bool *) NULL;
00128 }

bool setp_disjoint (  ) 
bool setp_empty (  ) 
bool setp_equal (  ) 
bool setp_full (  ) 
bool setp_implies (  ) 
void setup_BB_CC (  ) 
pset_family sf_active (  ) 
pset_family sf_addcol (  ) 
pset_family sf_addset (  ) 
pset sf_and (  ) 
pset_family sf_append (  ) 
void sf_bm_print (  ) 
pset_family sf_bm_read (  ) 
void sf_cleanup (  ) 

Definition at line 371 of file set.c.

00372 {
00373     register pset_family p, pnext;
00374     for(p = set_family_garbage; p != (pset_family) NULL; p = pnext) {
00375         pnext = p->next;
00376         FREE(p);
00377     }
00378     set_family_garbage = (pset_family) NULL;
00379 }

pset_family sf_compress (  ) 
pset_family sf_contain (  ) 
pset_family sf_copy (  ) 
pset_family sf_copy_col (  ) 
int* sf_count (  ) 
int* sf_count_restricted (  ) 
void sf_debug_print (  ) 
pset_family sf_delc (  ) 
pset_family sf_delcol (  ) 
void sf_delset (  ) 
pset_family sf_dupl (  ) 
void sf_free (  ) 
pset_family sf_inactive (  ) 
pset_family sf_ind_contain (  ) 
pset_family sf_ind_unlist (  ) 
pset_family sf_join (  ) 
pset* sf_list (  ) 
pset_family sf_merge (  ) 
pset_family sf_new (  ) 
pset sf_or (  ) 
pset_family sf_permute (  ) 
void sf_print (  ) 
pset_family sf_read (  ) 
pset_family sf_rev_contain (  ) 
pset_family sf_save (  ) 
pset* sf_sort (  ) 
pset_family sf_transpose (  ) 
pset_family sf_union (  ) 
pset_family sf_unlist (  ) 
void sf_write (  ) 
pcover sharp (  ) 
void simp_comp (  ) 
pcover simplify (  ) 
pcover size_sort (  ) 
void size_stamp (  ) 
void skip_line (  ) 
int so_both_do_espresso (  ) 
int so_both_do_exact (  ) 
void so_both_espresso (  ) 
int so_both_save (  ) 
int so_do_espresso (  ) 
int so_do_exact (  ) 
void so_espresso (  ) 
int so_save (  ) 
pcover sort_reduce (  ) 
char* strsav (  ) 
pcover super_gasp (  ) 
symbolic_hack_labels (  ) 
bool taut_special_cases (  ) 
bool tautology (  ) 
void totals (  ) 
pset_family unate_compl (  ) 
pset_family unate_complement (  ) 
pset_family unate_intersect (  ) 
pcover uncof_output (  ) 
pcover unravel (  ) 
pcover unravel_range (  ) 
int util_getopt (  ) 
bool verify (  ) 

Variable Documentation

int bit_count[256]

Definition at line 67 of file globals.c.

unsigned int debug

Definition at line 16 of file globals.c.

Definition at line 22 of file globals.c.

Definition at line 23 of file globals.c.

char* filename

Definition at line 37 of file globals.c.

Definition at line 24 of file globals.c.

Definition at line 26 of file globals.c.

Definition at line 39 of file globals.c.

Definition at line 27 of file globals.c.

Definition at line 28 of file globals.c.

Definition at line 29 of file globals.c.

Definition at line 30 of file globals.c.

Definition at line 31 of file globals.c.

Definition at line 25 of file globals.c.

Definition at line 32 of file globals.c.

Definition at line 65 of file globals.c.

Definition at line 64 of file globals.c.

int total_calls[TIME_COUNT]

Definition at line 20 of file globals.c.

char* total_name[TIME_COUNT]

Definition at line 18 of file globals.c.

long total_time[TIME_COUNT]

Definition at line 19 of file globals.c.

Definition at line 33 of file globals.c.

Definition at line 34 of file globals.c.

Definition at line 35 of file globals.c.

Definition at line 36 of file globals.c.

Definition at line 17 of file globals.c.


Generated on Tue Jan 5 12:19:10 2010 for abc70930 by  doxygen 1.6.1