src/HOL/Tools/res_atp_setup.ML
changeset 18863 a113b6839df1
parent 18748 1d7b0830a8a7
child 18920 7635e0060cd4
equal deleted inserted replaced
18862:bd83590be0f7 18863:a113b6839df1
   323 fun atp_axioms_g tptp_ax_fn rules file =
   323 fun atp_axioms_g tptp_ax_fn rules file =
   324     let val out = TextIO.openOut file
   324     let val out = TextIO.openOut file
   325 	val (clss,errs) = tptp_ax_fn rules
   325 	val (clss,errs) = tptp_ax_fn rules
   326 	val clss' = ResClause.union_all clss
   326 	val clss' = ResClause.union_all clss
   327     in
   327     in
   328 	ResAtp.writeln_strs out clss';
   328 	ResClause.writeln_strs out clss';
   329 	TextIO.closeOut out;
   329 	TextIO.closeOut out;
   330 	([file],errs)
   330 	([file],errs)
   331     end;
   331     end;
   332 
   332 
   333 
   333 
   351     end;
   351     end;
   352 
   352 
   353 fun atp_conjectures_h_g filt_conj_fn hyp_cls =
   353 fun atp_conjectures_h_g filt_conj_fn hyp_cls =
   354     let val (tptp_h_clss,tfree_litss) = filt_conj_fn hyp_cls
   354     let val (tptp_h_clss,tfree_litss) = filt_conj_fn hyp_cls
   355 	val tfree_lits = ResClause.union_all tfree_litss
   355 	val tfree_lits = ResClause.union_all tfree_litss
   356 	val tfree_clss = map ResClause.tfree_clause tfree_lits 
   356 	val tfree_clss = map ResClause.tptp_tfree_clause tfree_lits 
   357 	val hypsfile = hyps_file ()
   357 	val hypsfile = hyps_file ()
   358         val out = TextIO.openOut(hypsfile)
   358         val out = TextIO.openOut(hypsfile)
   359     in
   359     in
   360         ResAtp.writeln_strs out (tfree_clss @ tptp_h_clss);
   360         ResClause.writeln_strs out (tfree_clss @ tptp_h_clss);
   361         TextIO.closeOut out; warning hypsfile;
   361         TextIO.closeOut out; warning hypsfile;
   362         ([hypsfile],tfree_lits)
   362         ([hypsfile],tfree_lits)
   363     end;
   363     end;
   364 
   364 
   365 fun atp_conjectures_h_fol hyp_cls = atp_conjectures_h_g filtered_tptp_conjectures_fol hyp_cls;
   365 fun atp_conjectures_h_fol hyp_cls = atp_conjectures_h_g filtered_tptp_conjectures_fol hyp_cls;
   366 
   366 
   367 fun atp_conjectures_h_hol hyp_cls = atp_conjectures_h_g filtered_tptp_conjectures_hol hyp_cls;
   367 fun atp_conjectures_h_hol hyp_cls = atp_conjectures_h_g filtered_tptp_conjectures_hol hyp_cls;
   368 
   368 
   369 fun atp_conjectures_c_g filt_conj_fn conj_cls n tfrees =
   369 fun atp_conjectures_c_g filt_conj_fn conj_cls n tfrees =
   370     let val (tptp_c_clss,tfree_litss) = filt_conj_fn conj_cls
   370     let val (tptp_c_clss,tfree_litss) = filt_conj_fn conj_cls
   371 	val tfree_clss = map ResClause.tfree_clause ((ResClause.union_all tfree_litss) \\ tfrees)
   371 	val tfree_clss = map ResClause.tptp_tfree_clause ((ResClause.union_all tfree_litss) \\ tfrees)
   372 	val probfile = prob_file n
   372 	val probfile = prob_file n
   373 	val out = TextIO.openOut(probfile)		 	
   373 	val out = TextIO.openOut(probfile)		 	
   374     in
   374     in
   375 	ResAtp.writeln_strs out (tfree_clss @ tptp_c_clss);
   375 	ResClause.writeln_strs out (tfree_clss @ tptp_c_clss);
   376 	TextIO.closeOut out;
   376 	TextIO.closeOut out;
   377 	warning probfile; 
   377 	warning probfile; 
   378 	probfile 
   378 	probfile 
   379     end;
   379     end;
   380 
   380 
   408 	val arity_cls = map ResClause.tptp_arity_clause arity_clauses
   408 	val arity_cls = map ResClause.tptp_arity_clause arity_clauses
   409 	fun write_ts () =
   409 	fun write_ts () =
   410 	    let val tsfile = types_sorts_file ()
   410 	    let val tsfile = types_sorts_file ()
   411 		val out = TextIO.openOut(tsfile)
   411 		val out = TextIO.openOut(tsfile)
   412 	    in
   412 	    in
   413 		ResAtp.writeln_strs out (classrel_cls @ arity_cls);
   413 		ResClause.writeln_strs out (classrel_cls @ arity_cls);
   414 		TextIO.closeOut out;
   414 		TextIO.closeOut out;
   415 		[tsfile]
   415 		[tsfile]
   416 	    end
   416 	    end
   417     in
   417     in
   418 	if (List.null arity_cls andalso List.null classrel_cls) then []
   418 	if (List.null arity_cls andalso List.null classrel_cls) then []