-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatement.h
More file actions
97 lines (74 loc) · 2.76 KB
/
statement.h
File metadata and controls
97 lines (74 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#pragma once
#include <vector>
#include <memory>
#include <print>
#include "id.h"
using std::shared_ptr;
using std::vector;
struct Proof;
struct Expression;
struct Statement {
virtual void print(unsigned int indentLevel) const = 0;
virtual ~Statement() = default;
};
struct Statement_Block final : Statement {
vector<shared_ptr<const Statement>> statements;
constexpr Statement_Block(vector<shared_ptr<const Statement>>&& _statements):
statements(std::move(_statements)) { }
void print(unsigned int indentLevel) const override;
~Statement_Block() override = default;
};
struct Statement_Print final : Statement {
shared_ptr<const Proof> proof;
constexpr Statement_Print(shared_ptr<const Proof>&& _proof):
proof(std::move(_proof)) { }
void print(unsigned int indentLevel) const override;
~Statement_Print() override = default;
};
struct Statement_ForAny final : Statement {
vector<Id> varIds;
constexpr Statement_ForAny(vector<Id>&& _varIds):
varIds(std::move(_varIds)) { }
void print(unsigned int indentLevel) const override;
~Statement_ForAny() override = default;
};
struct Statement_Assume final : Statement {
Id id;
shared_ptr<const Expression> assumedProposition;
constexpr Statement_Assume(Id _id, shared_ptr<const Expression>&& _assumedProposition):
id(_id), assumedProposition(std::move(_assumedProposition)) { }
void print(unsigned int indentLevel) const override;
~Statement_Assume() override = default;
};
struct Statement_Require final : Statement {
Id id;
shared_ptr<const Expression> requiredProposition;
shared_ptr<const Proof> proof;
constexpr Statement_Require(Id _id, shared_ptr<const Expression>&& _requiredProposition, shared_ptr<const Proof>&& _proof):
id(_id), requiredProposition(std::move(_requiredProposition)), proof(std::move(_proof)) { }
void print(unsigned int indentLevel) const override;
~Statement_Require() override = default;
};
struct Statement_Define final : Statement {
Id defId;
vector<Id> varIds;
shared_ptr<const Expression> rhs;
constexpr Statement_Define(Id _defId, vector<Id>&& _varIds, shared_ptr<const Expression> _rhs):
defId(_defId), varIds(std::move(_varIds)), rhs(std::move(_rhs)) { }
void print(unsigned int indentLevel) const override;
~Statement_Define() override = default;
};
struct Statement_Atoms final : Statement {
vector<Id> atomIds;
constexpr Statement_Atoms(vector<Id>&& _atomIds):
atomIds(std::move(_atomIds)) { }
void print(unsigned int indentLevel) const override;
~Statement_Atoms() override = default;
};
struct Statement_MustError final : Statement {
shared_ptr<const Proof> proof;
constexpr Statement_MustError(shared_ptr<const Proof>&& _proof):
proof(std::move(_proof)) { }
void print(unsigned int indentLevel) const override;
~Statement_MustError() override = default;
};