#include "parse.h"

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

Contents


Public Routines in File parse.c

Index

declare_standard_parse_typesfwrite_termp_parse_memsread_term
fprint_parse_memfwrite_term_nlread_termtranslate_neg_equalities

Details


void declare_standard_parse_types(void);

void fprint_parse_mem(FILE *fp, BOOL heading);
This routine prints (to FILE *fp) memory usage statistics for data types associated with parsing. The Boolean argument heading tells whether to print a heading on the table.
void fwrite_term(FILE *fp, Term t);
This routine prints a term (to FILE *fp) in readable form, that is, infix where appropriate and without extra parentheses. A period and newline are not printed.

See the documentation on mixfix terms and the routine set_parse_type().


void fwrite_term_nl(FILE *fp, Term t);
This routine prints a term (to FILE *fp) in readable form, that is, infix where appropriate and without extra parentheses. Also printed is ".\n".

See the documentation on mixfix terms and the routine set_parse_type().


void p_parse_mem();
This routine prints (to stdout) memory usage statistics for data types associated with parsing.
Term read_term(FILE *fin, FILE *fout);
This routine reads a term (from FILE *fin). The term may be in readable form, that is with infix operations and without extra parentheses.

If there is no term to be read, NULL is returned. If an error occurs, a message is sent to FILE *fout, and fatal error occurs.

See the documentation on mixfix terms and the routine set_parse_type().


Term sread_term(String_buf sb, FILE *fout);
This routine reads a term (from String_buf *sb). The term may be in readable form, that is with infix operations and without extra parentheses.

If there is no term to be read, NULL is returned. If an error occurs, a message is sent to FILE *fout, and fatal error occurs.

See the documentation on mixfix terms and the routine set_parse_type().


void translate_neg_equalities(BOOL flag);
This routine sets or clears the flag which tells the parser to automatically translate alpha!=beta to ~(alpha=beta). This happens in read_term(), which is called by read_clause(), read_formula(), and read_term_list().

Public Definitions in File parse.h


Introduction

This package has routines for reading and writing terms in human-readable form. Binary function symbols can be declared to be infix with a precedence and left or right association, so that many parentheses can be omitted. Unary symbols can be declared to be prefix or postfix. In addition, prolog-style list-notation and quantified formulas are supported.

The symbol declarations and parse rules are similar to the method used by many Prolog systems (although we use mnemonic names instead of xfy, yfx, yf, etc.). The symbol declarations are made with set_parse_type().

This package is based on code taked form Otter and EQP, but there are some important differences. Detailed documentation should be available elsewhere.

The intension is to use this package for reading and writing all types of data (terms, clauses, formulas, control information, etc.), with outside routines to translate to/from the appropriate internal data structure when necessary.


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