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

org.xcsp.modeler.problems.Riddle Maven / Gradle / Ivy

Go to download

Java Tools for parsing XCSP3 instances, compiling JvCSP3 models, and checking solutions. For more information about XCSP3, follow www.xcsp.org

The newest version!
/**
 * AbsCon - Copyright (c) 2017, CRIL-CNRS - [email protected]
 * 
 * All rights reserved.
 * 
 * This program and the accompanying materials are made available under the terms of the CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL which accompanies this
 * distribution, and is available at http://www.cecill.info
 */
package org.xcsp.modeler.problems;

import org.xcsp.common.IVar.Var;
import org.xcsp.modeler.api.ProblemAPI;

class Riddle implements ProblemAPI {

	@Override
	public void model() {
		Var x1 = var("x1", dom(range(15)));
		Var x2 = var("x2", dom(range(15)));
		Var x3 = var("x3", dom(range(15)));
		Var x4 = var("x4", dom(range(15)));

		equal(add(x1, 1), x2);
		equal(add(x2, 1), x3);
		equal(add(x3, 1), x4);
		equal(add(x1, x2, x3, x4), 14);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy