Skip to content

Commit f30e11b

Browse files
committed
Stub out sort contains relation
1 parent 7f79ebd commit f30e11b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

include/kllvm/ast/AST.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ class KOREDefinition {
938938
SubsortMap subsorts;
939939
SubsortMap supersorts;
940940
SymbolMap overloads;
941+
SubsortMap sortContains;
941942

942943
std::vector<sptr<KOREModule>> modules;
943944
std::unordered_map<std::string, sptr<KORECompositePattern>> attributes;
@@ -961,6 +962,7 @@ class KOREDefinition {
961962

962963
void buildSubsortRelation();
963964
void buildOverloadRelation();
965+
void buildSortContainsRelation();
964966

965967
public:
966968
/*
@@ -1029,6 +1031,23 @@ class KOREDefinition {
10291031
*/
10301032
SymbolMap getOverloads() const { return overloads; }
10311033

1034+
/*
1035+
* Return a relation specifying the set of sorts that may syntactically occur
1036+
* as children of another sort. For example, given symbols:
1037+
*
1038+
* c(S_1, ..., S_N) : S_R
1039+
* c(T_1, ..., T_N) : S_R
1040+
*
1041+
* The relation will contain an entry:
1042+
*
1043+
* S_R |-> { S_1, S'_1, ..., S_N, T_1, ..., T_N }
1044+
*
1045+
* where S'_1 is a _subsort_ of S_1 (that is, given that the first argument of
1046+
* `c` is of sort S_1, a term whose sort is a subsort of S_1 may also occur in
1047+
* the first argument position).
1048+
*/
1049+
SubsortMap getSortContains() const { return sortContains; }
1050+
10321051
std::vector<sptr<KOREModule>> const &getModules() const { return modules; }
10331052
KORECompositeSortDeclarationMapType const &getSortDeclarations() const {
10341053
return sortDeclarations;

lib/ast/definition.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ptr<KOREDefinition> KOREDefinition::load(std::string const &filename) {
1717
void KOREDefinition::precompute() {
1818
buildSubsortRelation();
1919
buildOverloadRelation();
20+
buildSortContainsRelation();
2021
}
2122

2223
std::unordered_set<std::string>
@@ -103,6 +104,8 @@ void KOREDefinition::buildOverloadRelation() {
103104
overloads = transitive_closure(overloads);
104105
}
105106

107+
void KOREDefinition::buildSortContainsRelation() { }
108+
106109
// NOLINTNEXTLINE(*-function-cognitive-complexity)
107110
void KOREDefinition::preprocess() {
108111
insertReservedSymbols();

0 commit comments

Comments
 (0)