/* proto.h made 
Sun Aug 29 10:51:31 CDT 2004
*/

void satbox_insert_unit_clause();
int insert_binary_clause();
int insert_unit_cl_satbox();
int lit_weight_new_satbox();
int lit_weight_satbox();
int stop1();
int search();
int lookahead();
int second_weight();
void set_lit_weight_new_satbox();
void set_lit_weight_satbox();
void set_var_weight_satbox();
int var5_collect_parents();
int var_order_satbox();
int var_weight_satbox();
void weight_add1_satbox();

/* main.c */

void pure_literal_check();
void p_banner();
void print_menu();
FILE *open_fname_out();
void save_untouched();
void append_cmd_line(); 
void print_command();
FILE *command_line_check();
int saton(); 
int build(); 
void p_input_stats();
void p_paras();
int p_stats();
int check_stop();
void bug(); 
int handle_guide_path();
void guide_path_add_satbox();
void print_guide_path();
void output_guide_path(); 
void output_skipped_guide_path();
int read_guide_path(FILE *f, int *keys);
void print_read_guide_path();
void adjust_record();
void init_database();
int saton_search();
int select_next_literal();

/* sato.c */

void var5_insert_lemma();
void satbox_init_flags();
struct nlink *get_nlink();
void satbox_init_input();
int var5_prev_key();
void var5_record_conflict();
int grow_propagate();
int grow_propagate();
int double_check_nclause();
int handle_unit_clauses();
int var5_fail_end(); 
void print_var5_clause();

int binsat_scc1();
int binary_scc(); 
void satbox_skip_guide_path();

/* trie.c */

struct trie *get_trie();
struct trie *merge_tries();
struct trie *trie_create_one_path();
struct trie *trie_insert_clause2();
int trie_subsume_clause();
int insert_clause_to_trie();
void trie_init();
void print_trie();
void print_clauses_in_trie();

/* util.c */

void print_model();
void print_input_clause();
void print_unit_clause();
int insert_clause();
int read_one_clause();
int input_clauses();
int read_int_line(); 
int read_int();
int rename_var();
int skip_chars_until(); 
void reverse(); 
int str_int(); 
void str_cat();
void str_copy();
void clock_init();
long clock_val();
void clock_reset();
char *get_time();
long run_time();
void send_sato_message();
void print_times();
long good_random();
#ifndef SATBOX_LIBRARY_ONLY
void satbox_fatal_error();
#else
void satbox_fatal_error();
#endif
int insert_cl_1();
int insert_cl_2();
int insert_cl_3();
int insert_cl_4();
int insert_cl_5();
int insert_cl_6();

/* main.h */

FILE *command_line_check();
FILE *open_fname_out();

void satbox_init_flags();
int satbox_flag();
void satbox_set_flag();
void satbox_init_input();
int satbox_init_search();
void satbox_restart_search();
int satbox_check_model();
int satbox_strategy();
int satbox_assert_aux();
int satbox_var_value();
void satbox_set_var_value();
int satbox_delete_num();
int satbox_lemma_num();
int satbox_branch_open();
int satbox_branch_jump();
long satbox_branch_fail();
int satbox_memory_count();
int satbox_collect_selected();

/* select.h */

int min_weight_var();
int *shortest_clause();
int collect_best_keys_9();
int satbox_strategy();
int sato5_strategy2();
int sato5_strategy3();
int sato5_strategy4();
int sato5_strategy5();
int sato5_strategy6();
int sato5_strategy7();
int basic_strategy_satbox0();
int binary_propagate();
int basic_strategy_satbox1();
int collect_best_keys();

/* tape.h */

void print_lit();
void clean_body_tapes();
void delete_clauses_on_tape();
void tape_init();
int *get_tape();
int *get_body_tape();
int *get_head_tape();
int *clause_space();
void print_clause();
void print_clauses_on_tape();
void reset_all_clauses_stamps();
int satbox_check_model();
void satbox_insert_clause();
int *insert_lemma_to_tape();

/* vstack.h */

int satbox_collect_selected();
int vstack_backup();

/* weight.h */

void add_lit_weight_satbox();
void add_lit_weight_new_satbox();
void mergesorted();
void weight_update7_aux();
void mergesort_var_order();
int basic_strategy_satbox();
int weight_strategy_satbox();
void record_keeping();
int collect_best_keys();
void print_weight();

/* new functions */
void BacktrackNTimes        (); 

// The following functions used by satbox informally

int stop0();
int stop1();
void unset_dpllt_value_satbox (int identifier); 
int var_order_satbox ();
int var_weight_satbox ();
void set_var_weight_satbox ();
void add_var_weight_satbox ();
int lit_weight_satbox ();
void set_lit_weight_satbox ();
void add_lit_weight_satbox ();

// These functions collect guide path from satbox.
void guide_path_add_satbox ();
void satbox_set_var_value();
int satbox_collect_selected();

// return the value of literal in a given model (for debugging)
int model_value_satbox ( int literal );
void sblit_add_watched_satbox (int sblit);
