problemdifferencer.java

来自「Java版的SAT求解器」· Java 代码 · 共 46 行

JAVA
46
字号
/*
 * ProblemDifferencer.java	1.0 05/10/18
 *
 * Copyright 2005 Positronic Software.
 *
 *
 */

package positronic.satisfiability.elements;

import positronic.satisfiability.exceptions.*;

 /**
 * An extension of the Problem class which expresses the logical difference
 * of two given IProblems. More specifically, the IProblem p defined by
 *
 * <p><tt>IProblem p=new ProblemDifferencer(first,second);</tt></p>
 *
 * is satisfied if and only if the IProblem first is satisfied and the 
 * IProblem second is not satisfied.
 *
 * @author  Kerry Michael Soileau
 * ksoileau@yahoo.com
 * http://web.wt.net/~ksoileau/index.htm
 * @version 1.0, 05/10/18
 * @see BooleanLiteralException
 * @see IClause
 * @see IProblem
 * @see Problem
 */
public class ProblemDifferencer extends Problem implements IProblem
{
  private static final long serialVersionUID = 1L;

	public ProblemDifferencer(IProblem first,IProblem second) throws Exception
  {
		if(first==null || second==null)
			throw new ProblemDifferencerException("Null IProblem was passed to constructor.");
		else
		{
			IProblem denial=new ProblemDenier(second);
			IProblem res=new Conjunction(first,denial);
			this.setClauses(res.getClauses());
		}
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?