Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::BooleanXorPropagator Class Reference

#include <cp_constraints.h>

Inheritance diagram for operations_research::sat::BooleanXorPropagator:
operations_research::sat::PropagatorInterface

Public Member Functions

 BooleanXorPropagator (const std::vector< Literal > &literals, bool value, Trail *trail, IntegerTrail *integer_trail)
 
 BooleanXorPropagator (const BooleanXorPropagator &)=delete
 This type is neither copyable nor movable.
 
BooleanXorPropagatoroperator= (const BooleanXorPropagator &)=delete
 
bool Propagate () final
 
void RegisterWith (GenericLiteralWatcher *watcher)
 
- Public Member Functions inherited from operations_research::sat::PropagatorInterface
 PropagatorInterface ()=default
 
virtual ~PropagatorInterface ()=default
 
virtual bool IncrementalPropagate (const std::vector< int > &)
 

Detailed Description

Propagate the fact that a XOR of literals is equal to the given value. The complexity is in O(n).

Todo
(user): By using a two watcher mechanism, we can propagate this a lot faster.

Definition at line 40 of file cp_constraints.h.

Constructor & Destructor Documentation

◆ BooleanXorPropagator() [1/2]

operations_research::sat::BooleanXorPropagator::BooleanXorPropagator ( const std::vector< Literal > & literals,
bool value,
Trail * trail,
IntegerTrail * integer_trail )
inline

Definition at line 42 of file cp_constraints.h.

◆ BooleanXorPropagator() [2/2]

operations_research::sat::BooleanXorPropagator::BooleanXorPropagator ( const BooleanXorPropagator & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ operator=()

BooleanXorPropagator & operations_research::sat::BooleanXorPropagator::operator= ( const BooleanXorPropagator & )
delete

◆ Propagate()

bool operations_research::sat::BooleanXorPropagator::Propagate ( )
finalvirtual

This will be called after one or more literals that are watched by this propagator changed. It will also always be called on the first propagation cycle after registration.

If we have more than one unassigned literal, we can't deduce anything.

Propagates?

Ok.

Conflict.

Implements operations_research::sat::PropagatorInterface.

Definition at line 28 of file cp_constraints.cc.

◆ RegisterWith()

void operations_research::sat::BooleanXorPropagator::RegisterWith ( GenericLiteralWatcher * watcher)

Definition at line 73 of file cp_constraints.cc.


The documentation for this class was generated from the following files: