Satisfiability of Horn formulas
Lax535992.HornSat · concepts/Lax535992/HornSat.lean · lax-535992
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
An instance is a CNF instance of the NP core. It is Horn when every clause has at most one positive literal, and it is a yes-instance of HORN-SAT when it is Horn and satisfiable. HORN-SAT is the decision problem of the structures isomorphic to such an instance. Instances that are not Horn are no-instances: the Horn condition is part of the problem, not a promise.
Concept map
Lean source view on GitHub
| 1 | import Mathlib.ModelTheory.Semantics |
| 2 | import Lax904597.Problems |
| 3 | import Lax485149.Problems |
| 4 | import Lax904597.Sat |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: Satisfiability of Horn formulas |
| 9 | type: definition |
| 10 | --- |
| 11 | An instance is a CNF instance of the NP core. It is Horn when every clause |
| 12 | has at most one positive literal, and it is a yes-instance of HORN-SAT when |
| 13 | it is Horn and satisfiable. HORN-SAT is the decision problem of the |
| 14 | structures isomorphic to such an instance. Instances that are not Horn are |
| 15 | no-instances: the Horn condition is part of the problem, not a promise. |
| 16 | -/ |
| 17 | |
| 18 | namespace Lax535992.HornSat |
| 19 | |
| 20 | open Lax904597.Problems Lax485149.Problems |
| 21 | |
| 22 | open Lax904597.Sat |
| 23 | |
| 24 | open FirstOrder |
| 25 | |
| 26 | open Language Structure |
| 27 | |
| 28 | section HornSat |
| 29 | |
| 30 | variable (A : Type) [sat.Structure A] |
| 31 | |
| 32 | /-- Every clause of a CNF instance has at most one positive |
| 33 | literal: any two variables occurring positively in the same clause coincide. -/ |
| 34 | def AtMostOnePositive : Prop := |
| 35 | ∀ c x y : A, RelMap satIsClause ![c] → RelMap satPosIn ![c, x] → |
| 36 | RelMap satPosIn ![c, y] → x = y |
| 37 | |
| 38 | /-- A CNF instance is a yes-instance of HORN-SAT if every clause |
| 39 | has at most one positive literal and the CNF is satisfiable. -/ |
| 40 | def HornSatisfiable : Prop := |
| 41 | AtMostOnePositive A ∧ Satisfiable A |
| 42 | |
| 43 | end HornSat |
| 44 | |
| 45 | /-- HORN-SAT: is the CNF instance Horn and satisfiable? -/ |
| 46 | def HORNSAT : DecisionProblem sat := DecisionProblem.ofPred fun A _ => HornSatisfiable A |
| 47 | |
| 48 | end Lax535992.HornSat |
| 49 |
Used by
Lax535992.CircuitValueInvarianceLax535992.CircuitValuePTIMECompleteLax535992.DeterministicMachineInvarianceLax535992.DeterministicMachinePTIMECompleteLax535992.GameInvarianceLax535992.GamePTIMECompleteLax535992.HornIsLeastFixedPointLax535992.HornSatInvarianceLax535992.HornSatPTIMECompleteLax535992.ImmermanVardiLax535992.InflationaryIsLeastFixedPointLax535992.LeastFixedPointComplementLax535992.NLSubsetPTIMELax535992.PTIMEClosureLax535992.PTIMEEqCoPTIMELax535992.PTIMESubsetNP
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments