Skip to content
Snippets Groups Projects
nor.h 931 B
Newer Older
#ifndef LIBWCCL_OPS_NOR_H
#define LIBWCCL_OPS_NOR_H

#include <boost/foreach.hpp>
#define foreach         BOOST_FOREACH

#include <libwccl/ops/logicalpredicate.h>

namespace Wccl {

/**
 * Operator that realises logical predicate "nor",
 * (note: the operator is called "not" in CCL)
 */
class Nor : public LogicalPredicate
{
public:
	Nor(const boost::shared_ptr<BoolFunctionPtrVector>& expressions)
		: LogicalPredicate(expressions)
	{
	}

protected :
	typedef FunctionBase::BaseRetValPtr BaseRetValPtr ;

	/**
	 * "Nor" (aka "not") predicate evaluates expressions one by one in order
     * from left to right, and False is returned once an expression evaluating
     * to True is found.
	 * If all of the expressions were False, True is returned.
	 */
	virtual BaseRetValPtr apply_internal(const SentenceContext&) const;

	virtual const std::string raw_operator_name() const;
};

} /* end ns Wccl */
#endif // LIBWCCL_OPS_NOR_H