Adiar 2.1.0
An External Memory Decision Diagram Library
Loading...
Searching...
No Matches
bool_op.h
1#ifndef ADIAR_BOOL_OP_H
2#define ADIAR_BOOL_OP_H
3
4#include <adiar/functional.h>
5
6#include <adiar/internal/data_types/ptr.h>
7#include <adiar/internal/data_types/uid.h>
8
9namespace adiar
10{
14 const predicate<bool, bool> and_op = [](const bool a, const bool b) -> bool { return a & b; };
15
19 const predicate<bool, bool> nand_op = [](const bool a, const bool b) -> bool { return !(a & b); };
20
24 const predicate<bool, bool> or_op = [](const bool a, const bool b) -> bool { return a | b; };
25
29 const predicate<bool, bool> nor_op = [](const bool a, const bool b) -> bool { return !(a | b); };
30
34 const predicate<bool, bool> xor_op = [](const bool a, const bool b) -> bool { return a ^ b; };
35
39 const predicate<bool, bool> xnor_op = [](const bool a, const bool b) -> bool { return a == b; };
40
44 const predicate<bool, bool> imp_op = [](const bool a, const bool b) -> bool { return a <= b; };
45
49 const predicate<bool, bool> invimp_op = [](const bool a, const bool b) -> bool { return b <= a; };
50
55
59 const predicate<bool, bool> diff_op = [](const bool a, const bool b) -> bool {
60 // Alternatively: a > b
61 return a & !b;
62 };
63
67 const predicate<bool, bool> less_op = [](const bool a, const bool b) -> bool { return a < b; };
68}
69
70#endif // ADIAR_BOOL_H
function< bool(Args...)> predicate
Predicate function given value(s) of type(s) Args.
Definition functional.h:48
consumer< ValueType > make_consumer(OutputIt &iter)
Wrap an iterator into a consumer function.
Definition functional.h:67
Core types.
Definition adiar.h:40
const predicate< bool, bool > imp_op
Logical 'implication' operator, i.e. the truth table: [1,0,1,1].
Definition bool_op.h:44
const predicate< bool, bool > less_op
Logical 'less' operator, i.e. the truth table [0,0,1,0].
Definition bool_op.h:67
const predicate< bool, bool > xnor_op
Logical 'xor' operator, i.e. the truth table: [1,0,0,1].
Definition bool_op.h:39
const predicate< bool, bool > or_op
Logical 'or' operator, i.e. the truth table: [1,1,1,0].
Definition bool_op.h:24
const predicate< bool, bool > and_op
Logical 'and' operator, i.e. the truth table: [1,0,0,0].
Definition bool_op.h:14
const predicate< bool, bool > invimp_op
Logical 'implication' operator, i.e. the truth table: [1,1,0,1].
Definition bool_op.h:49
const predicate< bool, bool > diff_op
Logical 'set difference' operator, i.e. the truth table [0,1,0,0].
Definition bool_op.h:59
const predicate< bool, bool > nor_op
Logical 'not or' operator, i.e. the truth table: [0,0,0,1].
Definition bool_op.h:29
const predicate< bool, bool > nand_op
Logical 'not and' operator, i.e. the truth table: [0,1,1,1].
Definition bool_op.h:19
const predicate< bool, bool > equiv_op
Logical 'equivalence' operator, i.e. the 'xnor' operator.
Definition bool_op.h:54
const predicate< bool, bool > xor_op
Logical 'xor' operator, i.e. the truth table: [0,1,1,0].
Definition bool_op.h:34