ProofState_p parse_spec(CLState_p state, IOFormat parse_format, bool error_on_empty, FunctionProperties free_symb_prop, long* ax_no) { ProofState_p proofstate; Scanner_p in; int i; StrTree_p skip_includes = NULL; long parsed_ax_no; proofstate = ProofStateAlloc(free_symb_prop); for(i=0; state->argv[i]; i++) { in = CreateScanner(StreamTypeFile, state->argv[i], true, NULL); ScannerSetFormat(in, parse_format); FormulaAndClauseSetParse(in, proofstate->axioms, proofstate->f_axioms, proofstate->original_terms, NULL, &skip_includes); CheckInpTok(in, NoToken); DestroyScanner(in); } VERBOUT2("Specification read\n"); parsed_ax_no = ProofStateAxNo(proofstate); if(error_on_empty && (parsed_ax_no == 0)) { #ifdef PRINT_SOMEERRORS_STDOUT fprintf(GlobalOut, "# Error: Input file contains no clauses or formulas\n"); TSTPOUT(GlobalOut, "InputError"); #endif Error("Input file contains no clauses or formulas", OTHER_ERROR); } *ax_no = parsed_ax_no; return proofstate; }
int main(int argc, char* argv[]) { ProofState_p fstate; Scanner_p in; int i; CLState_p state; SpecFeatureCell features; SpecLimits_p limits; StrTree_p skip_includes = NULL; assert(argv[0]); InitIO(NAME); limits = SpecLimitsAlloc(); state = process_options(argc, argv, limits); OpenGlobalOut(outname); if(state->argc == 0) { CLStateInsertArg(state, "-"); } if(parse_features) { if(raw_classify) { process_raw_feature_files(state->argv, limits); } else { process_feature_files(state->argv, limits); } } else { for(i=0; state->argv[i]; i++) { fstate = ProofStateAlloc(FPIgnoreProps); in = CreateScanner(StreamTypeFile, state->argv[i], true, NULL); ScannerSetFormat(in, parse_format); FormulaAndClauseSetParse(in, fstate->axioms, fstate->f_axioms, fstate->original_terms, NULL, & skip_includes); if(raw_classify) { do_raw_classification(state->argv[i], fstate, limits); } else { FormulaSetPreprocConjectures(fstate->f_axioms, fstate->f_ax_archive, false, false); FormulaSetCNF(fstate->f_axioms, fstate->f_ax_archive, fstate->axioms, fstate->original_terms, fstate->freshvars, fstate->gc_original_terms); if(!no_preproc) { ClauseSetPreprocess(fstate->axioms, fstate->watchlist, fstate->archive, fstate->tmp_terms, eqdef_incrlimit, eqdef_maxclauses); } SpecFeaturesCompute(&features, fstate->axioms, fstate->signature); SpecFeaturesAddEval(&features, limits); if(!tptp_header) { fprintf(GlobalOut, "%s : ", state->argv[i]); SpecFeaturesPrint(GlobalOut, &features); fprintf(GlobalOut, " : "); SpecTypePrint(GlobalOut, &features, mask); fprintf(GlobalOut, "\n"); } else { print_tptp_header(fstate, features); } DestroyScanner(in); ProofStateFree(fstate); } } } CLStateFree(state); SpecLimitsCellFree(limits); fflush(GlobalOut); OutClose(GlobalOut); ExitIO(); #ifdef CLB_MEMORY_DEBUG MemFlushFreeList(); MemDebugPrintStats(stdout); #endif return 0; }