6 #ifndef SYMENGINE_LOGIC_H
7 #define SYMENGINE_LOGIC_H
21 virtual RCP<const Boolean> logical_not()
const;
40 RCP<const Boolean> logical_not()
const override;
43 extern SYMENGINE_EXPORT RCP<const BooleanAtom> &boolTrue;
44 extern SYMENGINE_EXPORT RCP<const BooleanAtom> &boolFalse;
46 inline RCP<const BooleanAtom> boolean(
bool b)
48 return b ? boolTrue : boolFalse;
56 RCP<const Basic> expr_;
62 Contains(
const RCP<const Basic> &expr,
const RCP<const Set> &set);
64 RCP<const Basic> get_expr()
const;
65 RCP<const Set> get_set()
const;
68 RCP<const Basic> create(
const RCP<const Basic> &lhs,
69 const RCP<const Set> &rhs)
const;
74 RCP<const Boolean> contains(
const RCP<const Basic> &expr,
75 const RCP<const Set> &set);
116 RCP<const Basic> create(
const set_boolean &a)
const;
121 RCP<const Boolean> logical_not()
const override;
140 RCP<const Boolean> logical_not()
const override;
146 RCP<const Boolean> arg_;
150 Not(
const RCP<const Boolean> &s);
151 bool is_canonical(
const RCP<const Boolean> &s);
158 RCP<const Boolean> get_arg()
const;
159 RCP<const Boolean> logical_not()
const override;
182 Relational(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
185 const RCP<const Basic> &rhs)
const;
193 Equality(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
194 RCP<const Basic>
create(
const RCP<const Basic> &lhs,
195 const RCP<const Basic> &rhs)
const override;
196 RCP<const Boolean> logical_not()
const override;
204 Unequality(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
205 RCP<const Basic>
create(
const RCP<const Basic> &lhs,
206 const RCP<const Basic> &rhs)
const override;
207 RCP<const Boolean> logical_not()
const override;
215 LessThan(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
216 RCP<const Basic>
create(
const RCP<const Basic> &lhs,
217 const RCP<const Basic> &rhs)
const override;
218 RCP<const Boolean> logical_not()
const override;
226 StrictLessThan(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
227 RCP<const Basic>
create(
const RCP<const Basic> &lhs,
228 const RCP<const Basic> &rhs)
const override;
229 RCP<const Boolean> logical_not()
const override;
232 inline bool is_a_Relational(
const Basic &b)
234 return (b.get_type_code() == SYMENGINE_EQUALITY
235 || b.get_type_code() == SYMENGINE_UNEQUALITY
236 || b.get_type_code() == SYMENGINE_LESSTHAN
237 || b.get_type_code() == SYMENGINE_STRICTLESSTHAN);
240 inline bool is_a_Boolean(
const Basic &b)
242 return (b.get_type_code() == SYMENGINE_BOOLEAN_ATOM
243 || b.get_type_code() == SYMENGINE_CONTAINS
244 || b.get_type_code() == SYMENGINE_AND
245 || b.get_type_code() == SYMENGINE_OR
246 || b.get_type_code() == SYMENGINE_NOT
247 || b.get_type_code() == SYMENGINE_XOR || is_a_Relational(b));
251 RCP<const Boolean>
Eq(
const RCP<const Basic> &lhs);
253 RCP<const Boolean>
Eq(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
255 RCP<const Boolean>
Ne(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
257 RCP<const Boolean>
Ge(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
259 RCP<const Boolean>
Gt(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
261 RCP<const Boolean>
Le(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
263 RCP<const Boolean>
Lt(
const RCP<const Basic> &lhs,
const RCP<const Basic> &rhs);
265 RCP<const Boolean> logical_and(
const set_boolean &s);
266 RCP<const Boolean> logical_nand(
const set_boolean &s);
267 RCP<const Boolean> logical_or(
const set_boolean &s);
268 RCP<const Boolean> logical_not(
const RCP<const Boolean> &s);
269 RCP<const Boolean> logical_nor(
const set_boolean &s);
270 RCP<const Boolean> logical_xor(
const vec_boolean &s);
271 RCP<const Boolean> logical_xnor(
const vec_boolean &s);
The base class for SymEngine.
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
hash_t __hash__() const override
bool __eq__(const Basic &o) const override
Test equality.
int compare(const Basic &o) const override
Structural equality comparator.
vec_basic get_args() const override
Returns the list of arguments.
The lowest unit of symbolic representation.
vec_basic get_args() const override
Returns the list of arguments.
hash_t __hash__() const override
bool __eq__(const Basic &o) const override
Test equality.
int compare(const Basic &o) const override
Structural equality comparator.
bool __eq__(const Basic &o) const override
Test equality.
int compare(const Basic &o) const override
Structural equality comparator.
vec_basic get_args() const override
Returns the list of arguments.
hash_t __hash__() const override
Contains(const RCP< const Basic > &expr, const RCP< const Set > &set)
Constructor.
RCP< const Basic > create(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs) const override
Method to construct classes with canonicalization.
RCP< const Basic > create(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs) const override
Method to construct classes with canonicalization.
vec_basic get_args() const override
Returns the list of arguments.
int compare(const Basic &o) const override
Structural equality comparator.
hash_t __hash__() const override
bool __eq__(const Basic &o) const override
Test equality.
vec_basic get_args() const override
Returns the list of arguments.
hash_t __hash__() const override
bool __eq__(const Basic &o) const override
Test equality.
int compare(const Basic &o) const override
Structural equality comparator.
vec_basic get_args() const override
Returns the list of arguments.
Piecewise(PiecewiseVec &&vec)
Constructor.
bool __eq__(const Basic &o) const override
Test equality.
int compare(const Basic &o) const override
Structural equality comparator.
hash_t __hash__() const override
Relational(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs)
Constructor.
virtual bool is_canonical(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs) const
RCP< const Basic > create(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs) const override
Method to construct classes with canonicalization.
RCP< const Basic > create(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs) const override
Method to construct classes with canonicalization.
bool __eq__(const Basic &o) const override
Test equality.
hash_t __hash__() const override
int compare(const Basic &o) const override
vec_basic get_args() const override
Returns the list of arguments.
Main namespace for SymEngine package.
RCP< const Boolean > Ge(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs)
Convenience function returning LessThan object.
RCP< const Boolean > Lt(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs)
Returns the canonicalized StrictLessThan object from the arguments.
RCP< const Boolean > Le(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs)
Returns the canonicalized LessThan object from the arguments.
RCP< const Boolean > Eq(const RCP< const Basic > &lhs)
Returns the canonicalized Equality object from a single argument.
RCP< const Boolean > Gt(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs)
Convenience function returning StrictLessThan object.
RCP< const Boolean > Ne(const RCP< const Basic > &lhs, const RCP< const Basic > &rhs)
Returns the canonicalized Unequality object from the arguments.