Index: src/Parameters/Validators/DiscreteValidator_impl.hpp
===================================================================
--- src/Parameters/Validators/DiscreteValidator_impl.hpp	(revision d555b8de3042f993d9e6e78429e75cfdf58fd94a)
+++ src/Parameters/Validators/DiscreteValidator_impl.hpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
@@ -14,4 +14,6 @@
 #include <config.h>
 #endif
+
+#include <algorithm>
 
 template <class T>
Index: src/Parameters/Validators/Ops_Validator.hpp
===================================================================
--- src/Parameters/Validators/Ops_Validator.hpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
+++ src/Parameters/Validators/Ops_Validator.hpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
@@ -0,0 +1,39 @@
+/*
+ * Ops_Validator.hpp
+ *
+ *  Created on: May 9, 2012
+ *      Author: ankele
+ */
+
+#ifndef OPS_VALIDATOR_HPP_
+#define OPS_VALIDATOR_HPP_
+
+
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Validator.hpp"
+
+
+template <class T>
+class And_Validator;
+template <class T>
+class Or_Validator;
+template <class T>
+class Not_Validator;
+
+template <class T>
+And_Validator<T> operator&&(const Validator<T> &a, const Validator<T> &b);
+template <class T>
+Or_Validator<T> operator||(const Validator<T> &a, const Validator<T> &b);
+template <class T>
+Not_Validator<T> operator!(const Validator<T> &a);
+
+
+#include "Ops_Validator_impl.hpp"
+
+#endif /* OPS_VALIDATOR_HPP_ */
Index: src/Parameters/Validators/Ops_Validator_impl.hpp
===================================================================
--- src/Parameters/Validators/Ops_Validator_impl.hpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
+++ src/Parameters/Validators/Ops_Validator_impl.hpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
@@ -0,0 +1,150 @@
+/*
+ * Ops_Validator_impl.hpp
+ *
+ *  Created on: May 9, 2012
+ *      Author: ankele
+ */
+
+#ifndef OPS_VALIDATOR_IMPL_HPP_
+#define OPS_VALIDATOR_IMPL_HPP_
+
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Validator.hpp"
+
+/** Logical AND composition of two Validators.
+ *
+ */
+template <class T>
+class And_Validator : public Validator<T>
+{
+public:
+  And_Validator(const Validator<T> &_a, const Validator<T> &_b) :
+    a(_a.clone()), b(_b.clone())
+  {}
+  virtual ~And_Validator()
+  {
+    delete(a);
+    delete(b);
+  }
+
+  bool isValid(const T & _value) const {
+    return (*a)(_value) && (*b)(_value);
+  }
+
+  Validator<T>* clone() const
+  { return new And_Validator(*a, *b);  }
+
+  // comparator
+  bool operator==(const Validator<T> &_instance) const
+  {
+    const And_Validator<T> *inst = dynamic_cast<const And_Validator<T> *>(&_instance);
+    if (inst)
+      return (*a == *inst->a) && (*b == *inst->b);
+    return false;
+  }
+
+private:
+  Validator<T> *a;
+  Validator<T> *b;
+};
+
+/** Logical OR composition of two Validators.
+ *
+ */
+template <class T>
+class Or_Validator : public Validator<T>
+{
+public:
+  Or_Validator(const Validator<T> &_a, const Validator<T> &_b) :
+    a(_a.clone()), b(_b.clone())
+  {}
+  virtual ~Or_Validator()
+  {
+    delete(a);
+    delete(b);
+  }
+
+  bool isValid(const T & _value) const {
+    return (*a)(_value) || (*b)(_value);
+  }
+
+  Validator<T>* clone() const
+  { return new Or_Validator(*a, *b);  }
+
+  // comparator
+  bool operator==(const Validator<T> &_instance) const
+  {
+    const Or_Validator<T> *inst = dynamic_cast<const Or_Validator<T> *>(&_instance);
+    if (inst)
+      return (*a == *inst->a) && (*b == *inst->b);
+    return false;
+  }
+
+private:
+  Validator<T> *a;
+  Validator<T> *b;
+};
+
+/** Logical NOT composition of a Validator.
+ *
+ */
+template <class T>
+class Not_Validator : public Validator<T>
+{
+public:
+  Not_Validator(const Validator<T> &_a) :
+    a(_a.clone())
+  {}
+  virtual ~Not_Validator()
+  {
+    delete(a);
+  }
+
+  bool isValid(const T & _value) const {
+    return !(*a)(_value);
+  }
+
+  Validator<T>* clone() const
+  { return new Not_Validator(*a);  }
+
+  // comparator
+  bool operator==(const Validator<T> &_instance) const
+  {
+    const Not_Validator<T> *inst = dynamic_cast<const Not_Validator<T> *>(&_instance);
+    if (inst)
+      return (*a == *inst->a);
+    return false;
+  }
+
+private:
+  Validator<T> *a;
+};
+
+
+
+template <class T>
+And_Validator<T> operator&&(const Validator<T> &a, const Validator<T> &b)
+{
+  return And_Validator<T>(a, b);
+}
+
+template <class T>
+Or_Validator<T> operator||(const Validator<T> &a, const Validator<T> &b)
+{
+  return Or_Validator<T>(a, b);
+}
+
+template <class T>
+Not_Validator<T> operator!(const Validator<T> &a)
+{
+  return Not_Validator<T>(a);
+}
+
+
+#endif /* OPS_VALIDATOR_IMPL_HPP_ */
Index: src/Parameters/unittests/Makefile.am
===================================================================
--- src/Parameters/unittests/Makefile.am	(revision d555b8de3042f993d9e6e78429e75cfdf58fd94a)
+++ src/Parameters/unittests/Makefile.am	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
@@ -7,5 +7,6 @@
 	../Parameters/unittests/ContinuousParameterTest.cpp \
 	../Parameters/unittests/DiscreteValueTest.cpp \
-	../Parameters/unittests/DiscreteParameterTest.cpp
+	../Parameters/unittests/DiscreteParameterTest.cpp \
+	../Parameters/unittests/Ops_ValidatorTest.cpp
 
 PARAMETERSTESTSHEADERS = \
@@ -13,5 +14,6 @@
 	../Parameters/unittests/ContinuousParameterTest.hpp \
 	../Parameters/unittests/DiscreteValueTest.hpp \
-	../Parameters/unittests/DiscreteParameterTest.hpp
+	../Parameters/unittests/DiscreteParameterTest.hpp \
+	../Parameters/unittests/Ops_ValidatorTest.hpp
 
 PARAMETERSTESTS = \
@@ -19,5 +21,6 @@
 	ContinuousParameterTest \
 	DiscreteValueTest \
-	DiscreteParameterTest
+	DiscreteParameterTest \
+	Ops_ValidatorTest
 
 TESTS += $(PARAMETERSTESTS)
@@ -35,4 +38,6 @@
 	../Parameters/Validators/DiscreteValidator_impl.hpp \
 	../Parameters/Validators/DummyValidator.hpp \
+	../Parameters/Validators/Ops_Validator.hpp \
+	../Parameters/Validators/Ops_Validator_impl.hpp \
 	../Parameters/Validators/RangeValidator.hpp \
 	../Parameters/Validators/RangeValidator_impl.hpp \
@@ -60,4 +65,6 @@
 	../Parameters/Validators/DiscreteValidator_impl.hpp \
 	../Parameters/Validators/DummyValidator.hpp \
+	../Parameters/Validators/Ops_Validator.hpp \
+	../Parameters/Validators/Ops_Validator_impl.hpp \
 	../Parameters/Validators/RangeValidator.hpp \
 	../Parameters/Validators/RangeValidator_impl.hpp \
@@ -77,4 +84,6 @@
 	../Parameters/Validators/DiscreteValidator_impl.hpp \
 	../Parameters/Validators/DummyValidator.hpp \
+	../Parameters/Validators/Ops_Validator.hpp \
+	../Parameters/Validators/Ops_Validator_impl.hpp \
 	../Parameters/Validators/RangeValidator.hpp \
 	../Parameters/Validators/RangeValidator_impl.hpp \
@@ -102,4 +111,6 @@
 	../Parameters/Validators/DiscreteValidator_impl.hpp \
 	../Parameters/Validators/DummyValidator.hpp \
+	../Parameters/Validators/Ops_Validator.hpp \
+	../Parameters/Validators/Ops_Validator_impl.hpp \
 	../Parameters/Validators/RangeValidator.hpp \
 	../Parameters/Validators/RangeValidator_impl.hpp \
@@ -112,4 +123,19 @@
 	$(PARAMETERSLIBS) \
 	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la
