From 1c9060b76939732ed4ec4580a83efda3aada23f4 Mon Sep 17 00:00:00 2001 From: Grigorii Kirgizov Date: Tue, 13 Aug 2019 19:27:55 +0300 Subject: [PATCH] Add simpler analysis to answer a question "Is incrementality allowed for this Coderules aspect?". Add initial tests for it. It is a rule-local, non-interprocedural analysis and it also uses VarAnalysisUtil. New analysis checks whether free variables can "escape" principal constraint rules inside principal constraints. If there is such escaped variable, then it is a signal that this type system is designed with non-local type inference in mind. Otherwise there's no need to produce principal constraints with free logicals as arguments. So, no principal constraints with free vars -- no type inference is possible. --- .mps/dictionaries/grigorii_kirgizov.xml | 11 + .../jetbrains.mps.lang.coderules.analysis.mps | 862 ++++++++++++++++-- ...ins.mps.coderules.incrementality@tests.mps | 744 +++++++++++++++ 3 files changed, 1533 insertions(+), 84 deletions(-) create mode 100644 .mps/dictionaries/grigorii_kirgizov.xml diff --git a/.mps/dictionaries/grigorii_kirgizov.xml b/.mps/dictionaries/grigorii_kirgizov.xml new file mode 100644 index 00000000..7a1c9df1 --- /dev/null +++ b/.mps/dictionaries/grigorii_kirgizov.xml @@ -0,0 +1,11 @@ + + + + arg + incrementality + logicals + symmetricity + unifications + + + \ No newline at end of file diff --git a/coderules/languages/jetbrains.mps.lang.coderules/languageModels/jetbrains.mps.lang.coderules.analysis.mps b/coderules/languages/jetbrains.mps.lang.coderules/languageModels/jetbrains.mps.lang.coderules.analysis.mps index 31edd7e1..09c3abac 100644 --- a/coderules/languages/jetbrains.mps.lang.coderules/languageModels/jetbrains.mps.lang.coderules.analysis.mps +++ b/coderules/languages/jetbrains.mps.lang.coderules/languageModels/jetbrains.mps.lang.coderules.analysis.mps @@ -137,6 +137,7 @@ + @@ -146,6 +147,7 @@ + @@ -289,6 +291,7 @@ + @@ -305,6 +308,10 @@ + + + + @@ -570,7 +577,89 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1836,85 +1925,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -5423,7 +5433,253 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5446,6 +5702,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6078,7 +6359,7 @@ - + @@ -6131,7 +6412,7 @@ - + @@ -6196,7 +6477,7 @@ - + @@ -6392,5 +6673,418 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/coderules/solutions/jetbrains.mps.coderules.typechecking.test/models/jetbrains.mps.coderules.incrementality@tests.mps b/coderules/solutions/jetbrains.mps.coderules.typechecking.test/models/jetbrains.mps.coderules.incrementality@tests.mps index 536d9e21..72d39b33 100644 --- a/coderules/solutions/jetbrains.mps.coderules.typechecking.test/models/jetbrains.mps.coderules.incrementality@tests.mps +++ b/coderules/solutions/jetbrains.mps.coderules.typechecking.test/models/jetbrains.mps.coderules.incrementality@tests.mps @@ -396,6 +396,11 @@ + + + + + @@ -479,6 +484,9 @@ + + + @@ -502,6 +510,9 @@ + + + @@ -6667,5 +6678,738 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +