PerceMon
primitives.hpp
1#pragma once
2
3#ifndef __PERCEMON_AST_PRIMITIVES_HPP__
4#define __PERCEMON_AST_PRIMITIVES_HPP__
5
6#include <exception>
7#include <memory>
8#include <optional>
9#include <string>
10#include <variant>
11
12namespace percemon::ast::primitives {
13
14// Some basic primitives
15
16enum class ComparisonOp { GT, GE, LT, LE, EQ, NE };
17
21struct Const {
22 bool value = false;
23
24 Const(bool value_) : value{value_} {};
25
26 inline bool operator==(const Const& other) const {
27 return this->value == other.value;
28 };
29
30 inline bool operator!=(const Const& other) const { return !(*this == other); };
31};
32
36struct C_TIME {};
40struct C_FRAME {};
41
45struct Var_f {
46 std::string name;
47
48 Var_f(std::string name_) : name{std::move(name_)} {}
49
50 inline bool operator==(const Var_f& other) const { return name == other.name; };
51
52 inline bool operator!=(const Var_f& other) const { return !(*this == other); };
53};
54
58struct Var_x {
59 std::string name;
60
61 Var_x(std::string name_) : name{std::move(name_)} {}
62
63 inline bool operator==(const Var_x& other) const { return name == other.name; };
64
65 inline bool operator!=(const Var_x& other) const { return !(*this == other); };
66};
67
71struct Var_id {
72 std::string name;
73
74 Var_id(std::string name_) : name{std::move(name_)} {}
75};
76
77// Spatial primitives.
78
79struct EmptySet {};
80struct UniverseSet {};
81
82// Topological identifiers.
83
84enum struct CRT { LM, RM, TM, BM, CT };
85
86} // namespace percemon::ast::primitives
87
88#endif /* end of include guard: __PERCEMON_AST_PRIMITIVES_HPP__ */
Definition: primitives.hpp:40
Definition: primitives.hpp:36
Definition: primitives.hpp:21
Definition: primitives.hpp:79
Definition: primitives.hpp:80
Definition: primitives.hpp:45
Definition: primitives.hpp:71
Definition: primitives.hpp:58