3

In Extending Sledgehammer with SMT solvers I find this quote:

Certificates make it possible to store Z3 proofs alongside Isabelle formalizations, allowing SMT proof replay without Z3. Only if the formalizations cahnge must the certificates be regenerated.

How does a Z3 certificate look like? Is it just some sort of balanced tree where the inference steps obtained in Z3 are stored?

user1868607
  • 2,558
  • 1
  • 17
  • 38

1 Answers1

3

A certificate is simply the proof produced by Z3. Here is an example (taken from the file SMT_Examples.certs you can find in the Isabelle distribution):

23f5eb3b530a4577da2f8947333286ff70ed557f 11 0
unsat
((set-logic AUFLIA)
(proof
(let (($x29 (exists ((?v0 A$) )(! (g$ ?v0) :qid k!7))
))
(let (($x30 (f$ $x29)))
(let (($x31 (=> $x30 true)))
(let (($x32 (not $x31)))
(let ((@x42 (trans (monotonicity (rewrite (= $x31 true)) (= $x32 (not true))) (rewrite (= (not true) false)) (= $x32 false))))
(mp (asserted $x32) @x42 false))))))))

A Z3 proof is, in essence, a proof tree with false as a conclusion, not a balanced tree. The reconstruction and the proof format is described in a paper by Sascha Böhme.

Remark that Sledgehammer has nothing to do with certificates. Whenever you have an smt call (whether you have written it by hand or used Sledgehammer to produce it), you can use certificates. However, I don't know anyone doing it.

Mathias Fleury
  • 2,221
  • 5
  • 12
  • I thought you used certificates at every smt call, so that each time the source is parsed, we don't have to call the external solver again – user1868607 Aug 29 '20 at 15:49
  • also interesting, what is the hash code that appears on top of the proof? – user1868607 Aug 29 '20 at 15:51
  • For the hash code: I think this is due to how the caching works, but I don't really know what it represents. Probably some sanity check to make debugging easier. – Mathias Fleury Aug 29 '20 at 16:22