dlvhex  2.5.0
testsuite/fixtureEx1.cpp
Go to the documentation of this file.
00001 /* dlvhex -- Answer-Set Programming with external interfaces.
00002  * Copyright (C) 2005, 2006, 2007 Roman Schindlauer
00003  * Copyright (C) 2006, 2007, 2008, 2009, 2010 Thomas Krennwallner
00004  * Copyright (C) 2009, 2010 Peter Schüller
00005  * 
00006  * This file is part of dlvhex.
00007  *
00008  * dlvhex is free software; you can redistribute it and/or modify it
00009  * under the terms of the GNU Lesser General Public License as
00010  * published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * dlvhex is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with dlvhex; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA.
00022  */
00023 
00031 #ifdef HAVE_CONFIG_H
00032 #include "config.h"
00033 #endif // HAVE_CONFIG_H
00034 
00035 #include "fixtureEx1.h"
00036 
00037 #include <boost/test/unit_test.hpp>
00038 
00039 EvalGraphEx1Fixture::EvalGraphEx1Fixture()
00040 {
00041   LOG_SCOPE(INFO,"EvalGraphEx1Fixture", true);
00042   typedef TestEvalUnitPropertyBase UnitCfg;
00043   typedef TestEvalGraph::EvalUnitDepPropertyBundle UnitDepCfg;
00044 
00045   BOOST_TEST_MESSAGE("adding u1");
00046   u1 = eg.addUnit(UnitCfg("a v b."));
00047 
00048   BOOST_TEST_MESSAGE("adding u2");
00049   u2 = eg.addUnit(UnitCfg("f :- b.")); 
00050 
00051   BOOST_TEST_MESSAGE("adding u3");
00052   u3 = eg.addUnit(UnitCfg("c v d."));
00053 
00054   BOOST_TEST_MESSAGE("adding u4");
00055   u4 = eg.addUnit(UnitCfg("j :- d. :- f, c."));
00056 
00057   BOOST_TEST_MESSAGE("adding u5");
00058   u5 = eg.addUnit(UnitCfg("g v h :- f."));
00059 
00060   BOOST_TEST_MESSAGE("adding u6");
00061   u6 = eg.addUnit(UnitCfg("i :- h. :- g."));
00062 
00063   BOOST_TEST_MESSAGE("adding u7");
00064   u7 = eg.addUnit(UnitCfg("k :- j, i."));
00065 
00066   BOOST_TEST_MESSAGE("adding u8");
00067   u8 = eg.addUnit(UnitCfg("m v n."));
00068 
00069   BOOST_TEST_MESSAGE("adding u9");
00070   u9 = eg.addUnit(UnitCfg("o :- m, k."));
00071 
00072   BOOST_TEST_MESSAGE("adding u10");
00073   u10 = eg.addUnit(UnitCfg("l :- not k."));
00074 
00075   BOOST_TEST_MESSAGE("adding u11");
00076   u11 = eg.addUnit(UnitCfg(":- k, l. :- o, not k."));
00077 
00078   BOOST_TEST_MESSAGE("adding e21");
00079   e21 = eg.addDependency(u2, u1, UnitDepCfg(0));
00080 
00081   BOOST_TEST_MESSAGE("adding e42");
00082   e42 = eg.addDependency(u4, u2, UnitDepCfg(0));
00083   BOOST_TEST_MESSAGE("adding e43");
00084   e43 = eg.addDependency(u4, u3, UnitDepCfg(1));
00085 
00086   BOOST_TEST_MESSAGE("adding e52");
00087   e52 = eg.addDependency(u5, u2, UnitDepCfg(0));
00088 
00089   BOOST_TEST_MESSAGE("adding e65");
00090   e65 = eg.addDependency(u6, u5, UnitDepCfg(0));
00091 
00092   BOOST_TEST_MESSAGE("adding e76");
00093   e76 = eg.addDependency(u7, u6, UnitDepCfg(0));
00094   BOOST_TEST_MESSAGE("adding e74");
00095   e74 = eg.addDependency(u7, u4, UnitDepCfg(1));
00096 
00097   BOOST_TEST_MESSAGE("adding e98");
00098   e98 = eg.addDependency(u9, u8, UnitDepCfg(0));
00099   BOOST_TEST_MESSAGE("adding e97");
00100   e97 = eg.addDependency(u9, u7, UnitDepCfg(1));
00101 
00102   BOOST_TEST_MESSAGE("adding e107");
00103   e107 = eg.addDependency(u10, u7, UnitDepCfg(0));
00104 
00105   BOOST_TEST_MESSAGE("adding e117");
00106   e117 = eg.addDependency(u11, u7, UnitDepCfg(0));
00107   BOOST_TEST_MESSAGE("adding e119");
00108   e119 = eg.addDependency(u11, u9, UnitDepCfg(1));
00109   BOOST_TEST_MESSAGE("adding e1110");
00110   e1110 = eg.addDependency(u11, u10, UnitDepCfg(2));
00111 }
00112