Zulip Chat Archive
Stream: lean4
Topic: there are 2 different projects named "leansat"
David Renshaw (Feb 21 2024 at 18:56):
I found this to be confusing, so I'm posting here to raise awareness.
There are two distinct projects named "leansat":
https://github.com/JamesGallicchio/LeanSAT
https://github.com/leanprover/leansat
François G. Dorais (Feb 21 2024 at 22:44):
And neither has much to do with the development of small satellites. :smile:
James Gallicchio (Feb 22 2024 at 21:07):
Yeah, we did not intend to name clash :joy:
James Gallicchio (Feb 22 2024 at 21:07):
I may rename mine because it seems the leanprover leansat is going to be actively developed by the FRO
Patrick Massot (Feb 22 2024 at 21:10):
Aren’t they meant to work together in the end?
James Gallicchio (Feb 22 2024 at 21:11):
Ours is to do with verified encodings to SAT, the leanprover/leansat
is attempting to provide a SAT tactic for expressions over bool and bitvec. Unclear whether they will be merged in the near future because the end user interfaces are so dissimilar. I'm hoping the backend interfaces to SAT solvers will be merged though!
Kim Morrison (Feb 23 2024 at 03:43):
leanprover/leansat is being actively developed. Currently there is:
- a frontend that processes a Lean goal and reflects it to a
e : BoolExpr
, and a proof builder that can proveFalse
given a proof ofe.unsat
. - a translation from BoolExpr to CNF
- machinery to send that CNF to a SAT solver, and then verify in the kernel the lrat proof produced
(1. and 2. are my work last week, 3. is mostly existing work of Josh Clune's in the leansat repo, which @Henrik Böving has been cleaning up. He's also provided all the necessary glue between 2. and 3.)
It runs. However right now the proofs it produces contain a sorry
, because the translation from BoolExpr to CNF is not verified. This should not be particularly difficult, and some combination of @Henrik Böving and I will probably do it soon.
It is quite preliminary, and there are unnecessary bottlenecks at several places in the current implementation.
I've only briefly looked at James' repo. Happy to talk sometime to see if there is something we can incorporate from it. There's also yet another repo doing similar things, but which I think is currently private.
More updates coming soon!
Mario Carneiro (Feb 23 2024 at 04:06):
Both are being actively developed. It seems like there was a communication failure that lead to the project getting named the same as an existing active project
Kim Morrison (Feb 23 2024 at 05:48):
Sorry about this. My understanding is that Leo set up the leanprover/leansat to hold Josh's work last year (created June, first real commit November), and I guess wasn't aware of James'.
(And apologies that my message may have implied the other wasn't being actively developed. The leansat one had been motionless until about a week ago: I wanted to make the distinction more between now and last week than between leanprover/leansat and JamesGallichio/leansat!)
James Gallicchio (Feb 23 2024 at 06:02):
This should not be particularly difficult
I hope this is true... we resorted to the classic "build a bunch of infrastructure" strategy, roughly as follows:
- a state monad (
EncCNF
) to keep track of the map from (the original) variables to Nat, and the highest number used in the CNF (which grows as auxiliaries are allocated) - a subtype of these monadic programs (
VEncCNF
) that states what is being encoded (over the original variables) with some inane verification condition that ensures the CNF is satisfiable iff the formula over the original variables is satisfiable. that way you can generate and use auxiliary variables for e.g. tseitin transformation but they are completely hidden by the signature.
the proofs of those verification conditions have not been too bad, but it still required a surprising amount of infrastructure to finish. let me know if you get something simple working, I'll be very interested to check it out!!
sidenote: VEncCNF
is actually a dijkstra monad a la F*, but we have yet to find use for this observation.
Kim Morrison (Feb 23 2024 at 06:15):
Okay, challenge accepted. :-) I agree I should not say "not particularly difficult" about something that I committed with a sorry
. I'm certainly hoping still to be more lightweight here.
Kim Morrison (Feb 24 2024 at 13:33):
@James Gallicchio, I pushed a tedious but low-tech verification in https://github.com/leanprover/leansat/pull/8. The actually transformation is about 15 lines in LeanSat.Reflect.BoolExpr.Tseitin.Defs
, and the proof is 600 lines in ...Lemma
.
Kim Morrison (Feb 24 2024 at 13:38):
I'm pretty unimpressed with how many independent inductions I did over BoolExpr
, but it seemed easier to just prove each fact I needed in order, rather than try to combine them.
Kim Morrison (Feb 24 2024 at 13:40):
The specific encoding I use it profligate with variables, which may hurt: a real SAT solver won't care at all, but the lrat verification step will. I'm hoping that the it's easy enough to post-process this profligacy out on the CNF side.
But it would be great to have comparisons. If you were able to connect your Tseitin transform to our representation of BoolExpr
and CNF
, we could plug it into the pipeline and see how it runs. I think we will have a benchmark suite soon.
Kim Morrison (Feb 25 2024 at 05:23):
I heard from @Jeremy Avigad earlier today about some of the leansat work happening at CMU. It would be great if we could have a get together sometime soon to discuss what should live in which repository. I'd propose we schedule around me + @Henrik Böving + @James Gallicchio, but then if there are others at CMU (or elsewhere) everyone is welcome.
Unfortunately 9am-4pm Pittsburgh time I'm usually unavailable, but flexible before or afterwards.
Jeremy Avigad (Feb 25 2024 at 14:15):
It would be good if @Cayden Codel can join the discussion as well. He and James can explain the project and its goals.
Mario Carneiro (Feb 26 2024 at 01:06):
I'd also like to attend, I have an alternative encoding proof that I'm hoping to upstream to CMU LeanSAT soon
Kim Morrison (Feb 26 2024 at 01:10):
Great: we're aiming at . I'll send an invite, let me know if that time won't work.
Henrik Böving (Feb 26 2024 at 22:01):
@Mario Carneiro bonk
James Gallicchio (Apr 17 2024 at 07:55):
thoughts on renaming my leansat to lean4sat
(lean proofs for sat tools) and the FRO's leansat to sat4lean
(sat tools for lean proofs)? :stuck_out_tongue:
James Gallicchio (Apr 17 2024 at 07:56):
it's unfortunate that the language is lean4
because lean4sat
can be mis-read as lean4 SAT
instead of "Lean for SAT"
Mario Carneiro (Apr 17 2024 at 07:56):
we call that a pun
Eric Wieser (Apr 17 2024 at 07:57):
Leaninsat
and satinlean
?
Julian Berman (Apr 17 2024 at 08:59):
Satin Lean, the glossiest of Leans.
Henrik Böving (Apr 18 2024 at 06:20):
While I do like the idea of the pun it seems to me personally like this is just asking for a mixup and potentially confusing google results for either package?
Mario Carneiro (Apr 18 2024 at 07:09):
to be fair, the names LeanSAT
and leansat
are not any less mixup-prone
Henrik Böving (Apr 18 2024 at 07:10):
Don't get me wrong I do think there should be a change, I just think we should nail it the first time and not change more later on.
Mario Carneiro (Apr 18 2024 at 07:10):
I think James's project could be called sat-tools or sat-encoding
Last updated: May 02 2025 at 03:31 UTC