// Operators pub enum BinaryOperator { Plus, Minus, Multiplication, Division, Modulo, Power, } pub enum ComparisonOperator { GreaterThan, LessThan, LessEqual, GreaterEqual, NotEqual, Equal, } pub enum UnaryOperator { AbsoluteValue, Minus, } // Primitives pub struct FunctionDeclaration { pub name: String, pub arity: usize, } pub struct PredicateDeclaration { pub name: String, pub arity: usize, } pub struct VariableDeclaration { pub name: String, } // Terms pub struct BinaryOperation { pub operator: BinaryOperator, pub left: Box, pub right: Box, } pub struct Function { pub declaration: std::rc::Rc, pub arguments: Vec>, } pub struct Interval { pub from: Box, pub to: Box, } pub enum SpecialInteger { Infimum, Supremum, } pub struct UnaryOperation { pub operator: UnaryOperator, pub argument: Box, } pub struct Variable { pub declaration: std::rc::Rc, } // Formulas pub struct Biconditional { pub left: Box, pub right: Box, } pub struct Comparison { pub operator: ComparisonOperator, pub left: Box, pub right: Box, } pub struct Exists { pub parameters: Vec>, pub argument: Box, } pub struct ForAll { pub parameters: Vec>, pub argument: Box, } pub struct Implies { pub left: Box, pub right: Box, } pub struct Predicate { pub declaration: std::rc::Rc, pub arguments: Vec>, } // Variants pub enum Term { BinaryOperation(BinaryOperation), Boolean(bool), Function(Function), Integer(i32), Interval(Interval), SpecialInteger(SpecialInteger), String(String), UnaryOperation(UnaryOperation), Variable(Variable), } pub type Terms = Vec>; pub enum Formula { And(Formulas), Biconditional(Biconditional), Boolean(bool), Comparison(Comparison), Exists(Exists), ForAll(ForAll), Implies(Implies), Not(Box), Or(Formulas), Predicate(Predicate), } pub type Formulas = Vec>;