#include "ioutil.h"

This page has information from files ioutil.h and ioutil.c.

Contents


Public Routines in File ioutil.c

Index

bad_constants_in_clausef_clauseread_clauseterm_writer
check_constants_in_clistfwrite_clauseread_clause_listzap_formula_list
clause_readerfwrite_clause_listread_formulazap_term_list
clause_writerfwrite_formularead_formula_list
end_of_commands_termfwrite_formula_listread_term_list
end_of_list_termfwrite_term_listterm_reader

Details


BOOL bad_constants_in_clause(Clause c);
Given a clause, check if it contains any constants that satisfy variable_name(). If so, print a message for each and return TRUE.
void check_constants_in_clist(Clist l);
Given a list of clauses, check if it contains any constants that satisfy variable_name(). If so, print messages and die by calling fatal_error().
Clause clause_reader(BOOL fast);
If your program has optional fast parsing/writing, you can use this routine to save a few lines of code. The flag "fast" says whether or not to use fast parse form. A clause is read from stdin (NULL if there are none). Errors are fatal.
void clause_writer(Clause c, BOOL fast);
If your program has optional fast parsing/writing, you can use this routine to save a few lines of code. The flag "fast" says whether or not to use fast parse form. The clause is written to stdout, with a period and newline.
BOOL end_of_commands_term(Term t);
Check if a term is the constant "end_of_commands".
BOOL end_of_list_term(Term t);
Check if a term is the constant "end_of_list".
void f_clause(Clause c);
Write a clause to stdout, with id, with justification last.
void fwrite_clause(FILE *fp, Clause c, BOOL print_id, BOOL justification_last);
This routine prints (to FILE *fp) a clause in mixfix form, followed by ".\n".
void fwrite_clause_list(FILE *fp, Clist lst, BOOL print_ids, BOOL justifications_last);
This routine prints (to FILE *fp) a list of clauses in mixfix form. Example:
list(sos).
a = b.
end_of_list.
If the name of the list is "", it is written as list(anonymous).
void fwrite_formula(FILE *fp, Formula f);
This routine prints a formula, followed by ".\n" to a file. This version does not print extra parentheses (it first translates the formula to a term, then prints the term, then frees the term). To print the formula directly, with extra parentheses, call fprint_formula() instead.
void fwrite_formula_list(FILE *fp, Plist lst, char *name);
This routine prints (to FILE *fp) a list of formulas in mixfix form. Example:
list(sos).
a = b.
end_of_list.
If the name of the list is "", it is written as list(anonymous).
void fwrite_term_list(FILE *fp, Plist lst, char *name);
This routine prints (to FILE *fp) a list of terms in mixfix form. Example:
list(sos).
a = b.
end_of_list.
If the name of the list is "" or NULL, it is written as list(anonymous).
Clause read_clause(FILE *fin, FILE *fout);
This routine reads a clause from FILE *fin. If there are no more clauses in *fin, NULL is returned.

If any error occurs, a message is sent to FILE *fout and a fatal_error occurs.

Variables are "set", upward links ar made from all subterms to the clause, and ac_canonical() is called on each atom.


Clist read_clause_list(FILE *fin, FILE *fout, char *name, BOOL assign_id);
This routine reads a list of clauses from FILE *fin. If you with the list to have a name, send a string; othersize send NULL. (You can name the list later with name_clist().) If there are no more clauses in *fin, an empty Clist is returned.

If any error occurs, a message is sent to FILE *fout and a fatal_error occurs.


Formula read_formula(FILE *fin, FILE *fout);
This routine reads a formula from FILE *fin. If there are no more formulas in *fin, NULL is returned.

If any error occurs, a message is sent to FILE *fout and a fatal_error occurs.


Plist read_formula_list(FILE *fin, FILE *fout);
This routine reads a list of formulas from FILE *fin. If there are no more formulas in *fin, NULL is returned.

If any error occurs, a message is sent to FILE *fout and a fatal_error occurs.


Plist read_term_list(FILE *fin, FILE *fout);
This routine reads a list of terms from FILE *fin. If there are no more terms in *fin, NULL is returned.

None of the returned terms or their subterms will have type VARIABLE, even if it looks like a variable (e.g., x).

If any error occurs, a message is sent to FILE *fout and a fatal_error occurs.


Term term_reader(BOOL fast);
If your program has optional fast parsing/writing, you can use this routine to save a few lines of code. The flag "fast" says whether or not to use fast parse form. A term is read from stdin (NULL if there are none). Errors are fatal.
void term_writer(Term t, BOOL fast);
If your program has optional fast parsing/writing, you can use this routine to save a few lines of code. The flag "fast" says whether or not to use fast parse form. The term is written to stdout, with a period and newline.
void zap_formula_list(Plist lst);
Free a Plist of formulas.
void zap_term_list(Plist lst);
Free a Plist of terms.

Public Definitions in File ioutil.h


Introduction


These activities are projects of the Mathematics and Computer Science Division of Argonne National Laboratory.