OKlibrary  0.2.1.6
DLL_Algorithms.cpp
Go to the documentation of this file.
00001 // Oliver Kullmann, 5.3.2002 (Swansea)
00002 /* Copyright 2002 - 2007, 2009, 2010 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00020 #include <algorithm>
00021 
00022 #include <OKlib/Satisfiability/ProblemInstances/Variables/VarSet.hpp>
00023 #include <OKlib/Satisfiability/ProblemInstances/Literals/Literal.hpp>
00024 #include <OKlib/Satisfiability/ProblemInstances/ClauseSets/ClauseSet.hpp>
00025 #include <OKlib/Satisfiability/Assignments/PartialAssignments/PartAssign.hpp>
00026 #include <OKlib/Satisfiability/Algorithms/Backtracking/DLL_Algorithms.hpp>
00027 
00028 namespace DLL_Algorithms {
00029 
00030   DLL_Algorithms::Result DLL_1(const Clausesets::Cls& F){
00031     if (F.is_empty())
00032       return true;
00033     else if (F.empty_clause())
00034       return false;
00035     else {
00036       Variables::Var v = *F.var().begin();
00037       using PartAssignments::Pass;
00038       using Literals::Lit;
00039       return DLL_Algorithms::Result(std::max(DLL_1(Pass(Lit(v, false)) * F).sat, DLL_1(Pass(Lit(v, true)) * F).sat));
00040     }
00041   }
00042 
00043 }
00044