bool-rel.icc
Go to the documentation of this file.00001 /* 00002 * Main authors: 00003 * Christian Schulte <schulte@gecode.org> 00004 * 00005 * Copyright: 00006 * Christian Schulte, 2005 00007 * 00008 * Last modified: 00009 * $Date: 2006-08-04 16:05:26 +0200 (Fri, 04 Aug 2006) $ by $Author: schulte $ 00010 * $Revision: 3513 $ 00011 * 00012 * This file is part of Gecode, the generic constraint 00013 * development environment: 00014 * http://www.gecode.org 00015 * 00016 * See the file "LICENSE" for information on usage and 00017 * redistribution of this file, and for a 00018 * DISCLAIMER OF ALL WARRANTIES. 00019 * 00020 */ 00021 00022 namespace Gecode { 00023 00024 namespace MiniModel { 00025 00026 /* 00027 * Operations for Boolean relations 00028 * 00029 */ 00030 forceinline 00031 BoolRel::BoolRel(const BoolExpr& e0, bool t0) 00032 : e(e0), t(t0) {} 00033 00034 forceinline void 00035 BoolRel::post(Space* home) const { 00036 e.post(home,t); 00037 } 00038 00039 } 00040 00041 /* 00042 * Construction of linear relations 00043 * 00044 */ 00045 inline MiniModel::BoolRel 00046 tt(const MiniModel::BoolExpr& e) { 00047 return MiniModel::BoolRel(e,true); 00048 } 00049 inline MiniModel::BoolRel 00050 ff(const MiniModel::BoolExpr& e) { 00051 return MiniModel::BoolRel(e,false); 00052 } 00053 00054 /* 00055 * Posting 00056 * 00057 */ 00058 inline void 00059 post(Space* home, const MiniModel::BoolRel& r, IntConLevel) { 00060 if (home->failed()) return; 00061 r.post(home); 00062 } 00063 00064 } 00065 00066 // STATISTICS: minimodel-any