+
+Ops_ValidatorTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Parameters/unittests/Ops_ValidatorTest.cpp \
+	../Parameters/unittests/Ops_ValidatorTest.hpp \
+	../Parameters/Validators/DiscreteValidator.hpp \
+	../Parameters/Validators/DiscreteValidator_impl.hpp \
+	../Parameters/Validators/DummyValidator.hpp \
+	../Parameters/Validators/Ops_Validator.hpp \
+	../Parameters/Validators/Ops_Validator_impl.hpp \
+	../Parameters/Validators/RangeValidator.hpp \
+	../Parameters/Validators/RangeValidator_impl.hpp \
+	../Parameters/Validators/Validator.hpp
+Ops_ValidatorTest_LDADD = \
+	$(PARAMETERSLIBS) \
+	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la
  
  
Index: src/Parameters/unittests/Ops_ValidatorTest.cpp
===================================================================
--- src/Parameters/unittests/Ops_ValidatorTest.cpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
+++ src/Parameters/unittests/Ops_ValidatorTest.cpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
@@ -0,0 +1,100 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * Ops_ValidatorTest.cpp
+ *
+ *  Created on: May 9, 2012
+ *      Author: ankele
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "Parameters/Validators/DiscreteValidator.hpp"
+#include "Parameters/Validators/Ops_Validator.hpp"
+
+#include "Ops_ValidatorTest.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( Ops_ValidatorTest );
+
+void Ops_ValidatorTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  ValidValuesA.push_back(1);
+  ValidValuesA.push_back(2);
+  ValidValuesA.push_back(3);
+  ValidValuesA.push_back(4);
+  ValidValuesB.push_back(1);
+  ValidValuesB.push_back(3);
+  ValidValuesB.push_back(10);
+}
+
+
+void Ops_ValidatorTest::tearDown()
+{
+  ValidValuesA.clear();
+  ValidValuesB.clear();
+}
+
+/** Test whether operator() returns as desired
+ *
+ */
+void Ops_ValidatorTest::AndTest()
+{
+  And_Validator<int> AndVal = (DiscreteValidator<int>(ValidValuesA) && DiscreteValidator<int>(ValidValuesB));
+
+  CPPUNIT_ASSERT( (AndVal)(1) );
+  CPPUNIT_ASSERT( (AndVal)(3) );
+  CPPUNIT_ASSERT( !(AndVal)(2) );
+  CPPUNIT_ASSERT( !(AndVal)(0) );
+}
+/** Test whether operator() returns as desired
+ *
+ */
+void Ops_ValidatorTest::OrTest()
+{
+  Or_Validator<int> OrVal = (DiscreteValidator<int>(ValidValuesA) || DiscreteValidator<int>(ValidValuesB));
+
+  CPPUNIT_ASSERT( (OrVal)(1) );
+  CPPUNIT_ASSERT( (OrVal)(2) );
+  CPPUNIT_ASSERT( (OrVal)(3) );
+  CPPUNIT_ASSERT( (OrVal)(4) );
+  CPPUNIT_ASSERT( (OrVal)(10) );
+  CPPUNIT_ASSERT( !(OrVal)(0) );
+  CPPUNIT_ASSERT( !(OrVal)(5) );
+}
+
+/** Test whether operator!() returns as desired
+ *
+ */
+void Ops_ValidatorTest::NotTest()
+{
+  Not_Validator<int> NotVal = (!DiscreteValidator<int>(ValidValuesA));
+
+  CPPUNIT_ASSERT( !(NotVal)(1) );
+  CPPUNIT_ASSERT( !(NotVal)(3) );
+  CPPUNIT_ASSERT( (NotVal)(5) );
+  CPPUNIT_ASSERT( (NotVal)(0) );
+}
Index: src/Parameters/unittests/Ops_ValidatorTest.hpp
===================================================================
--- src/Parameters/unittests/Ops_ValidatorTest.hpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
+++ src/Parameters/unittests/Ops_ValidatorTest.hpp	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
@@ -0,0 +1,44 @@
+/*
+ * Ops_ValidatorTest.hpp
+ *
+ *  Created on: May 9, 2012
+ *      Author: ankele
+ */
+
+#ifndef OPS_VALIDATORTEST_HPP_
+#define OPS_VALIDATORTEST_HPP_
+
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <vector>
+
+class Ops_ValidatorTest :  public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( Ops_ValidatorTest ) ;
+  CPPUNIT_TEST ( AndTest );
+  CPPUNIT_TEST ( OrTest );
+  CPPUNIT_TEST ( NotTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void AndTest();
+  void OrTest();
+  void NotTest();
+
+private:
+  std::vector<int> ValidValuesA;
+  std::vector<int> ValidValuesB;
+};
+
+
+#endif /* OPS_VALIDATORTEST_HPP_ */
Index: src/Parser/Makefile.am
===================================================================
--- src/Parser/Makefile.am	(revision d555b8de3042f993d9e6e78429e75cfdf58fd94a)
+++ src/Parser/Makefile.am	(revision 33d0afb28a622c243f2d109a7b9e6c210afd7512)
@@ -67,4 +67,6 @@
 	Parameters/Validators/DiscreteValidator.hpp \
 	Parameters/Validators/DiscreteValidator_impl.hpp \
+	Parameters/Validators/Ops_Validator.hpp \
+	Parameters/Validators/Ops_Validator_impl.hpp \
 	Parameters/Validators/RangeValidator.hpp \
 	Parameters/Validators/RangeValidator_impl.hpp \
