All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.chocosolver.solver.constraints.nary.cnf.SatConstraint Maven / Gradle / Ivy

There is a newer version: 4.10.17
Show newest version
/*
 * This file is part of choco-solver, http://choco-solver.org/
 *
 * Copyright (c) 2023, IMT Atlantique. All rights reserved.
 *
 * Licensed under the BSD 4-clause license.
 *
 * See LICENSE file in the project root for full license information.
 */
package org.chocosolver.solver.constraints.nary.cnf;

import org.chocosolver.solver.constraints.nary.sat.PropSat;
import org.chocosolver.solver.Model;
import org.chocosolver.solver.constraints.Constraint;
import org.chocosolver.solver.constraints.ConstraintsName;
import org.chocosolver.util.ESat;

/**
 * 
* * @author Charles Prud'homme * @since 22 nov. 2010 */ public class SatConstraint extends Constraint { private final PropSat miniSat; public SatConstraint(Model model) { super(ConstraintsName.SATCONSTRAINT,new PropSat(model)); miniSat = (PropSat) propagators[0]; } @Override public ESat isSatisfied() { ESat so = ESat.UNDEFINED; for (int i = 0; i < propagators.length; i++) { so = propagators[i].isEntailed(); if (!so.equals(ESat.TRUE)) { return so; } } return so; } public PropSat getPropSat() { return miniSat; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy