Fedor Isakov
ad6864cfda
Various refactorings in Step/Effect apis: simplifying the code.
...
Refactor Effect: drop type parameter, simplify usage.
Redesign the way values are provided by an Effect.
Simplify schedule method signature.
Drop scheduleWithTrace from Step interface.
Introduce ConfigureEvalStep.
Drop Step.Options.
Drop LocalEffect's.
2019-09-12 17:12:34 +02:00
Fedor Isakov
068ce227c3
Avoid propagating runtime exception from program evaluation.
2019-09-12 17:08:02 +02:00
Fedor Isakov
8b73b66e34
Introduce RepositoryProvider interface to provide access to context repository.
...
TemplateApplicationSession to provide repository to templates.
Supervisor subclasses to provide repository to predicates.
2019-09-12 17:08:02 +02:00
Grigorii Kirgizov
332735e770
Remove unneded handler
2019-09-12 15:29:14 +03:00
Grigorii Kirgizov
cdfe1f2c0c
Update language version after migrations from mps.logic lang
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
85b074d189
Make ListNodeCons migration a bit more restrictive
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
135724a481
Fix use case of list matching with any list
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
7242e832b1
Upd mps.logic lang version
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
fc1caf1238
Fix Remove_Splice_from_ListNode migration
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
163e339436
Add migration for replacing List usages for ConsList constructor usages
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
3ff9ccb0c6
Add wrapping substitute menu for LogicalDataForm concept
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
cfe0b1b648
Add ListNodeCons DataForm: another constructor for ListNode similar to Haskell's `head:tail` constructor
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
edbd77c748
Prepare for migration from spliced Logicals in ListNode to LogicalDataForm
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
6a02be6f6e
Avoid nested empty lists in mapped ListNode.Alias. Fix capture in lcta helper for lub. Add test for lub.
...
The problem with empty lists showed up at least in printing lists.
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
37be72d9cf
Refactor generation of ListFeature & 'spliced' MultiMetaLogical. Fix BL typesystem to accomodate these changes.
...
ListRole in DataForms is stricter and doesn't allow non-list values.
Spliced MultiMetaLogical is always generated to ListNode without intermediate step of Variable[].
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
e2e531f13c
Add few utilities and extend logic of subtypePaths for LUB impl
...
subtypePaths constraint now has an extended version subtypePathsRaw that returns
extended 'classifierType' dataforms with type parameters (no only classifiers).
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
9480bc98fe
Fix var ref in closure
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
a0b73f9f1b
Silence BL analysis check for a while
...
The test can fail in temporary states of BL typesystem while it is being extended
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
aa96197085
Use Effect for passing SessionToken from EvaluateRulesStep. Use Step.Options for "is with incrementality" option.
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
924d07c8ed
Return 'tagDetail' logic in RuleBuilder to handle duplicate tags of rules generated in loops
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
4ea72e6d4f
Allow checking for "no type" TypecheckingReportItems in typechecking tests
2019-09-11 13:24:01 +03:00
Fedor Isakov
adc115b164
Avoid failure on exception thrown from a template.
...
Produce a program even in case some of applied rules failed.
Allow to recover from failure in apply templates.
2019-09-10 18:37:12 +02:00
Fedor Isakov
b842fb6b9d
Avoid unnecessarily throwing exception on failure.
...
EvaluationFailureException is meant to be only thrown from predicate solvers.
It is specially processed in the reactor engine.
2019-09-10 18:37:12 +02:00
Fedor Isakov
c016ffc01b
Fix a race condition.
...
Instead of an ad-hoc synchronization in implementation use a more broad synchronization in a public method.
2019-09-10 18:37:12 +02:00
Fedor Isakov
51860132b7
Remove overlooked debug output.
2019-09-10 18:37:12 +02:00
Fedor Isakov
5b5798dcad
Switch to reactor lib 0.9.13.
2019-09-10 18:37:11 +02:00
Fedor Isakov
f583c62d93
Drop overrides of removed methods.
2019-09-10 18:37:11 +02:00
Fedor Isakov
d3a555c3a4
Ensure correct nodeRef is passed as a feedback template
...
.
2019-09-05 22:56:11 +02:00
Fedor Isakov
cdac933b0c
Refactor TraceObject to contain all traces from all evaluation sesssion.
...
If multiple aspect cliques are used in a model, multiple sessions are launched,
which results in multiple traces.
2019-09-05 22:56:11 +02:00
Fedor Isakov
67284c802e
Drop baseLanguage from imports in a sandbox model.
2019-09-05 22:56:11 +02:00
Fedor Isakov
fc3b69f06e
Make sure the "annotation" lang has a types aspect.
2019-09-05 18:53:52 +02:00
Fedor Isakov
43e34bd14e
Redesing the way aspect cliques are processed.
...
An empty clique singifies that either none of the languages in the clique have the necessary aspects,
or that the "leaf" languages don't.
2019-09-05 18:53:27 +02:00
Fedor Isakov
1636f18f73
Support navigating to rule from editor. Drop implementations of Reporting.report.
2019-09-04 16:53:03 +02:00
Fedor Isakov
e628ea350b
Collect and index all feedback nodes. Support navigating to next/prev feedback.
2019-09-03 16:19:16 +02:00
Fedor Isakov
ab8ec75878
Rewrite feedback handling without Reporting interface.
...
Instead of using the (deprecated) Reporting interface when handling
feedback, use the more straightforward abstract method.
2019-09-02 17:55:46 +02:00
Fedor Isakov
77be3869a4
Introduce target specification to provide feedback constraint.
...
One should be able to report issues with a target.
The target is normally inferred from the rule's origin, but sometimes it is
necessary to specify the issue's target explicitly.
2019-09-02 17:55:46 +02:00
Fedor Isakov
8b82d7ba4d
Introduce origin block for specifying the constraint rule origin.
2019-09-02 17:55:46 +02:00
Fedor Isakov
d279cc64ba
Deprecate report operation and API.
2019-09-02 17:55:46 +02:00
Fedor Isakov
41c4c7e0a3
Fix provide feedback predicate to use the updated API.
2019-09-02 17:55:46 +02:00
Fedor Isakov
130c273980
Swith to using reactor lib 0.9.12.
2019-09-02 17:37:55 +02:00
Fedor Isakov
84d07ef5f4
Another strategy to deal with deadlocks: drop requirement to use EDT.
...
Typechecking needs a synch point to update its "types model".
Using either EDT or the sequential scheduler is unfeasible beacause
of possible deadlocks.
2019-08-29 13:19:22 +02:00
Fedor Isakov
46406f8917
Straighten up error processing when launching coderules.
2019-08-29 11:36:54 +02:00
Fedor Isakov
355a503f5e
Various refactorings in trace and reporting.
...
Replace ReportSink with Consumer.
Rename TraceEventsCollector -> TraceEvents.
Collect report items in TraceObject.
Ensure messages view tabs stay pinned.
Enable navigation from messages view to source nodes.
Respect report item's severity.
2019-08-28 21:27:09 +02:00
Fedor Isakov
7956b8c89c
Ensure type index update is run in EDT, avoid race condition.
2019-08-28 17:46:34 +02:00
Fedor Isakov
91f317b307
Ensure message view tab is disposed, avoid memory leak.
2019-08-27 11:55:35 +02:00
Fedor Isakov
5c239fb4b9
Fix Memoizer race condition.
2019-08-27 11:22:39 +02:00
Fedor Isakov
8d289021d1
Remove toxic imports.
2019-08-26 19:01:26 +02:00
Fedor Isakov
899d6b5208
Avoid producing NPE on missing template.
2019-08-26 17:14:39 +02:00
Fedor Isakov
17cb4654cf
Introduce message handler parameter to rule application session.
...
In some situations it is unreasonable to fail on missing templates,
it's better to produce a working but perhaps incomplete program
than not to produce anything.
2019-08-26 16:53:04 +02:00
Fedor Isakov
b79d174753
More fine-grained reporting of errors during coderules evaluation.
2019-08-26 15:27:04 +02:00
Fedor Isakov
388ea7e268
Minor refactorings in typechecking service. Display number of reported items with query.
2019-08-26 13:06:58 +02:00
Fedor Isakov
c7ed81bd51
Switch to using MessageLog instead of the default message log. Minor fixes.
...
Collect coderules messages in "Messages" tab by default.
2019-08-26 13:06:58 +02:00
Fedor Isakov
e60a2151c0
Avoid using executeCommand to schedule a message view update.
2019-08-23 12:48:43 +02:00
Grigorii Kirgizov
a3451cb714
Use Effect for passing SessionToken from EvaluateRulesStep. Use Step.Options for "is with incrementality" option.
2019-08-22 23:04:05 +03:00
Fedor Isakov
279a048acd
Fix reference to an API class.
2019-08-22 16:55:29 +02:00
Grigorii Kirgizov
224900fc88
Add option to Queries for enabling incrementality
2019-08-22 17:29:54 +03:00
Grigorii Kirgizov
e7c0c0e3a0
Enable incrementality in TypecheckingStep
2019-08-22 17:15:15 +03:00
Grigorii Kirgizov
dc32a149da
Add preference for enabling incrementality
2019-08-22 17:14:44 +03:00
Grigorii Kirgizov
654e8b60cc
Resolve rebase conflicts concenred with enabling incrementality in CoderulesTypecheckingProvider
2019-08-22 17:14:12 +03:00
Fedor Isakov
f698d7dbdd
Fix incremental evaluate step -- adapt to the changed API.
2019-08-22 15:30:55 +02:00
Grigorii Kirgizov
cc20e9735b
Extend TypesIndexCache & EvaluateRulesStep with storing and retrieving SessionToken
2019-08-22 15:19:58 +02:00
Grigorii Kirgizov
af2faeb077
Remove dependencies on samples.baseLanguageExt and samples.lambdacalc from tests, fix build. Rebase onto master.
2019-08-22 15:16:18 +02:00
Grigorii Kirgizov
2b1ec4a4a6
Remove interprocedural version of analysis
2019-08-22 15:16:18 +02:00
Grigorii Kirgizov
944a181685
Switch basic principals analysis to fully gen-time impl
2019-08-22 15:16:18 +02:00
Grigorii Kirgizov
9843669f79
Remove old runtime coderules analyses
2019-08-22 15:16:18 +02:00
Grigorii Kirgizov
37a6a4e1b7
Two more tests on FreeVarEscapeAnalysis for more complex cases. Extend checker logic for them.
2019-08-22 15:16:18 +02:00
Grigorii Kirgizov
c6fc2c3f96
Test FreeVarEscapeAnalysis on full languages. Passes for BL, fails for lambdacalc as intended.
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
1c9060b769
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.
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
ae993f6868
Separate VarAnalysisUtil into base and impl part that handles impl of involved relations ("isAffected").
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
87fb26b95b
Fix NPE in access to hashmap in VarModificationAnalysis
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
e41589cd4a
Fix few places in VarModificationAnalysis. Add tests for it (found some problems).
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
f1aa5cb923
Finish interprocedural part of VarModificationAnalysis. Add one more test for Var..Util.
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
4ab877e822
Refine isAffected relation in VarAnalysisUtil: handle dep-s through composite logicals
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
62b08720cd
Fix finding isAffected relation in var2notvar case by more carefully handling aliasing with "non-local" vars. Few more tests.
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
f7040b1d8d
Add metalogical aliasing in VarAnalysisUtil. Rewrite older analyses fully in BL and not template macros.
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
8a2942c42b
Move VarModificationAnalysisUtil to new model for analysis-related code
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
64230b0412
Add tests for VarAnalysisUtil. Update its semantics.
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
5f2b010e5b
Add checking analysis for non-trivial var modification (e.g. unification)
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
5ba57b0b61
Refine notion of principal rule: discern between different kinds of rules from queries. Resolves slowdown.
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
98356f25cc
rebase on master. remove extra deps in coderules generator
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
475ed7d023
Adjust border between abstract analyses classes and their generation-time impls
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov
906f919e16
Run coderules program analyses at generation stage. Extend Rule with basetag(). Adjust how rule_tag is generated for reuse in generator.
...
basetag() returns name of ConstraintRule without node id.
Check on whether Rule is principal are now done through basetag(), it's sufficient.
Add part of future analysis: CallerTableBuilder.
2019-08-22 15:16:17 +02:00
Fedor Isakov
1b1de4af47
Introduce options to coderules helper. Only turn on typechecking trace in UI.
2019-08-22 13:47:51 +02:00
Fedor Isakov
6290cbe152
Enable to open typechecking trace from message view; other changes.
...
Collect trace on every invocation of typechecking.
Drop usages of editor component from trace view.
2019-08-22 11:39:07 +02:00
Fedor Isakov
028683f394
Introduce combinable effects, refactor Step hierarchy to produce effects.
...
Step subclasses are meant to be immutable and stateless.
The state is now encapsulated in Effect subclasses, which can be combined.
Correspondingly, schedule now produces streams of effects.
2019-08-21 11:44:26 +02:00
Fedor Isakov
aef7e4c2ee
Extract the non-UI part of trace view to j.m.coderules solution.
2019-08-20 23:11:19 +02:00
Fedor Isakov
d786ff43b9
Re-save all models, language name updated in .mpl files.
2019-08-20 23:11:19 +02:00
Fedor Isakov
c3d20db0e3
Refactor away messages and trace collection from trace view component.
...
The UI component TraceComponent serves as a visualization tool for a trace collected independently.
Messages are likewise collected elsewhere and shown via message log.
2019-08-20 23:11:19 +02:00
Fedor Isakov
901bf5ad20
Fix type index cache: impossible to attach back an unattached model.
...
Index must never be updated once registered (published) with a repo.
A new index is always created and all contents is copied from the old one.
2019-08-20 23:11:19 +02:00
Fedor Isakov
59bdd8a3da
Fix the "isRelevant" logic in coderules typechecker.
2019-08-20 23:11:19 +02:00
Fedor Isakov
9178e8c913
Coderules-specific MessageViewTool and MessageLog for providing feedback.
...
Certain compromises have to be made: for one, it is assumed there is only one
project open and it is a MPSProject. Feedback is only reported to the messages
view and the view itself is not yet integrated into the main messages view.
2019-08-20 23:11:19 +02:00
Fedor Isakov
8017a97327
Adapt to changes in typechecking facade.
2019-08-14 13:29:12 +02:00
Fedor Isakov
684c218003
Flip "disabled" option to "enabled", false by default. Introduce property-controlled static flag.
2019-08-12 18:21:38 +02:00
Fedor Isakov
a26ab6541b
Disable coderules typechecker during model check test.
2019-08-12 18:21:38 +02:00
Fedor Isakov
45ae7a6a24
Fix build script imports and rebuild project.
2019-08-12 18:21:38 +02:00
Fedor Isakov
39c4499585
Refactor aspect lookup, introduce aspect clique to support multiple typesystems.
...
There might be several unrelated typesystems defined by languages imported into
a single model. A way to handle this is to use aspect cliques that correspond
to a collection of related aspects, which build a single typesystem.
2019-08-12 18:21:38 +02:00
Fedor Isakov
17544576ac
Introduce "disable typechecker" properties page. Implement typechecking coerce query.
2019-08-12 16:45:00 +02:00
Fedor Isakov
696d7dc226
Introduce coerce query kind.
2019-08-12 16:45:00 +02:00
Fedor Isakov
1e3917e787
Make dataform printer reusable.
2019-08-12 16:45:00 +02:00
Fedor Isakov
4c4c610531
Enable macro expansion on concept; null input produces empty builder.
2019-08-10 16:25:36 +02:00