AFTD Auto-Formalizing Theoretical Domains

ThreeSATToClique.getLitAt

defimported Lean

Given a 3-CNF formula $f$ and a vertex $v : \mathtt{CliqueVertex}\,f.\mathtt{length}$, returns the literal at position $v.l\_idx$ within clause $f[v.c\_idx]$. The type of $v$ guarantees the index is always in bounds.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
def ThreeSATToClique.getLitAt {V : Type} (f : Formula3 V) (v : CliqueVertex f.length) : Literal V
Defined in
TCSlib, `ThreeSATToClique.getLitAt`
Lean proof
By Yangshuo Zou, from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 Yangshuo Zou. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
none listed
Built on 4
  • ThreeSATToClique.getLitInClauseGiven a 3-clause $c$ and a position $p : \mathrm{Fin}\,3$, returns the $p$-th literal of $c$: $c.l_1$ at position $0$, $c.l_2$ at position…
  • ThreeSATToClique.LiteralA literal for switching-lemma formulas: a variable $\mathtt{var} : \mathrm{Fin}\,n$ with a negation flag $\mathtt{neg} : \mathrm{Bool}$…
  • ThreeSATToClique.Formula3A 3-CNF formula over $V$ is a list of 3-clauses, representing their conjunction.
  • ThreeSATToClique.CliqueVertexA vertex of the conflict graph for a formula with $m$ clauses is a pair $\langle c\_idx, l\_idx \rangle$ where $c\_idx : \mathrm{Fin}\,m$…
Used by 5

Lean source view module on GitHub

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
/-- The literal named by vertex `v` in formula `f`. The type of `v` carries `f.length` so the index is always in bounds. -/
def ThreeSATToClique.getLitAt {V : Type} (f : Formula3 V) (v : CliqueVertex f.length) : Literal V :=
  getLitInClause (f.get v.c_idx) v.l_idx
See it in the graphDiscuss this resultChallenge it