WIP: add dedukti output (not functional yet)

This commit is contained in:
Guillaume Bury 2016-05-20 17:03:22 +02:00
parent d06de43789
commit 1e2dc299ce
6 changed files with 31 additions and 10 deletions

View file

@ -1,12 +1,14 @@
S sat S sat
S smt S smt
S solver S solver
S util
S backend S backend
S util
S util/smtlib
B _build/ B _build/
B _build/sat B _build/sat
B _build/smt B _build/smt
B _build/solver B _build/solver
B _build/util B _build/util
B _build/smtlib
B _build/backend B _build/backend

View file

@ -16,7 +16,7 @@ module type Arg = sig
val context : Format.formatter -> proof -> unit val context : Format.formatter -> proof -> unit
end end
module Make(S : Res.S)(A : Arg with type formula := S.St.formula and type proof := S.proof) = struct module Make(S : Res.S)(A : Arg with type formula := S.St.formula and type lemma := S.lemma and type proof := S.proof) = struct
let pp_nl fmt = Format.fprintf fmt "@\n" let pp_nl fmt = Format.fprintf fmt "@\n"
let fprintf fmt format = Format.kfprintf pp_nl fmt format let fprintf fmt format = Format.kfprintf pp_nl fmt format

View file

@ -14,6 +14,9 @@ end
module Make : module Make :
functor(S : Res.S) -> functor(S : Res.S) ->
functor(A : Arg with type formula := S.St.formula and type proof := S.proof) -> functor(A : Arg
with type formula := S.St.formula
and type lemma := S.lemma
and type proof := S.proof) ->
S with type t := S.proof S with type t := S.proof
(** Functor to generate a backend to output proofs for the dedukti type checker. *) (** Functor to generate a backend to output proofs for the dedukti type checker. *)

17
main.ml
View file

@ -22,6 +22,7 @@ type sat_input =
type sat_output = type sat_output =
| Standard (* Only output problem status *) | Standard (* Only output problem status *)
| Dedukti
| Dot | Dot
type solver = type solver =
@ -39,6 +40,7 @@ let input_list = [
] ]
let output_list = [ let output_list = [
"dot", Dot; "dot", Dot;
"dk", Dedukti;
] ]
let solver_list = [ let solver_list = [
"smt", Smt; "smt", Smt;
@ -96,14 +98,19 @@ let print format = match !output with
| Dot -> | Dot ->
Format.fprintf std "/* "; Format.fprintf std "/* ";
Format.kfprintf (fun fmt -> Format.fprintf fmt " */@.") std format Format.kfprintf (fun fmt -> Format.fprintf fmt " */@.") std format
| Dedukti ->
Format.fprintf std "(; ";
Format.kfprintf (fun fmt -> Format.fprintf fmt " ;)@.") std format
let print_proof proof = match !output with let print_proof proof = match !output with
| Standard -> () | Standard -> ()
| Dot -> Smt.print_proof std proof | Dot -> Smt.print_dot std proof
| Dedulti -> Smt.print_dedukti std proof
let print_mcproof proof = match !output with let print_mcproof proof = match !output with
| Standard -> () | Standard -> ()
| Dot -> Mcsat.print_proof std proof | Dot -> Mcsat.print_dot std proof
| Dedulti -> Mcsat.print_dedukti std proof
let rec print_cl fmt = function let rec print_cl fmt = function
| [] -> Format.fprintf fmt "[]" | [] -> Format.fprintf fmt "[]"
@ -121,15 +128,15 @@ let print_mclause l =
let print_cnf cnf = match !output with let print_cnf cnf = match !output with
| Standard -> print_lcl cnf | Standard -> print_lcl cnf
| Dot -> () | Dot | Dedukti -> ()
let print_unsat_core u = match !output with let print_unsat_core u = match !output with
| Standard -> print_lclause u | Standard -> print_lclause u
| Dot -> () | Dot | Dedukti -> ()
let print_mc_unsat_core u = match !output with let print_mc_unsat_core u = match !output with
| Standard -> print_mclause u | Standard -> print_mclause u
| Dot -> () | Dot | Dedukti -> ()
(* Arguments parsing *) (* Arguments parsing *)
let file = ref "" let file = ref ""

View file

@ -67,8 +67,14 @@ module Make(Dummy:sig end) = struct
let print_atom = St.print_atom let print_atom = St.print_atom
let lemma_info () = "Proof", Some "PURPLE", [] let lemma_info () = "Proof", Some "PURPLE", []
end) end)
module Dedukti = Dedukti.Make(Proof)(struct
let print _ _ = ()
let prove _ _ = ()
let context _ _ = ()
end)
let print_clause = St.print_clause let print_clause = St.print_clause
let print_proof = Dot.print let print_dot = Dot.print
let print_dedulti = Dedukti.print
end end

View file

@ -12,7 +12,10 @@ module Make(Dummy: sig end) : sig
val print_clause : Format.formatter -> St.clause -> unit val print_clause : Format.formatter -> St.clause -> unit
(** Print the clause on the given formatter. *) (** Print the clause on the given formatter. *)
val print_proof : Format.formatter -> Proof.proof -> unit val print_dot : Format.formatter -> Proof.proof -> unit
(** Print the given proof in dot format. *)
val print_dedukti : Format.formatter -> Proof.proof -> unit
(** Print the given proof in dot format. *) (** Print the given proof in dot format. *)
end end