InutitionTC  0.30
Functions | Variables
main.h File Reference

The main function, analysis of command line parameters and calling appropriate logic. More...

Go to the source code of this file.

Functions

void yyerror (char *s)
 The procedure prints the information about the syntax error in the TPTP format. More...
 
void printUsage (char *pname)
 The procedure prints out information on how to invoke the program. More...
 
int formulas (char *filename)
 The procedure handles the option of syntax checking for input formulas. More...
 
int proofs (char *filename)
 The procedure handles the option of typechecking of proofs for given formulas. More...
 
int main (int argc, char *argv[])
 The main procedure of the program. More...
 
int typecheckFormula (Term *term, Type *type)
 Typechecks the given term as the proof for the given type. More...
 
int updateTypeVariables (Type *type, envmap *env, int arity)
 The procedure is used to add to environment types of free predicates that occur in the formula. More...
 
int updateTypeVariablesCas (McasIn cas, envmap *env)
 The procedure is used to add to environment types of free predicates that occur in the given case subexpression of a term. More...
 
int updateTypeVariablesTerm (Term *term, envmap *env)
 The procedure is used to add to environment types of free predicates that occur in the given term. More...
 
KindcreateArity (int arity)
 The procedure creates the Kind that represents the given arity of a predicate. More...
 

Variables

int waserror
 The variable is used to communicate errors to functions that do not have appropriate arguments. More...
 
int proof_parsing
 The global variable that contains the proof parsing status. More...
 

Detailed Description

The main function, analysis of command line parameters and calling appropriate logic.

Author
Aleksy Schubert

Function Documentation

Kind* createArity ( int  arity)

The procedure creates the Kind that represents the given arity of a predicate.

Parameters
aritythe number of arguments of the standard carrier type
Returns
the pointer to the freshly created Kind that represents the arity or NULL on error
int formulas ( char *  filename)

The procedure handles the option of syntax checking for input formulas.

Parameters
filenamethe name of the file to parse formulas from
Returns
0 in case all is correctly parsed, other values on error
int main ( int  argc,
char *  argv[] 
)

The main procedure of the program.

The procedure parses the command line options with getopt and directs control to appropriate functions resulting from command line options. In case options are improper usage of the program is printed out.

Parameters
argcthe number of command line chunks
argvthe array of strings that contain command line chunks
Returns
it returns the exit status of the program
void printUsage ( char *  pname)

The procedure prints out information on how to invoke the program.

Parameters
pnamethe name of the executable the program is started from
int proofs ( char *  filename)

The procedure handles the option of typechecking of proofs for given formulas.

Parameters
filenamethe name of the file to parse a proof from
Returns
0 in case all is correctly parsed and typeckecked, other values on error
int typecheckFormula ( Term term,
Type type 
)

Typechecks the given term as the proof for the given type.

The procedure takes the given term, creates appropriate environment with the carrier type and types for the free predicates used in the formula.

Parameters
termthe term to typecheck
typethe type i.e. formula to check if the term is its proof
Returns
true when typechecking is successful, false on error or when the proof is not for the given formula
int updateTypeVariables ( Type type,
envmap env,
int  arity 
)

The procedure is used to add to environment types of free predicates that occur in the formula.

Parameters
typethe type to search for free predicates
envthe environment to insert types for free predicates to
aritythe computed so far arity of the next free predicate to insert
Returns
0 on error, other values when update is successful
int updateTypeVariablesCas ( McasIn  cas,
envmap env 
)

The procedure is used to add to environment types of free predicates that occur in the given case subexpression of a term.

Parameters
casthe cas subexpression to search for free predicates
envthe environment to insert types for free predicates to
Returns
0 on error, other values when update is successful
int updateTypeVariablesTerm ( Term term,
envmap env 
)

The procedure is used to add to environment types of free predicates that occur in the given term.

Parameters
termthe term to search for free predicates
envthe environment to insert types for free predicates to
Returns
0 on error, other values when update is successful
void yyerror ( char *  s)

The procedure prints the information about the syntax error in the TPTP format.

Parameters
sthe string passed from the yacc parser with information on the reason of error

Variable Documentation

int proof_parsing

The global variable that contains the proof parsing status.

It serves to communicate this status to the yacc parser code. It has value 1 when the proof should be parsed from the input file and it has value 0 otherwise. Initially it is equal to 0.

int waserror

The variable is used to communicate errors to functions that do not have appropriate arguments.

Initially it is equal to 0.