Changed arguments order to match other functions
This commit is contained in:
parent
e36db42ec7
commit
c683e624bc
1 changed files with 4 additions and 4 deletions
8
Sat.hs
8
Sat.hs
|
@ -195,13 +195,13 @@ resolveAll f = case findMatchingPair f of
|
|||
-- applies resolveAll and the unit propagation and pure literals
|
||||
-- rules, until it reaches the empty formula (therefore SAT) or an
|
||||
-- empty clause (therefore UNSAT).
|
||||
resolutionSolve :: Assignment -> CNF -> Result
|
||||
resolutionSolve asst [] = SAT asst
|
||||
resolutionSolve asst f
|
||||
resolutionSolve :: (CNF, Assignment) -> Result
|
||||
resolutionSolve ([], asst) = SAT asst
|
||||
resolutionSolve (f, asst)
|
||||
| [] `elem` f = UNSAT
|
||||
| otherwise =
|
||||
let (f', asst') = (pureLitRule . unitPropagate) (f, asst) in
|
||||
resolutionSolve asst' (resolveAll f')
|
||||
resolutionSolve (resolveAll f', asst')
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue