-
Notifications
You must be signed in to change notification settings - Fork 0
/
formula.hh
1141 lines (940 loc) · 23.4 KB
/
formula.hh
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef LOGICAL_FORMULA_HH
#define LOGICAL_FORMULA_HH
#include "errors.hh"
#include "expression.hh"
#include "logical.hh"
#include <iostream>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
namespace Logical
{
using std::cout;
using std::endl;
using std::forward;
using std::hex;
using std::move;
using std::ostream;
using std::string_view;
using std::vector;
using std::optional;
using std::addressof;
using std::nullptr_t;
class Symbol;
class Formula;
class Symbol
{
private:
string_view value;
bool rel, quant;
protected:
constexpr Symbol(const string_view& s, bool r, bool q)
: value(s)
, rel(r)
, quant(q)
{
}
public:
template <typename... Args>
Formula operator()(Args&&... args) const;
void operator=(const Symbol&) = delete;
void print(ostream& out) const;
const string_view& get_value(void) const;
constexpr uint64_t hash(uint64_t seed = 0) const;
constexpr operator uint64_t(void) const;
bool operator==(const Symbol& that) const
{
return this == &that || (rel == that.rel && quant == that.quant && value == that.value);
}
bool operator!=(const Symbol& that) const
{
return !((*this) == that);
}
bool is_relation(void) const
{
return rel;
}
bool is_quantifier(void) const
{
return quant;
}
};
class ConnectiveSymbol : public Symbol
{
public:
constexpr ConnectiveSymbol(const string_view& s)
: Symbol(s, false, false)
{
}
template <typename... Args>
Formula operator()(Args&&... args) const;
};
class QuantifierSymbol : public Symbol
{
public:
constexpr QuantifierSymbol(const string_view& s)
: Symbol(s, false, true)
{
}
template <typename VariableT>
class QuantifierApplication
{
private:
VariableT variable;
const Symbol& symbol;
public:
QuantifierApplication(VariableT&& v, const Symbol& s)
: variable(forward<VariableT>(v))
, symbol(s)
{
}
template <typename... Args>
Formula operator()(Args&&... args);
};
template <typename VariableT>
auto operator[](VariableT&& var) const
{
return QuantifierApplication<VariableT>(forward<VariableT>(var), *this);
}
};
class RelationSymbol : public Symbol
{
public:
constexpr RelationSymbol(const string_view& s)
: Symbol(s, true, false)
{
}
template <typename... Args>
Formula operator()(Args&&... args) const;
};
struct SymbolHash
{
constexpr SymbolHash(void)
{
}
uint64_t operator()(const Symbol& s) const
{
return s.hash();
}
};
class Formula
{
#ifdef DEBUG
public:
static mutex active_objects_mutex;
static unordered_set<const Formula*> active_objects;
static bool is_valid_object(const Formula* f)
{
return active_objects.count(f);
}
#endif
private:
const Symbol& symbol;
union
{
vector<Formula> formula;
vector<ExpressionReference> expression;
};
unique_ptr<const Variable> variable;
public:
class FormulaOrExpression
{
private:
union
{
const Formula* formula;
const Expression* expression;
};
bool relation;
public:
typedef FormulaOrExpression value_type;
FormulaOrExpression(const Formula& f)
: formula(&f)
, relation(false)
{
}
FormulaOrExpression(const Expression& e)
: expression(&e)
, relation(true)
{
}
FormulaOrExpression(const FormulaOrExpression& fe)
: relation(fe.relation)
{
if(relation)
new(&expression) auto(fe.expression);
else
new(&formula) auto(fe.formula);
}
FormulaOrExpression(FormulaOrExpression&& fe)
: relation(move(fe.relation))
{
if(relation)
new(&expression) auto(move(fe.expression));
else
new(&formula) auto(move(fe.formula));
}
operator const Formula&(void)const
{
if(relation)
throw RuntimeError("Requesting formula field when the symbol is a relation.");
else
return *formula;
}
operator const Expression&(void)const
{
if(relation)
return *expression;
else
throw RuntimeError("Requesting expression field when the symbol is not a relation.");
}
const void* operator&(void)const
{
if(relation)
return expression;
else
return formula;
}
FormulaOrExpression operator[](size_t index)
{
if(relation)
return expression[index];
else
return formula[index];
}
};
typedef FormulaOrExpression value_type;
Formula(const Formula& f)
: symbol(f.symbol)
{
if(f.variable)
throw RuntimeError("Not implemented yet."); // TODO
if(symbol.is_relation())
new(&expression) auto(f.expression);
else
new(&formula) auto(f.formula);
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
//cerr << " Formula copy " << this << " from " << (const Formula*)(&f) << endl;
active_objects.insert(this);
}
#endif
}
Formula(Formula&& f)
: symbol(move(f.symbol))
, variable(move(f.variable))
{
if(symbol.is_relation())
new(&expression) auto(move(f.expression));
else
new(&formula) auto(move(f.formula));
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
//cerr << " Formula move " << this << " from " << (const Formula*)(&f) << endl;
active_objects.insert(this);
}
#endif
}
template <typename FormulaVector, typename VariableT>
Formula(const Symbol& s, FormulaVector&& f, VariableT&& v)
: symbol(s)
, formula(forward<FormulaVector>(f))
, variable(make_unique<typename remove_reference<VariableT>::type>(forward<VariableT>(v)))
{
logical_assert(!s.is_relation());
logical_assert(s.is_quantifier());
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
//cerr << " Formula create (quantifier) " << this << endl;
active_objects.insert(this);
}
#endif
}
Formula(const Symbol& s, const vector<Formula>& f)
: symbol(s)
, formula(f)
{
logical_assert(!s.is_relation());
logical_assert(!s.is_quantifier());
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
//cerr << " Formula create (connective, copy vector) " << this << endl;
active_objects.insert(this);
}
#endif
}
Formula(const Symbol& s, vector<Formula>&& f)
: symbol(s)
, formula(move(f))
{
logical_assert(!s.is_relation());
logical_assert(!s.is_quantifier());
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
//cerr << " Formula create (connective, move vector) " << this << endl;
active_objects.insert(this);
}
#endif
}
Formula(const Symbol& s, const vector<ExpressionReference>& e)
: symbol(s)
, expression(e)
{
logical_assert(s.is_relation());
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
//cerr << " Formula create (relation, copy vector) " << this << endl;
active_objects.insert(this);
}
#endif
}
Formula(const Symbol& s, vector<ExpressionReference>&& e)
: symbol(s)
, expression(move(e))
{
logical_assert(s.is_relation());
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
//cerr << " Formula create (relation, move vector) " << this << endl;
active_objects.insert(this);
}
#endif
}
bool is_ground(void) const
{
if(variable)
{
if(symbol.is_relation())
{
for(const auto& e : expression)
if(!e.is_ground())
{
const auto evf = e.free_variables();
if(evf.size() - evf.count(*variable))
return false;
}
}
else
{
for(const auto& f : formula)
if(!f.is_ground())
{
const auto fvf = f.free_variables();
if(fvf.size() - fvf.count(*variable))
return false;
}
}
}
else
{
if(symbol.is_relation())
{
for(const auto& e : expression)
if(!e.is_ground())
return false;
}
else
{
for(const auto& f : formula)
if(!f.is_ground())
return false;
}
}
return true;
}
VariableSet free_variables(void) const
{
VariableSet vars;
if(symbol.is_relation())
{
for(const auto& e : expression)
vars.merge(e.free_variables());
}
else
{
for(const auto& f : formula)
vars.merge(f.free_variables());
}
return vars;
}
void print(ostream& out) const;
uint64_t hash(uint64_t seed = 0) const
{
seed ^= symbol.hash(seed);
if(symbol.is_relation())
{
for(const auto& e : expression)
seed ^= e.hash(seed + 3);
}
else
{
for(const auto& f : formula)
seed ^= f.hash(seed);
}
return seed;
}
bool operator==(const Formula& that) const
{
static const auto expressions_identical = ExpressionsIdentical();
#if defined(DEBUG) && !defined(__clang__)
if(!this)
throw RuntimeError("'this' pointer is null");
if(!&that)
throw RuntimeError("'&that' pointer is null");
#endif
if(this == &that)
return true;
if(symbol != that.symbol)
return false;
if(symbol.is_relation())
{
if(expression.size() != that.expression.size())
return false;
for(size_t i = 0; i < expression.size(); i++)
if(!expressions_identical(expression[i], that.expression[i]))
return false;
return true;
}
else
return formula == that.formula;
}
bool operator!=(const Formula& that) const
{
return !((*this) == that);
}
const Symbol& get_symbol(void) const
{
return symbol;
}
bool has_symbol(const Symbol& s) const
{
return s == symbol;
}
template <typename Symbols>
bool has_symbols(const Symbols& ss)
{
for(const Symbol& s : ss)
if(s == symbol)
return true;
return false;
}
size_t size(void) const
{
if(symbol.is_relation())
return expression.size();
else
return formula.size();
}
FormulaOrExpression operator[](const size_t index) const
{
if(symbol.is_relation())
{
if(index >= expression.size())
throw FormulaIndexError("Sub-expression index out of range.", index, expression.size(), *this);
return expression[index];
}
else
{
if(index >= formula.size())
throw FormulaIndexError("Sub-formula index out of range.", index, formula.size(), *this);
return formula[index];
}
}
auto begin(void) const
{
if(symbol.is_relation())
throw RuntimeError("Iterating over expression not implemented yet.");
return formula.begin();
} // TODO
auto end(void) const
{
if(symbol.is_relation())
throw RuntimeError("Iterating over expression not implemented yet.");
return formula.end();
} // TODO
size_t total_size(void) const;
size_t depth(void) const
{
if(symbol.is_relation())
return 1;
size_t d = 0;
for(const auto& f : formula)
{
const size_t nd = f.depth();
if(nd > d)
d = nd;
}
return d + 1;
}
// template<FormulaRF> Formula operator / (FormulaRF&& d) const;
template <typename FormulaRF>
Formula operator%(FormulaRF&&) const;
template <typename FormulaRF>
Formula operator<<(FormulaRF&&) const;
template <typename FormulaRF>
Formula operator>>(FormulaRF&&) const;
Formula operator~(void) const;
template <typename FormulaRF>
Formula operator&(FormulaRF&&) &&;
template <typename FormulaRF>
Formula operator|(FormulaRF&&) const;
template <typename FormulaRF>
Formula operator^(FormulaRF&&) const;
// virtual Formula substitute(const unordered_map<Expression, Expression>&) const;
#ifdef DEBUG
class TracingPointer
{
private:
const Formula* target;
public:
TracingPointer(const Formula& t)
: target(addressof(t))
{
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.insert(this);
}
}
TracingPointer(nullptr_t zero)
: target(nullptr)
{
}
TracingPointer(const TracingPointer& cp)
: target(cp.target)
{
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.insert(this);
}
}
TracingPointer(TracingPointer&& mv)
: target(move(mv.target))
{
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.insert(this);
target->tracing_pointers.erase(&mv);
}
}
operator const Formula* (void) const
{
return target;
}
const Formula& operator * (void) const
{
if(!target) throw NullPointerError("Dereferencing null TracingPointer.");
return *target;
}
const Formula* operator -> (void) const
{
if(!target) throw NullPointerError("Accessing member of null TracingPointer.");
return target;
}
operator bool (void) const
{
return target;
}
bool operator == (const TracingPointer& other) const
{
return target == other.target;
}
bool operator != (const TracingPointer& other) const
{
return target != other.target;
}
bool operator <= (const TracingPointer& other) const
{
return target <= other.target;
}
bool operator > (const TracingPointer& other) const
{
return target > other.target;
}
bool operator >= (const TracingPointer& other) const
{
return target >= other.target;
}
bool operator < (const TracingPointer& other) const
{
return target < other.target;
}
TracingPointer& operator = (const TracingPointer& other)
{
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.erase(this);
}
target = other.target;
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.insert(this);
}
return *this;
}
TracingPointer& operator = (TracingPointer&& other)
{
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.erase(this);
}
target = other.target;
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.insert(this);
target->tracing_pointers.erase(&other);
other.target = nullptr;
}
return *this;
}
TracingPointer& operator = (nullptr_t zero)
{
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.erase(this);
}
target = nullptr;
return *this;
}
~TracingPointer(void)
{
if(target)
{
lock_guard<mutex> lg(target->tracing_pointers_mutex);
target->tracing_pointers.erase(this);
}
}
};
mutable mutex tracing_pointers_mutex;
mutable unordered_set<const TracingPointer*> tracing_pointers;
TracingPointer operator& (void) const
{
return TracingPointer(*this);
}
#endif
~Formula(void)
{
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
if(active_objects.count(this) != 1)
{
//cerr << " ~Formula error " << this << endl;
abort();
}
else
;//cerr << " ~Formula destroy " << this << endl;
active_objects.erase(this);
}
{
lock_guard<mutex> lg(tracing_pointers_mutex);
logical_assert(tracing_pointers.empty());
}
#endif
if(symbol.is_relation())
expression.~vector<ExpressionReference>();
else
formula.~vector<Formula>();
}
};
class CompoundFormula : public Formula
{
public:
typedef Formula value_type;
const Formula& operator[](const size_t index) const
{
return Formula::operator[](index);
}
};
class AtomicFormula : public Formula
{
public:
typedef Expression value_type;
const Expression& operator[](const size_t index) const
{
return Formula::operator[](index);
}
};
inline ostream& operator<<(ostream& stream, const Formula& f)
{
f.print(stream);
return stream;
}
inline ostream& operator<<(ostream& stream, const Symbol& s)
{
s.print(stream);
return stream;
}
template <typename... Args>
inline Formula ConnectiveSymbol::operator()(Args&&... args) const
{
return Formula(*this, vector<Formula>({forward<Args>(args)...}));
}
template <typename VariableT>
template <typename... Args>
inline Formula QuantifierSymbol::QuantifierApplication<VariableT>::operator()(Args&&... args)
{
return Formula(symbol, vector<Formula>({forward<Args>(args)...}), forward<VariableT>(variable));
}
template <typename... Args>
inline Formula RelationSymbol::operator()(Args&&... args) const
{
return Formula(*this, vector<ExpressionReference>({forward<Args>(args)...}));
}
inline constexpr uint64_t Symbol::hash(uint64_t seed) const
{
seed += rel * 109 + quant * 113 + 37;
for(char c : value)
seed = (257 * seed + (unsigned char)c + 13) ^ (seed >> (64 - 8));
return seed;
}
inline constexpr Symbol::operator uint64_t(void) const
{
return hash(0x38a10a1c);
}
inline void Symbol::print(ostream& out) const
{
out << value;
}
inline void Formula::print(ostream& out) const
{
#ifdef DEBUG
logical_assert(is_valid_object(this));
#endif
out << symbol;
out << "(";
bool first = true;
for(auto& f : formula) // FIXME
{
if(first)
first = false;
else
out << ",";
out << f;
}
out << ")";
}
inline size_t Formula::total_size(void) const
{
#ifdef DEBUG
{
lock_guard<mutex> lg(active_objects_mutex);
logical_assert(active_objects.count(this) == 1);
}
/*{
static mutex total_size_mutex;
lock_guard<mutex> lg(total_size_mutex);
cerr << hex << "total_size this=" << this << " symbol=" << &symbol << "/" << symbol << endl;
}*/
#endif
size_t s = 1;
if(symbol.is_relation())
{
return expression.size();
}
else
{
for(const auto& f : formula)
s += f.total_size();
}
return s;
}
constexpr auto Id = ConnectiveSymbol("");
constexpr auto Not = ConnectiveSymbol("~");
constexpr auto And = ConnectiveSymbol("∧");
constexpr auto Or = ConnectiveSymbol("∨");
constexpr auto NAnd = ConnectiveSymbol("⊼");
constexpr auto NOr = ConnectiveSymbol("⊽");
constexpr auto Xor = ConnectiveSymbol("⊻");
constexpr auto NXor = ConnectiveSymbol("⩝");
constexpr auto Equiv = ConnectiveSymbol("↔");
constexpr auto NEquiv = ConnectiveSymbol("↮");
constexpr auto Impl = ConnectiveSymbol("→");
constexpr auto NImpl = ConnectiveSymbol("↛");
constexpr auto RImpl = ConnectiveSymbol("←");
constexpr auto NRImpl = ConnectiveSymbol("↚");
constexpr auto ForAll = QuantifierSymbol("∀");
constexpr auto Exists = QuantifierSymbol("∃");
// constexpr auto Unique = QuantifierSymbol("∃!");
constexpr auto True = ConnectiveSymbol("⊤");
constexpr auto False = ConnectiveSymbol("⊥");
constexpr auto Ident = RelationSymbol("≡");
constexpr auto NIdent = RelationSymbol("≢");
constexpr auto Equal = RelationSymbol("=");
constexpr auto NEqual = RelationSymbol("≠");
constexpr auto Pred = RelationSymbol("≺");
constexpr auto Succ = RelationSymbol("≻");
constexpr auto EPred = RelationSymbol("≼");
constexpr auto ESucc = RelationSymbol("≽");
constexpr auto NPred = RelationSymbol("⊀");
constexpr auto NSucc = RelationSymbol("⊁");
template <typename FormulaRF>
inline Formula Formula::operator%(FormulaRF&& that) const
{
return Equiv(*this, forward<FormulaRF>(that));
}
template <typename FormulaRF>
inline Formula Formula::operator<<(FormulaRF&& that) const
{
return Impl(*this, forward<FormulaRF>(that));
}
template <typename FormulaRF>
inline Formula Formula::operator>>(FormulaRF&& that) const
{
return RImpl(*this, forward<FormulaRF>(that));
}
inline Formula Formula::operator~(void) const
{
return Not(*this);
}
template <typename FormulaRF>
inline Formula Formula::operator&(FormulaRF&& that) &&
{
return And(move(*this), forward<FormulaRF>(that));
}
template <typename FormulaRF>
inline Formula Formula::operator|(FormulaRF&& that) const
{
return Or(*this, forward<FormulaRF>(that));
}
template <typename FormulaRF>
inline Formula Formula::operator^(FormulaRF&& that) const
{
return Xor(*this, forward<FormulaRF>(that));
}
/*
constexpr auto Everyone = ConnectiveSymbol("◻");
constexpr auto Someone = ConnectiveSymbol("◇");
constexpr auto WillAlways = ConnectiveSymbol("⟥");
constexpr auto WillOnce = ConnectiveSymbol("⟣");
constexpr auto WasAlways = ConnectiveSymbol("⟤");
constexpr auto WasOnce = ConnectiveSymbol("⟢");
constexpr auto Id = Symbol("⍳");
constexpr auto Assert = Symbol("⇶");
constexpr auto Dissert = Symbol("↯");
constexpr auto Lesser = Symbol("<");
constexpr auto NLesser = Symbol("≥");
constexpr auto Greater = Symbol(">");
constexpr auto NGreater = Symbol("≤");
constexpr auto Member = Symbol("∈");