Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlc4b
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlc4b
Commits
49a7214a
Commit
49a7214a
authored
11 months ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Rename STANDARD_MODULES enum to more usual spelling
parent
bb6cbc91
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tlc4b/analysis/UsedStandardModules.java
+109
-109
109 additions, 109 deletions
src/main/java/de/tlc4b/analysis/UsedStandardModules.java
with
109 additions
and
109 deletions
src/main/java/de/tlc4b/analysis/UsedStandardModules.java
+
109
−
109
View file @
49a7214a
...
@@ -104,27 +104,27 @@ import de.tlc4b.btypes.SetType;
...
@@ -104,27 +104,27 @@ import de.tlc4b.btypes.SetType;
import
de.tlc4b.tla.TLAModule
;
import
de.tlc4b.tla.TLAModule
;
public
class
UsedStandardModules
extends
DepthFirstAdapter
{
public
class
UsedStandardModules
extends
DepthFirstAdapter
{
private
enum
S
TANDARD_MODULES
{
private
enum
S
tandardModule
{
Naturals
,
Integers
,
FiniteSets
,
Sequences
,
TLC
,
BBuiltIns
,
Relations
,
FunctionsAsRelations
,
Functions
,
SequencesExtended
,
SequencesAsRelations
,
ExternalFunctions
,
Foo
Naturals
,
Integers
,
FiniteSets
,
Sequences
,
TLC
,
BBuiltIns
,
Relations
,
FunctionsAsRelations
,
Functions
,
SequencesExtended
,
SequencesAsRelations
,
ExternalFunctions
,
Foo
}
}
private
final
static
ArrayList
<
S
TANDARD_MODULES
>
modules
=
new
ArrayList
<>();
private
final
static
ArrayList
<
S
tandardModule
>
modules
=
new
ArrayList
<>();
static
{
static
{
modules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
modules
.
add
(
S
tandardModule
.
Naturals
);
modules
.
add
(
S
TANDARD_MODULES
.
Integers
);
modules
.
add
(
S
tandardModule
.
Integers
);
modules
.
add
(
S
TANDARD_MODULES
.
FiniteSets
);
modules
.
add
(
S
tandardModule
.
FiniteSets
);
modules
.
add
(
S
TANDARD_MODULES
.
Sequences
);
modules
.
add
(
S
tandardModule
.
Sequences
);
modules
.
add
(
S
TANDARD_MODULES
.
TLC
);
modules
.
add
(
S
tandardModule
.
TLC
);
modules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
modules
.
add
(
S
tandardModule
.
BBuiltIns
);
modules
.
add
(
S
TANDARD_MODULES
.
Relations
);
modules
.
add
(
S
tandardModule
.
Relations
);
modules
.
add
(
S
TANDARD_MODULES
.
Functions
);
modules
.
add
(
S
tandardModule
.
Functions
);
modules
.
add
(
S
TANDARD_MODULES
.
FunctionsAsRelations
);
modules
.
add
(
S
tandardModule
.
FunctionsAsRelations
);
modules
.
add
(
S
TANDARD_MODULES
.
SequencesExtended
);
modules
.
add
(
S
tandardModule
.
SequencesExtended
);
modules
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
modules
.
add
(
S
tandardModule
.
SequencesAsRelations
);
modules
.
add
(
S
TANDARD_MODULES
.
ExternalFunctions
);
modules
.
add
(
S
tandardModule
.
ExternalFunctions
);
}
}
private
final
Set
<
S
TANDARD_MODULES
>
extendedStandardModules
;
private
final
Set
<
S
tandardModule
>
extendedStandardModules
;
private
final
Typechecker
typechecker
;
private
final
Typechecker
typechecker
;
public
UsedStandardModules
(
Start
start
,
Typechecker
typechecker
,
public
UsedStandardModules
(
Start
start
,
Typechecker
typechecker
,
...
@@ -133,7 +133,7 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -133,7 +133,7 @@ public class UsedStandardModules extends DepthFirstAdapter {
this
.
typechecker
=
typechecker
;
this
.
typechecker
=
typechecker
;
if
(
TLC4BGlobals
.
useSymmetry
())
{
if
(
TLC4BGlobals
.
useSymmetry
())
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
TLC
);
extendedStandardModules
.
add
(
S
tandardModule
.
TLC
);
}
}
List
<
PDefinition
>
definitions
=
tlaModule
.
getAllDefinitions
();
List
<
PDefinition
>
definitions
=
tlaModule
.
getAllDefinitions
();
...
@@ -150,66 +150,66 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -150,66 +150,66 @@ public class UsedStandardModules extends DepthFirstAdapter {
}
}
public
List
<
String
>
getExtendedModules
()
{
public
List
<
String
>
getExtendedModules
()
{
ArrayList
<
S
TANDARD_MODULES
>
list
=
new
ArrayList
<>(
extendedStandardModules
);
ArrayList
<
S
tandardModule
>
list
=
new
ArrayList
<>(
extendedStandardModules
);
if
(
list
.
contains
(
S
TANDARD_MODULES
.
Integers
))
{
if
(
list
.
contains
(
S
tandardModule
.
Integers
))
{
list
.
remove
(
S
TANDARD_MODULES
.
Naturals
);
list
.
remove
(
S
tandardModule
.
Naturals
);
}
}
list
.
sort
((
s1
,
s2
)
->
{
list
.
sort
((
s1
,
s2
)
->
{
Integer
i1
=
modules
.
indexOf
(
s1
);
Integer
i1
=
modules
.
indexOf
(
s1
);
Integer
i2
=
modules
.
indexOf
(
s2
);
Integer
i2
=
modules
.
indexOf
(
s2
);
return
i1
.
compareTo
(
i2
);
return
i1
.
compareTo
(
i2
);
});
});
return
list
.
stream
().
map
(
S
TANDARD_MODULES
:
:
name
).
collect
(
Collectors
.
toList
());
return
list
.
stream
().
map
(
S
tandardModule
:
:
name
).
collect
(
Collectors
.
toList
());
}
}
public
Set
<
String
>
getStandardModulesToBeCreated
()
{
public
Set
<
String
>
getStandardModulesToBeCreated
()
{
// dependencies of standard modules
// dependencies of standard modules
HashSet
<
S
TANDARD_MODULES
>
res
=
new
HashSet
<>();
HashSet
<
S
tandardModule
>
res
=
new
HashSet
<>();
for
(
S
TANDARD_MODULES
module
:
extendedStandardModules
)
{
for
(
S
tandardModule
module
:
extendedStandardModules
)
{
switch
(
module
)
{
switch
(
module
)
{
case
ExternalFunctions:
case
ExternalFunctions:
res
.
add
(
S
TANDARD_MODULES
.
ExternalFunctions
);
res
.
add
(
S
tandardModule
.
ExternalFunctions
);
break
;
break
;
case
FunctionsAsRelations:
case
FunctionsAsRelations:
res
.
add
(
S
TANDARD_MODULES
.
FunctionsAsRelations
);
res
.
add
(
S
tandardModule
.
FunctionsAsRelations
);
res
.
add
(
S
TANDARD_MODULES
.
Functions
);
res
.
add
(
S
tandardModule
.
Functions
);
break
;
break
;
case
SequencesAsRelations:
case
SequencesAsRelations:
res
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
res
.
add
(
S
tandardModule
.
SequencesAsRelations
);
res
.
add
(
S
TANDARD_MODULES
.
Relations
);
res
.
add
(
S
tandardModule
.
Relations
);
res
.
add
(
S
TANDARD_MODULES
.
FunctionsAsRelations
);
res
.
add
(
S
tandardModule
.
FunctionsAsRelations
);
res
.
add
(
S
TANDARD_MODULES
.
Functions
);
res
.
add
(
S
tandardModule
.
Functions
);
break
;
break
;
case
BBuiltIns:
case
BBuiltIns:
res
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
res
.
add
(
S
tandardModule
.
BBuiltIns
);
break
;
break
;
case
Functions:
case
Functions:
res
.
add
(
S
TANDARD_MODULES
.
Functions
);
res
.
add
(
S
tandardModule
.
Functions
);
break
;
break
;
case
Relations:
case
Relations:
res
.
add
(
S
TANDARD_MODULES
.
Relations
);
res
.
add
(
S
tandardModule
.
Relations
);
break
;
break
;
case
Sequences:
case
Sequences:
break
;
break
;
case
SequencesExtended:
case
SequencesExtended:
res
.
add
(
S
TANDARD_MODULES
.
SequencesExtended
);
res
.
add
(
S
tandardModule
.
SequencesExtended
);
break
;
break
;
default
:
default
:
break
;
break
;
}
}
}
}
return
res
.
stream
().
map
(
S
TANDARD_MODULES
:
:
name
).
collect
(
Collectors
.
toSet
());
return
res
.
stream
().
map
(
S
tandardModule
:
:
name
).
collect
(
Collectors
.
toSet
());
}
}
@Override
@Override
public
void
inAExpressionDefinitionDefinition
(
AExpressionDefinitionDefinition
node
)
{
public
void
inAExpressionDefinitionDefinition
(
AExpressionDefinitionDefinition
node
)
{
if
(
TLC4BGlobals
.
isForceTLCToEvalConstants
())
{
if
(
TLC4BGlobals
.
isForceTLCToEvalConstants
())
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
TLC
);
extendedStandardModules
.
add
(
S
tandardModule
.
TLC
);
}
}
String
name
=
node
.
getName
().
getText
().
trim
();
String
name
=
node
.
getName
().
getText
().
trim
();
if
(
StandardModules
.
isKeywordInModuleExternalFunctions
(
name
))
{
if
(
StandardModules
.
isKeywordInModuleExternalFunctions
(
name
))
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
ExternalFunctions
);
extendedStandardModules
.
add
(
S
tandardModule
.
ExternalFunctions
);
}
}
}
}
...
@@ -217,7 +217,7 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -217,7 +217,7 @@ public class UsedStandardModules extends DepthFirstAdapter {
public
void
inADefinitionPredicate
(
ADefinitionPredicate
node
)
{
public
void
inADefinitionPredicate
(
ADefinitionPredicate
node
)
{
String
name
=
node
.
getDefLiteral
().
getText
().
trim
();
String
name
=
node
.
getDefLiteral
().
getText
().
trim
();
if
(
StandardModules
.
isKeywordInModuleExternalFunctions
(
name
))
{
if
(
StandardModules
.
isKeywordInModuleExternalFunctions
(
name
))
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
ExternalFunctions
);
extendedStandardModules
.
add
(
S
tandardModule
.
ExternalFunctions
);
}
}
}
}
...
@@ -227,46 +227,46 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -227,46 +227,46 @@ public class UsedStandardModules extends DepthFirstAdapter {
@Override
@Override
public
void
caseANaturalSetExpression
(
ANaturalSetExpression
node
)
{
public
void
caseANaturalSetExpression
(
ANaturalSetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
@Override
@Override
public
void
caseANatural1SetExpression
(
ANatural1SetExpression
node
)
{
public
void
caseANatural1SetExpression
(
ANatural1SetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
@Override
@Override
public
void
caseANatSetExpression
(
ANatSetExpression
node
)
{
public
void
caseANatSetExpression
(
ANatSetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
@Override
@Override
public
void
caseANat1SetExpression
(
ANat1SetExpression
node
)
{
public
void
caseANat1SetExpression
(
ANat1SetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
public
void
inALessEqualPredicate
(
ALessEqualPredicate
node
)
{
public
void
inALessEqualPredicate
(
ALessEqualPredicate
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
public
void
inALessPredicate
(
ALessPredicate
node
)
{
public
void
inALessPredicate
(
ALessPredicate
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
public
void
inAGreaterEqualPredicate
(
AGreaterEqualPredicate
node
)
{
public
void
inAGreaterEqualPredicate
(
AGreaterEqualPredicate
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
public
void
inAGreaterPredicate
(
AGreaterPredicate
node
)
{
public
void
inAGreaterPredicate
(
AGreaterPredicate
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
public
void
inAAddExpression
(
AAddExpression
node
)
{
public
void
inAAddExpression
(
AAddExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
public
void
inAIntervalExpression
(
AIntervalExpression
node
)
{
public
void
inAIntervalExpression
(
AIntervalExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
...
@@ -274,16 +274,16 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -274,16 +274,16 @@ public class UsedStandardModules extends DepthFirstAdapter {
AMinusOrSetSubtractExpression
node
)
{
AMinusOrSetSubtractExpression
node
)
{
BType
t
=
typechecker
.
getType
(
node
);
BType
t
=
typechecker
.
getType
(
node
);
if
(
t
instanceof
IntegerType
)
{
if
(
t
instanceof
IntegerType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
}
}
}
public
void
inAMultOrCartExpression
(
AMultOrCartExpression
node
)
{
public
void
inAMultOrCartExpression
(
AMultOrCartExpression
node
)
{
BType
t
=
typechecker
.
getType
(
node
);
BType
t
=
typechecker
.
getType
(
node
);
if
(
t
instanceof
IntegerType
)
{
if
(
t
instanceof
IntegerType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Naturals
);
extendedStandardModules
.
add
(
S
tandardModule
.
Naturals
);
}
else
{
}
else
{
// usedStandardModules.add(S
TANDARD_MODULES
.RelationsNew);
// usedStandardModules.add(S
tandardModule
.RelationsNew);
}
}
}
}
...
@@ -292,26 +292,26 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -292,26 +292,26 @@ public class UsedStandardModules extends DepthFirstAdapter {
*/
*/
public
void
inAIntSetExpression
(
AIntSetExpression
node
)
{
public
void
inAIntSetExpression
(
AIntSetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Integers
);
extendedStandardModules
.
add
(
S
tandardModule
.
Integers
);
}
}
public
void
inAIntegerSetExpression
(
AIntegerSetExpression
node
)
{
public
void
inAIntegerSetExpression
(
AIntegerSetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Integers
);
extendedStandardModules
.
add
(
S
tandardModule
.
Integers
);
}
}
public
void
inAUnaryMinusExpression
(
AUnaryMinusExpression
node
)
{
public
void
inAUnaryMinusExpression
(
AUnaryMinusExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Integers
);
extendedStandardModules
.
add
(
S
tandardModule
.
Integers
);
}
}
public
void
inAMinIntExpression
(
AMinIntExpression
node
)
{
public
void
inAMinIntExpression
(
AMinIntExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Integers
);
extendedStandardModules
.
add
(
S
tandardModule
.
Integers
);
}
}
/**
/**
* FiniteSets
* FiniteSets
*/
*/
public
void
inACardExpression
(
ACardExpression
node
)
{
public
void
inACardExpression
(
ACardExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
FiniteSets
);
extendedStandardModules
.
add
(
S
tandardModule
.
FiniteSets
);
}
}
/**
/**
...
@@ -319,73 +319,73 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -319,73 +319,73 @@ public class UsedStandardModules extends DepthFirstAdapter {
*/
*/
public
void
inAPowerOfExpression
(
APowerOfExpression
node
)
{
public
void
inAPowerOfExpression
(
APowerOfExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAMinExpression
(
AMinExpression
node
)
{
public
void
inAMinExpression
(
AMinExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAMaxExpression
(
AMaxExpression
node
)
{
public
void
inAMaxExpression
(
AMaxExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAModuloExpression
(
AModuloExpression
node
)
{
public
void
inAModuloExpression
(
AModuloExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inADivExpression
(
ADivExpression
node
)
{
public
void
inADivExpression
(
ADivExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAGeneralSumExpression
(
AGeneralSumExpression
node
)
{
public
void
inAGeneralSumExpression
(
AGeneralSumExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAGeneralProductExpression
(
AGeneralProductExpression
node
)
{
public
void
inAGeneralProductExpression
(
AGeneralProductExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inASuccessorExpression
(
ASuccessorExpression
node
)
{
public
void
inASuccessorExpression
(
ASuccessorExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAPredecessorExpression
(
APredecessorExpression
node
)
{
public
void
inAPredecessorExpression
(
APredecessorExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAPow1SubsetExpression
(
APow1SubsetExpression
node
)
{
public
void
inAPow1SubsetExpression
(
APow1SubsetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAFinSubsetExpression
(
AFinSubsetExpression
node
)
{
public
void
inAFinSubsetExpression
(
AFinSubsetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAFin1SubsetExpression
(
AFin1SubsetExpression
node
)
{
public
void
inAFin1SubsetExpression
(
AFin1SubsetExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inANotSubsetPredicate
(
ANotSubsetPredicate
node
)
{
public
void
inANotSubsetPredicate
(
ANotSubsetPredicate
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inANotSubsetStrictPredicate
(
ANotSubsetStrictPredicate
node
)
{
public
void
inANotSubsetStrictPredicate
(
ANotSubsetStrictPredicate
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAGeneralIntersectionExpression
(
public
void
inAGeneralIntersectionExpression
(
AGeneralIntersectionExpression
node
)
{
AGeneralIntersectionExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAQuantifiedIntersectionExpression
(
public
void
inAQuantifiedIntersectionExpression
(
AQuantifiedIntersectionExpression
node
)
{
AQuantifiedIntersectionExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
BBuiltIns
);
extendedStandardModules
.
add
(
S
tandardModule
.
BBuiltIns
);
}
}
public
void
inAQuantifiedUnionExpression
(
AQuantifiedUnionExpression
node
)
{
public
void
inAQuantifiedUnionExpression
(
AQuantifiedUnionExpression
node
)
{
// usedStandardModules.add(S
TANDARD_MODULES
.BBuiltIns);
// usedStandardModules.add(S
tandardModule
.BBuiltIns);
}
}
/**
/**
...
@@ -394,9 +394,9 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -394,9 +394,9 @@ public class UsedStandardModules extends DepthFirstAdapter {
private
void
setOfFunctions
(
Node
node
)
{
private
void
setOfFunctions
(
Node
node
)
{
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
if
(
set
.
getSubtype
()
instanceof
FunctionType
)
{
if
(
set
.
getSubtype
()
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Functions
);
extendedStandardModules
.
add
(
S
tandardModule
.
Functions
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
FunctionsAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
FunctionsAsRelations
);
}
}
}
}
...
@@ -445,7 +445,7 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -445,7 +445,7 @@ public class UsedStandardModules extends DepthFirstAdapter {
}
}
BType
type
=
typechecker
.
getType
(
node
.
getIdentifier
());
BType
type
=
typechecker
.
getType
(
node
.
getIdentifier
());
if
(
type
instanceof
SetType
)
{
if
(
type
instanceof
SetType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
FunctionsAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
FunctionsAsRelations
);
}
}
}
}
...
@@ -453,7 +453,7 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -453,7 +453,7 @@ public class UsedStandardModules extends DepthFirstAdapter {
public
void
inATotalFunctionExpression
(
ATotalFunctionExpression
node
)
{
public
void
inATotalFunctionExpression
(
ATotalFunctionExpression
node
)
{
SetType
type
=
(
SetType
)
typechecker
.
getType
(
node
);
SetType
type
=
(
SetType
)
typechecker
.
getType
(
node
);
if
(
type
.
getSubtype
()
instanceof
SetType
)
{
if
(
type
.
getSubtype
()
instanceof
SetType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
FunctionsAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
FunctionsAsRelations
);
}
}
}
}
...
@@ -464,27 +464,27 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -464,27 +464,27 @@ public class UsedStandardModules extends DepthFirstAdapter {
private
void
evalFunctionOrRelation
(
Node
node
)
{
private
void
evalFunctionOrRelation
(
Node
node
)
{
BType
t
=
typechecker
.
getType
(
node
);
BType
t
=
typechecker
.
getType
(
node
);
if
(
t
instanceof
FunctionType
)
{
if
(
t
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Functions
);
extendedStandardModules
.
add
(
S
tandardModule
.
Functions
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
}
}
public
void
inARelationsExpression
(
ARelationsExpression
node
)
{
public
void
inARelationsExpression
(
ARelationsExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inADomainExpression
(
ADomainExpression
node
)
{
public
void
inADomainExpression
(
ADomainExpression
node
)
{
BType
t
=
typechecker
.
getType
(
node
.
getExpression
());
BType
t
=
typechecker
.
getType
(
node
.
getExpression
());
if
(!(
t
instanceof
FunctionType
))
{
if
(!(
t
instanceof
FunctionType
))
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
}
}
public
void
inASetExtensionExpression
(
ASetExtensionExpression
node
)
{
public
void
inASetExtensionExpression
(
ASetExtensionExpression
node
)
{
BType
t
=
typechecker
.
getType
(
node
);
BType
t
=
typechecker
.
getType
(
node
);
if
(
t
instanceof
FunctionType
)
{
if
(
t
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
TLC
);
extendedStandardModules
.
add
(
S
tandardModule
.
TLC
);
}
}
}
}
...
@@ -531,52 +531,52 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -531,52 +531,52 @@ public class UsedStandardModules extends DepthFirstAdapter {
BType
type
=
typechecker
.
getType
(((
AFunctionExpression
)
e
)
BType
type
=
typechecker
.
getType
(((
AFunctionExpression
)
e
)
.
getIdentifier
());
.
getIdentifier
());
if
(
type
instanceof
SetType
)
{
if
(
type
instanceof
SetType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Functions
);
extendedStandardModules
.
add
(
S
tandardModule
.
Functions
);
}
}
}
}
}
}
}
}
public
void
inADirectProductExpression
(
ADirectProductExpression
node
)
{
public
void
inADirectProductExpression
(
ADirectProductExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inAParallelProductExpression
(
AParallelProductExpression
node
)
{
public
void
inAParallelProductExpression
(
AParallelProductExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inACompositionExpression
(
ACompositionExpression
node
)
{
public
void
inACompositionExpression
(
ACompositionExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inAFirstProjectionExpression
(
AFirstProjectionExpression
node
)
{
public
void
inAFirstProjectionExpression
(
AFirstProjectionExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inASecondProjectionExpression
(
ASecondProjectionExpression
node
)
{
public
void
inASecondProjectionExpression
(
ASecondProjectionExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inAIterationExpression
(
AIterationExpression
node
)
{
public
void
inAIterationExpression
(
AIterationExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inAClosureExpression
(
AClosureExpression
node
)
{
public
void
inAClosureExpression
(
AClosureExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inAReflexiveClosureExpression
(
AReflexiveClosureExpression
node
)
{
public
void
inAReflexiveClosureExpression
(
AReflexiveClosureExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inATransFunctionExpression
(
ATransFunctionExpression
node
)
{
public
void
inATransFunctionExpression
(
ATransFunctionExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
public
void
inATransRelationExpression
(
ATransRelationExpression
node
)
{
public
void
inATransRelationExpression
(
ATransRelationExpression
node
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Relations
);
extendedStandardModules
.
add
(
S
tandardModule
.
Relations
);
}
}
/**
/**
...
@@ -586,9 +586,9 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -586,9 +586,9 @@ public class UsedStandardModules extends DepthFirstAdapter {
public
void
inASeqExpression
(
ASeqExpression
node
)
{
public
void
inASeqExpression
(
ASeqExpression
node
)
{
SetType
type
=
(
SetType
)
typechecker
.
getType
(
node
);
SetType
type
=
(
SetType
)
typechecker
.
getType
(
node
);
if
(
type
.
getSubtype
()
instanceof
FunctionType
)
{
if
(
type
.
getSubtype
()
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Sequences
);
extendedStandardModules
.
add
(
S
tandardModule
.
Sequences
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesAsRelations
);
}
}
}
}
...
@@ -603,9 +603,9 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -603,9 +603,9 @@ public class UsedStandardModules extends DepthFirstAdapter {
private
void
evalSequenceOrRelation
(
Node
node
)
{
private
void
evalSequenceOrRelation
(
Node
node
)
{
BType
type
=
typechecker
.
getType
(
node
);
BType
type
=
typechecker
.
getType
(
node
);
if
(
type
instanceof
FunctionType
)
{
if
(
type
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
Sequences
);
extendedStandardModules
.
add
(
S
tandardModule
.
Sequences
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesAsRelations
);
}
}
}
}
...
@@ -624,36 +624,36 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -624,36 +624,36 @@ public class UsedStandardModules extends DepthFirstAdapter {
private
void
evalSequenceExtendedOrRelation
(
Node
node
)
{
private
void
evalSequenceExtendedOrRelation
(
Node
node
)
{
BType
type
=
typechecker
.
getType
(
node
);
BType
type
=
typechecker
.
getType
(
node
);
if
(
type
instanceof
FunctionType
)
{
if
(
type
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesExtended
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesExtended
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesAsRelations
);
}
}
}
}
public
void
inAIseqExpression
(
AIseqExpression
node
)
{
public
void
inAIseqExpression
(
AIseqExpression
node
)
{
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
if
(
set
.
getSubtype
()
instanceof
FunctionType
)
{
if
(
set
.
getSubtype
()
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesExtended
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesExtended
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesAsRelations
);
}
}
}
}
public
void
inASeq1Expression
(
ASeq1Expression
node
)
{
public
void
inASeq1Expression
(
ASeq1Expression
node
)
{
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
if
(
set
.
getSubtype
()
instanceof
FunctionType
)
{
if
(
set
.
getSubtype
()
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesExtended
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesExtended
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesAsRelations
);
}
}
}
}
public
void
inAIseq1Expression
(
AIseq1Expression
node
)
{
public
void
inAIseq1Expression
(
AIseq1Expression
node
)
{
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
if
(
set
.
getSubtype
()
instanceof
FunctionType
)
{
if
(
set
.
getSubtype
()
instanceof
FunctionType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesExtended
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesExtended
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesAsRelations
);
}
}
}
}
...
@@ -672,9 +672,9 @@ public class UsedStandardModules extends DepthFirstAdapter {
...
@@ -672,9 +672,9 @@ public class UsedStandardModules extends DepthFirstAdapter {
public
void
inAPermExpression
(
APermExpression
node
)
{
public
void
inAPermExpression
(
APermExpression
node
)
{
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
SetType
set
=
(
SetType
)
typechecker
.
getType
(
node
);
if
(
set
.
getSubtype
()
instanceof
SetType
)
{
if
(
set
.
getSubtype
()
instanceof
SetType
)
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesAsRelations
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesAsRelations
);
}
else
{
}
else
{
extendedStandardModules
.
add
(
S
TANDARD_MODULES
.
SequencesExtended
);
extendedStandardModules
.
add
(
S
tandardModule
.
SequencesExtended
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment