libprop_sat_solver/formula/
operators.rs

1//! Unary and binary operators for propositional formulas.
2
3/// There are two types of operators in propositional formulas:
4/// 1. `UnaryOperator`: arity 1.
5/// 2. `BinaryOperator`: arity 2.
6#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)]
7pub enum Operator {
8    Unary(UnaryOperator),
9    Binary(BinaryOperator),
10}
11
12/// There is only one basic unary operator, the negation (logical NOT) operator.
13#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)]
14pub enum UnaryOperator {
15    Negation,
16}
17
18/// There are four basic binary operators:
19/// 1. Logical AND.
20/// 2. Logical OR.
21/// 3. Implication.
22/// 4. Biimplication.
23#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)]
24pub enum BinaryOperator {
25    And,
26    Or,
27    Implication,
28    Biimplication,
29}