Commit Graph

798 Commits

Author SHA1 Message Date
Fedor Isakov f985db8206 Update and rebuild build scripts 2022-07-28 10:30:38 +02:00
Fedor Isakov f9eb52a60f Introduce checkpoint for typechecking "strut" templates
The templates that typechecking relies upon are generated
into the user model as synthetic constructs. These later
need to be discovered by the generator to establish
correct references.
2022-07-28 10:30:38 +02:00
Fedor Isakov 33b472f560 Switch to using plain FQN strings to identify templates
SNodeReference are too unreliable to be used.
2022-07-28 10:30:38 +02:00
Fedor Isakov 468cee3b54 Avoid NPE when displaying baloon 2022-07-28 10:30:38 +02:00
Fedor Isakov 0663921ecd Refactoring in TypecheckingService; simplifying code
Request is no longer dependent on `TypecheckingService`.
Only single request can be processed at a time, which helps
prevent recursion.
All facade method in `TypecheckingService` now return instance
of `Response` instead.
2022-07-15 19:46:33 +02:00
Fedor Isakov 0422a4cbd4 Fix exception initialization 2022-07-15 19:46:32 +02:00
Fedor Isakov 115135bbb5 Update plugin versions and manifests 2022-07-13 12:27:14 +02:00
Fedor Isakov 71d2014ef1 Update and rebuild build scripts 2022-07-07 12:56:30 +02:00
Fedor Isakov f24169ba26 Refactor Config to be immutable; allow multi-project MPSCR-105
Drop hacks that try to figure out the active project.
Instead introduce new ones that cache the instance of `ProjectRepository`
(unfortunately, there is no way around that now).
Stop accessing and modifying the singleton `Config` instance,
instead make an instance of `Config` a parameter to `TypecheckingService`.
2022-07-07 12:56:30 +02:00
Fedor Isakov e4d7a9ff9e Notify UISettings after changing preferences, listen to UISettings 2022-07-07 12:56:29 +02:00
Fedor Isakov 99907ec111 Fix how CR widget looks (more professional look) 2022-07-07 12:56:28 +02:00
Fedor Isakov a84675c0f2 Cache statusbar in intialization code to avoid NPE 2022-07-04 13:42:39 +02:00
Fedor Isakov ff1ceb7dda Update build script 2022-06-18 14:53:09 +02:00
Fedor Isakov f6e75628c8 Rebuild build script 2022-06-13 11:20:31 +02:00
Fedor Isakov 7593fc7b14 Avoid NPE if preferences are not available 2022-06-13 11:20:31 +02:00
Fedor Isakov 8a46abcfb3 StatusBar widget to control Coderules ON/OFF 2022-06-13 11:11:57 +02:00
Fedor Isakov d1f3066af2 Drop all caches from AspectLookup
Caches cause subtle errors and their utility is questionable.
2022-06-08 10:23:43 +02:00
Fedor Isakov e1bab4a1c7 Respect LateExpression arg when building unique_tag, MPSCR-107
Rule's unique_tag is important for update procedure
implemented by RulesPlanHandler. Only when we can guarantee
that an argument to constraint/predicate has not changed
we can save on re-building a rule from template.
Ignoring LateExpression was a mistake.
2022-06-07 15:22:39 +02:00
Fedor Isakov 88aaf7898c Ensure only relevant aspects selected for certain queries
While check/checkTypeOf queries are required to
process a whole root, other types of queries
can be sensitive to what aspects to include in
the processing.

Aspects are sorted in strongly-connected components,
among which the relevant one is selected.
2022-06-06 13:00:52 +02:00
Fedor Isakov 56c7bdad7f Make FQ symbol names displayed as short names in trace view 2022-05-26 12:52:25 +02:00
Fedor Isakov f862406ca6 Switch to using single AspectClique 2022-05-26 12:52:25 +02:00
Fedor Isakov c112a59116 Switch to collection of QueryTemplate instead of single instance
The deisgn decision to have only one instance of QueryTemplate
leads to the necessity to keep AspectClique separated for
every "typesystem". Whereas QueryTemplate are really perfectly
composable, and thus only one AspectClique is neeeded.

Also drop a rudimentary unused feature.
2022-05-26 09:58:31 +02:00
Fedor Isakov 710c5ddc9b Ensure failure during trace view update is gracefully handled 2022-05-25 13:37:55 +02:00
Fedor Isakov b6c190c35c Introduce ruleInput parameter to call macro
Accessing the rule input allows to track dependencies
necessary for correctly updating the feedback.
2022-05-09 17:02:12 +02:00
Fedor Isakov e7054ed124 Drop usages of invalidatedFeedbackKeys, minor fixes 2022-05-09 13:32:14 +02:00
Fedor Isakov e2521c3478 Bump up version of coderules plugin 2022-05-03 10:26:43 +02:00
Fedor Isakov 702098d091 Cleanup and simplify typechecking strategy 2022-05-03 10:26:43 +02:00
Fedor Isakov 7f34ea78f6 Drop incrementality-related options and UI elements 2022-05-03 10:26:43 +02:00
Fedor Isakov 050c47c2eb Update conreactor version to 0.9.16 2022-04-25 12:47:43 +02:00
Fedor Isakov bd249c5d0c Drop obsolete feature: incremental specification 2022-04-21 16:05:31 +02:00
Fedor Isakov c192a529a6 Display undo activate/discard events in trace view. MPSCR-102 2022-03-15 15:48:56 +01:00
Fedor Isakov 51a4949cbd Update reactor version 2022-03-15 14:27:43 +01:00
Fedor Isakov c7c55605f5 Add dependency to c.i.modules.platform to pluigns 2022-02-23 13:09:34 +01:00
Fedor Isakov b500bf5f8f Fix broken plugin descriptor 2022-02-17 17:50:27 +01:00
Fedor Isakov 73f86ba626 Disable obsolete warning 2022-02-17 17:08:31 +01:00
Fedor Isakov 9cb04439eb Fix packaging of coderules and mpscore plugins
Fix the path mapping of lib files.
2022-02-17 16:44:14 +01:00
Fedor Isakov c44e4b2080 Update coderules plugin desc, fix release number 2022-02-16 12:23:38 +01:00
Clement de La Bourdonnaye 2b23c56283 Added coderules modules in plugin content 2022-02-08 12:21:28 +01:00
Fedor Isakov d7ffb963f7 Fix and rebuild build scripts 2022-02-08 10:44:48 +01:00
Fedor Isakov 2e5d73b31e Add icons for typechecking roots and the aspect 2021-11-25 18:09:22 +01:00
Fedor Isakov 4e70300ea7 Update language imports 2021-11-24 16:22:17 +01:00
Fedor Isakov 3774759270 Drop references to removed Activation Trace 2021-11-24 16:22:17 +01:00
Fedor Isakov 3af6cf93b0 Fix missing effect 2021-11-18 12:29:33 +01:00
Fedor Isakov e95526ef33 Update build script 2021-11-18 10:59:58 +01:00
Fedor Isakov 4ccbff779f Refactoring in the UI: merging tool windows into one 2021-11-18 10:59:58 +01:00
Fedor Isakov e64f01a059 Move typechecking actions to debug menu, drop errors highlighting 2021-11-15 17:08:28 +01:00
Fedor Isakov b892bc3aa5 Avoid failing on empty handlers list, MPSCR-97 2021-11-15 13:00:03 +01:00
Fedor Isakov 5a6beac54e Avoid failing with a stacktrace on empty aspect clique 2021-11-15 13:00:03 +01:00
Fedor Isakov 6a120fb9d6 Change "show type balloon" shortcut to not conflict with Show Type dialog 2021-11-11 14:38:07 +01:00
Fedor Isakov 2c8781cc9b Provisional support for custom queries 2021-11-08 13:21:09 +01:00
Fedor Isakov ea47468c3d Cleanup the code, better separation of concerns 2021-11-08 13:21:09 +01:00
Fedor Isakov d09348512d Refactoring: extract Request hierarchy out of TypecheckingService 2021-11-04 12:48:11 +01:00
Fedor Isakov c9a830d730 Cleanup code, rely on Query for presentation 2021-11-04 12:48:11 +01:00
Fedor Isakov af8c50f3e5 Refactor TypecheckingService: parameterize Request with Query 2021-11-04 12:48:11 +01:00
Fedor Isakov 7cc8be7296 Refactor TypecheckingService: move logic to Request, simplify code 2021-11-04 12:48:11 +01:00
Fedor Isakov 96ede52bcc Cleanup typechecking settings page 2021-10-27 16:21:08 +02:00
Fedor Isakov cf04a60cc9 Minor improvements in displaying terms and activation trace 2021-10-26 17:46:41 +02:00
Fedor Isakov ebe463ece5 Fix dangling dependency 2021-10-26 17:46:40 +02:00
Fedor Isakov 257bc196c3 Re-save all models 2021-10-26 17:46:40 +02:00
Fedor Isakov dd4eece1df Refresh build project 2021-09-23 15:20:23 +02:00
Fedor Isakov f3c12ec4af Fix missing dependency 2021-09-23 15:16:17 +02:00
Fedor Isakov 1ed5fa4e4b Update build project 2021-09-22 17:08:25 +02:00
Fedor Isakov 2d52921561 Fix and optimize dependencies 2021-09-22 17:08:25 +02:00
Fedor Isakov 2420685b19 Disable an obsolete test 2021-09-22 17:08:25 +02:00
Fedor Isakov 82b04c23ae Introduce TYPE_COLLECTOR parameter to pass to template application session
The older technique that passed "typeCollector" to query is replaced
with passing this object as a session parameter.
Can be accessed with "CustomSessionParameter".
2021-09-21 17:54:51 +02:00
Fedor Isakov b122872890 Refactor Result to be able to clear the cause 2021-09-21 17:54:51 +02:00
Fedor Isakov 3f606ba63c Refactor the way parameters are passed to expand macro
Instead of the hack that that uses session parameters to pass
parameters to expandMacro, use directly `withParams` method
on macro token. All parameters are mapped to corresponding fields.

Introduce CustomSessionParameter to access parameters in
TemplateApplicationSession.
2021-09-21 17:54:51 +02:00
Fedor Isakov a5105e666a Update build scripts 2021-09-21 17:54:50 +02:00
Fedor Isakov a22d360c13 Add reexport on coderules.runtime in controlflow sample, fix build 2021-08-17 09:30:49 +02:00
Fedor Isakov f96211273c Drop hack for finding refs in LateParameter, switch to internal var ref 2021-08-17 09:30:49 +02:00
Fedor Isakov 6b0526ba31 Introduce language j.m.l.types to contain aspect-related generator mappings 2021-08-17 09:29:21 +02:00
Fedor Isakov b1fbf7265e Update plugin version and platform compatibility 2021-07-29 15:17:18 +02:00
Fedor Isakov c4db4fcafe Set generator options: strict=false in build scripts 2021-07-29 14:18:29 +02:00
Fedor Isakov 617a7d77a5 Fix build script 2021-07-29 12:46:57 +02:00
Fedor Isakov 4ea1d0cadd Feature: isGround and isNonground predicates, MPSCR-94 2021-07-22 13:59:19 +02:00
Fedor Isakov 2425fe933a Ensure dependency is tracked for nested expand macro applications
Expand macro passes the rule's input to nested macro calls.
This adds the macro input as the dependency of the rule's input.
As a result, incremental processing starts working in some cases.
2021-06-30 18:25:46 +02:00
Fedor Isakov c4811d7d74 Migration of types aspect
Add types aspect devkit, remove engaged in generation.
2021-06-29 14:51:10 +02:00
Fedor Isakov dd8c5ffb07 Introduce types aspect devkit and genplan 2021-06-29 14:51:10 +02:00
Fedor Isakov 9ea7ae2067 Better naming scheme for downloadable artefacts 2021-06-21 18:35:48 +02:00
Fedor Isakov 9826290f78 Fix building and packaging the plugins 2021-06-21 17:50:00 +02:00
Fedor Isakov a8b0b13513 Include build solution into coderules plugin; fix file name 2021-06-18 18:41:01 +02:00
Fedor Isakov 9527a097b8 Migrate to the latest MPS release, apply migrations 2021-06-18 18:41:01 +02:00
Fedor Isakov 02baab4100 Optimize AspectLookup: avoid traversing descendants of input 2021-05-18 12:32:03 +02:00
Fedor Isakov 1d620cdd63 Drop obsolete unused features, cleanup the code 2021-05-18 12:32:03 +02:00
Fedor Isakov 24ce9167bf Drop second implementation of aspect lookup, unify usages of AspectLookup 2021-05-18 12:32:03 +02:00
Fedor Isakov 1bb8763816 Refactor AspectLookup to depend on repository, cache results 2021-05-18 12:32:03 +02:00
Fedor Isakov 4ee3869b45 Introduce a means to use direct reference to INamedConcept in rules 2021-05-13 15:54:42 +02:00
Fedor Isakov 637da7d966 Apply migration and rebuild project 2021-05-04 18:24:30 +02:00
Fedor Isakov ea6e930954 Apply migration and rebuild project 2021-05-04 18:24:29 +02:00
Fedor Isakov 287c31c9f7 Process only pattern's top-level node when coercing
Ignore all contents of a pattern but the top level.
This covers most situations.
The pattern ought to provide information as to which
nodes are capturing variables.
2021-04-29 14:53:19 +02:00
Fedor Isakov ab87c8a129 Support strong convert/coerce queries 2021-04-28 08:54:25 +02:00
Fedor Isakov cce261ec8c Fix cleaning up the caches on modules reload 2021-04-28 08:54:25 +02:00
Fedor Isakov 450f2e5989 Fix coerce to pattern with antiquotations.
A node from a pattern with antiquotations is treated as a "hollow"
type with only the form defined, and all parameters being capturing
variables.
This is a workaround for certain kinds of coerce queries that define
unsound pattern nodes.
2021-04-28 08:54:25 +02:00
Fedor Isakov cff18e7ca5 Optimize RulePlanHandler
Avoid iterating over LinkedHashMap (ineffective).
Do topo-sort only once on creating the object.
2021-04-21 10:40:51 +02:00
Fedor Isakov 394cb720c1 Optimize program producing: drop checking of constraints
Constraints arity is no longer checked.
Checking for null arguments to constraints is done
in AbstractConstraint's constructor.
2021-04-19 22:55:09 +02:00
Fedor Isakov ff6b5ec6ae Apply migrations and rebuild project 2021-04-14 13:19:50 +02:00
Fedor Isakov 49357ab87a Drop all usages of "principal store" and "preamble" feature 2021-04-13 22:57:06 +02:00
Fedor Isakov 008887944d Refactor "incremental" tests launcher to not rely on incrementality
The incremental algorithm using history and replay/revalidate of
matches is deprecated and will be removed soon. The incremental tests
are now relying on the UpdataRecorder and RulePlanHandler to
implement incrementality.
2021-04-12 12:47:44 +02:00
Fedor Isakov 1769998f7f Implement Rule.isBasis contract, fix feedback basis processing
Invalidated rules set invalidates feedback that has any of them it in its basis.
Validated rules invalidates feedback that has all of validated
rules in its basis set.
2021-04-12 12:47:44 +02:00
Fedor Isakov 87a843088c Cosmetics: report ERR on a query finished with !success status 2021-04-12 12:47:44 +02:00
Fedor Isakov 1d1db7cba5 Disable all preamble-related stuff 2021-04-12 12:47:44 +02:00
Fedor Isakov 384fc5dce8 Adapt all predicates to try-tell protocol 2021-04-08 12:41:17 +02:00
Fedor Isakov 28dd6c7a12 Implement feedback invalidation based on (in)validated rules
Refactor supervisor/feedback consumer to support feedback basis.
Track (in)validated rules tags in RulePlanHandler.
Both (in)- and validated rules cause associated feedback to be cleared.

Disable passing SessionToken in WatchingIncremental strategy;
this forces the correct journal recording but turns off incrementality.
2021-04-08 08:51:40 +02:00
Fedor Isakov 7c89dfdffd Refactoring in program producing: getting ready to drop incrementality
Optionally produce partial program in incremental mode.
A partial program includes all "static" rules plus the "required closure"
of all changed nodes.
Produce program for required nodes unconditionally.
Mark all rule updates as validated only if exlicitly asked for it.
2021-04-08 08:51:39 +02:00
Fedor Isakov b5ffb8c83c Drop TypesModuleOwner, stop caring to store types in a model
This feature causes major problems and is really hard to maintain,
while its utility is questionable.
2021-04-08 08:51:39 +02:00
Fedor Isakov 636c1a15ef Use tmp model to render type in Show Type Action 2021-04-08 08:51:39 +02:00
Fedor Isakov 99e248c5b3 Fix incremental update of reported feedback
Correctly detect cache up-to-date.
Refactor feedback reporting, provide origin node as the key.
Drop invalidated feedback correctly.
Code cleanup.
2021-03-23 12:48:06 +01:00
Fedor Isakov 2977b4dd19 Extend expand macro operation with rule input parameter, fix tracking dependencies
Enable recording the dependencies while expanding macro.
Rename/refactor operations in UpdatesRecorder to reflect the intent
of adding the dependencies.
2021-03-23 12:48:06 +01:00
Fedor Isakov 39f7ded3f4 Implement missing methods in typechecking provider 2021-03-08 12:34:40 +01:00
Fedor Isakov 7d60ddde46 Drop template trace view tool, merge into activation trace 2021-02-19 14:46:42 +01:00
Fedor Isakov 2ec038aed0 Fix FindApplicableTemplates action 2021-02-18 15:00:28 +01:00
Fedor Isakov 818d4087b2 Fix reported errors disappeared on returning to editor 2021-02-16 13:25:54 +01:00
Fedor Isakov 6a7219f528 Fix using local typechecking if root is null in session flags 2021-02-15 12:29:46 +01:00
Fedor Isakov 1cfe1ccc26 Add dummy empty model to fix build 2021-02-14 15:30:38 +01:00
Fedor Isakov 4755c0dfa0 Extract test helper classes into separate redistributable module 2021-02-14 15:12:58 +01:00
Fedor Isakov d25158b39f Change plugin packaging and versioning
All modules are to be located under languages/.
Version to be RELEASE-0.9-bBUILD
2021-02-13 10:20:09 +01:00
Fedor Isakov bd1753e2ef Fix plugin version number, ensure compatibility with MPS starting from 211 2021-02-08 10:11:58 +01:00
Fedor Isakov a3aa92e60a Temporarily disable test until problems with MPS build are fixed 2021-02-07 19:17:08 +01:00
Fedor Isakov 54cadb200a Repackage plugin 2021-02-06 15:28:03 +01:00
Fedor Isakov ed55370a01 Fix model imports (hamcrest lib has been moved to another solution) 2021-02-04 12:27:55 +01:00
Fedor Isakov 7fe5a5ad7a Auto-updated files after migrating to MPS 2021.1 EAP 2021-02-04 12:26:59 +01:00
Fedor Isakov 676645fad2 Refactor DataForm presentation mechanism, drop unused code
Rewrite most of DataFormPrinter for simplicity.

Reformat presentation of terms, so that the specification comes at the beginning.
2021-02-04 09:16:10 +01:00
Fedor Isakov e06916b184 Refactor TypecheckingService: move logic into Request
Straighten up the code organization by consolidating logic
implementing a request within the corresponding Request
instance.
2021-02-04 09:16:09 +01:00
Fedor Isakov 0e50b0e1b4 Support coerce query to specified (pattern) type
Coerce with pattern expects resulting type to be matched with a node
specified in the pattern.
2021-02-04 08:51:00 +01:00
Fedor Isakov ad269bb6b5 Ensure typechecking state is properly disposed of on reload 2021-02-04 08:51:00 +01:00
Grigorii Kirgizov b1d81ef683 Fix apparent type in DataFormPrinter test 2021-01-29 16:21:57 +03:00
Grigorii Kirgizov 148223a842 Add incremental tests for lambda calc. Enable ignored tests for closures. 2021-01-29 13:39:35 +03:00
Grigorii Kirgizov d1b5c5b477 minor fix in tests: propely hack finding needed aspect clique. allow custom type matchers (for lc) 2021-01-29 13:39:35 +03:00
Grigorii Kirgizov ccecb50fc2 Fix handling of invalidated feedback for effects of Rewind Stage to be visible (MPSCR-67, MPSCR-21) 2021-01-29 13:39:35 +03:00
Fedor Isakov 240fed8f63 Drop Finders feature: unused 2021-01-23 16:59:46 +01:00
Fedor Isakov 536e1aa1c2 Introduce helper methods to factor out creation of terms 2021-01-23 16:59:45 +01:00
Fedor Isakov b3c57465fc Minor refactoring: extract constants for building terms 2021-01-23 16:59:45 +01:00
Fedor Isakov 13627568df Ensure input is processed for fresh cache by setting invalidated to false 2021-01-18 10:59:03 +01:00
Fedor Isakov acc9477512 Drop invalidated flag from cache (unused) 2021-01-18 10:59:02 +01:00
Fedor Isakov dc7a06c685 Ensure typechecking queries get appropriately disposed of for editor session 2021-01-18 10:59:00 +01:00
Fedor Isakov 4be723c09e Introduce programEvaluated flag to strategy, only display traces for real programs 2021-01-18 10:59:00 +01:00
Fedor Isakov 3a5c5dcec4 Avoid keeping cached data by aspect+query kind
This optimization doesn't have any tangible effect.
2021-01-13 17:32:23 +01:00
Fedor Isakov c9f2a34b53 Ensure shared state for basic queries, fix performance of model checker 2021-01-12 22:55:42 +01:00
Fedor Isakov baae5c5bf0 Several interconnected changes to optimize performance in incremental mode
Introduce invalidated flag to program producer to control whether to
only process invalidated nodes in incremental mode.

Update validated flag in RulesPlanHandler to reflect the finalized
state, after the plan has been built.

Refactor ProgramProducer/Factory to avoid enumerating the source
root in case no changes have been detected (in incremental mode).

Avoid relaunching program in case the producer did nothing.
2021-01-12 22:55:42 +01:00
Fedor Isakov d88acbe0f4 Introduce trivial result state 2021-01-12 22:55:40 +01:00
Fedor Isakov 93cbb90fec Avoid aborting execution of helpers in case of error
BlockingExecutor must not block other helpers from being executed
if a error is detected by one of them.
Since helpers are built in unpredictable order, there can be situations
when an (unrelated) error causes intermittent failures.
2021-01-12 22:55:40 +01:00
Fedor Isakov 62e8e7d013 Switch to MPS 2020.3 release. 2021-01-08 11:00:02 +01:00
Fedor Isakov 603787ab2b Fix test that expects same type to be returned from cache, no longer true 2021-01-07 17:04:27 +01:00
Fedor Isakov abb76e68b5 Refactor changes tracking in UpdatesRecorder, use model instead of a ref
Using a model reference require resolving via a repository, which
is unnecessary in case model objects are stored directly.
2021-01-07 13:31:37 +01:00
Fedor Isakov 77b02a4e0e Drop tracking unit cache, rely on UpdatesRecorder to provide incrementality
The idea to use "tracking" cache to save on typechecking operations is obsolete.
There is conflict of responsibilities with UpdatesRecorder,
which is to be solely relied upon for all things related to tracking changes.
2021-01-07 13:31:37 +01:00
Fedor Isakov 4c82ddd622 Autofix references to method decl 2021-01-07 13:31:37 +01:00
Fedor Isakov 0315fca5fa Fix ghost artefacts in activation trace appearing on moving selection up
StyledTreeCellRenderer component received wrong bounding box
because of top border's inset to be set to 1 (see DefaultTreeUI.paint()).
This border is the default set by LookAndFeel.installBorder()
in case the border on tree component is set to null,
which is explicitly set to null in TreeTableTree's constructor (go figure).
2021-01-06 12:43:55 +01:00
Fedor Isakov 26b0f4ac87 Fix helper action items not appearing in inspector 2020-12-27 16:04:06 +01:00
Fedor Isakov eb03d7d218 Include languages imported to all imported models of the model that contains node to check
Some language imports necessary for correct typechecking are obscure.

Example may be a closure type, which requires the type of the operand
(receiver) of the method it serves a parameter to. That, in turn, may
require some type defined in another root and perhaps some other model.
2020-12-27 16:04:05 +01:00
Fedor Isakov 64b33d1a88 Refactor RulesPlanHandler to not depend on AspectClique 2020-12-27 10:36:04 +01:00
Fedor Isakov 43ad19494b Refactor rule processing: straightforward dependencies, simplify code
Enable rule index to be updated during rules application.
Make RuleProcessingSession depend on AspectClique.
Enable updating of rule/macro/query indices.
2020-12-27 10:36:00 +01:00
Grigorii Kirgizov ba8ccfce03 minor: Disable incremental option (that controls Preamble also) for lambdacalc tests
Preamble optimization requires same contracts from programs as full incrementality.
2020-12-15 17:59:10 +03:00
Grigorii Kirgizov 8022fa4203 Add tests for local typeOf query with occurrence cache 2020-12-15 17:59:10 +03:00
Grigorii Kirgizov 27ed01c447 refactoring: Adjust uniqueTag usages for Rule.Tag refactoring
Fix rule basetag generation to coincide with templateName

Needed for PrincipalStore (occurrence cache) which uses
info about occurrence source rule template name.
2020-12-15 17:59:09 +03:00
Grigorii Kirgizov 3eccaf81a1 Introduce occurrence store as cache for their reuse in Queries strategy
It's important that program that uses occurrences from cache
shouldn't include rules that could produce their duplicates.
So implementation of occurence cache includes 2 parts:
on reactor level & in ProrgramFactory.

When RuleBuilders are produced, cache is queried whether
there're already  occurrences associated with the rule template
in question. If so -- then those RuleBuilders are not included
into the program (as well as all RuleBuilders required by it).
2020-12-15 17:59:05 +03:00
Grigorii Kirgizov c455514325 Get more precise info on invalidated nodes (fixes MPSCR-82)
Get information on invalidated nodes from EvaluateStep & incr processing
instead of UpdatesRecorder, which has only partial info and can't handle
all cases.
2020-12-15 17:51:23 +03:00
Fedor Isakov 8dd43190b4 Switch to finding aspect clique for subject node in local typechecking
During generation, the imports set of a transient model doesn't always
reflect the actual set of imported languages.
2020-12-15 13:32:54 +01:00
Fedor Isakov 159de90e6f Exclude free floating nodes from required set
Required nodes w/o a model, or "free floating" nodes
are excluded from the required set.
Instead all their valid references are processed.
2020-12-12 13:48:15 +01:00
Fedor Isakov d4f0c9741f Enable reuse of locally calculated types.
Typechecking results cache is consulted on a request to
locally calculate the type.
2020-12-11 12:03:17 +01:00
Fedor Isakov c7eaa1dbf3 Clean up ProgramEvaluator API. Straighten up passing of session token. Drop RulesDiff usages. 2020-12-08 22:57:36 +01:00
Fedor Isakov 4eab445aa9 Introduce overloaded "require" methods to keep track of dependencies.
TemplateApplicationSession allows to invoke require with the
input node as the first parameter, which is then forwarded as
a "requirement" (TODO: rename to dependency).
2020-12-08 22:57:35 +01:00
Fedor Isakov 616c39ae38 Fix incremental test launcher
The use of ProgramProducer and other stuff have new requirements.
The program is now produced incrementally, with UpdatesRecorder
playing a major role in keeping track of changes.
2020-12-08 22:57:35 +01:00
Fedor Isakov 59db13bf41 Simplify UpdatesRecorder implementation. Fix input processing by ProgramFactory.
Move invalidation logic inside UpdatesRecorder from elsewhere.
Drop type parameters.
Avoid recording dependencies for null input.

ProgramFactory: always process input, not only the first time
2020-12-08 12:50:36 +01:00
Fedor Isakov d637bed114 Enable cache data to be accesible with an Object key. Drop usages of PreambleSet.
PreambleSet exists only to allow to multiplex cached values by
query. There is no need for this now that the key can be a compound one.
2020-12-06 16:14:28 +01:00
Fedor Isakov e2926d8433 Enable reuse of RulesPlanHandler. 2020-12-06 10:52:11 +01:00
Fedor Isakov c6152abdc2 Fix RuleBuilder not processing macro's input concept.
A query may be invoked without the input node, thus dispatching
macros by the specified concept. The concept must be taken into
account when calculating the "diff", so that the old (stale)
rules don't override the updated ones.
2020-11-29 00:20:15 +01:00
Fedor Isakov 010e6cdc61 Minor refactoring: use Queries strategy for local typechecking too. 2020-11-27 10:06:09 +01:00
Fedor Isakov 4165c320ff Avoid throwing NPE on opening project, unload is called on an uninitialized plugin. 2020-11-24 13:48:42 +01:00
Fedor Isakov 73f610b597 Introduce new kind of typechecking query, typeOf, having a subject.
This query kind is to be used in local typechecking.
The idea is to do away with constraints that are not essential for
typechecking a single node, thus making local type computation faster.
2020-11-24 13:41:25 +01:00
Fedor Isakov acc3167e21 A bunch of optimizations and minor refactorings.
Consolidate options, configure all from typechecking plugin.
Introduce a computable option to control using traces.

Introduce shared state to be used at generation time.
Drop repository cache holder, replace with a field in state.
Fix singleton type collector.

Fix memory leak in strategy by cleaning it up after execution.
2020-11-24 13:41:25 +01:00
Fedor Isakov 5ce60c1398 Minor refactoring in typechecking service component: simplify code. 2020-11-24 13:41:25 +01:00
Fedor Isakov 4d79fbf263 Fix various issues arizing during generation time.
Avoid dereferencing DynamicReference from OriginIndex as it involves typechecking computation.
Aviod enqueing type nodes with TypesModelHandler during generation,
a workaround for "mature" references unable to be resolved
if target is in a transient (unpublished) model. (MPS-32709)
Ensure "local" typeof computation is used when queries a created with null root.
2020-11-24 13:41:25 +01:00
Fedor Isakov 1c04ec1a1d Avoid NPE in highlighting step if previous step(s) failed. 2020-11-24 13:41:24 +01:00
Fedor Isakov 2c8f1a9294 Disable baseline time when running typechecking query. 2020-11-24 13:41:24 +01:00
Fedor Isakov 9c616971e1 Ensure all relevant languages are searched for aspects.
It might be necessary to look a little further into the input node's
referenced nodes to gather all relevant models for recovering
types aspects. Example: a type in BL may extend another BL type
parameterized by a non-BL type, such as node<>.
2020-11-24 13:41:24 +01:00
Fedor Isakov 59f653aeee Enable incremental option in test.
Now that "main" constraint is a principal one the test passes.
2020-11-24 13:41:24 +01:00
Grigorii Kirgizov c44e3a7fd8 Upd buildscripts 2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 42bc7a88fd Modify incremental tests to allow testing other queries, add test 2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 1254ebd632 Handle case of query rules in PreambleInfo
Also process expand macro input for rule hash,
so that changed query rules (like one in testlang) get into
RulesDiff and could be updated with Preamble processing.
2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 9d3b7e1fba Add program Preamble as SessionToken, use it in Queries strategy
Program Preamble consists of 2 parts: rules & Journal.
Preamble rules are no-input rules with rules for their required nodes.
Preamble journal is journal part with results of executing these rules.
Preamble is defined per-Query, because Journal differs for Queries.

Repository CacheHolder is used for storing them b/w sessions.
Rules are stored and  retrievied with Memoizer.
Journal is stored as SessionToken in PreambleSet (map Query->SessionToken).

Add option to IncrementalSpec -- incrementality level (Preamble or Full).
2020-11-10 10:40:06 +03:00
Fedor Isakov bf7bad4b4a Drop mockito lib, replace with ad-hoc solution, fix the tests. 2020-10-25 00:17:25 +02:00
Fedor Isakov 930100a47b Several fixes that guarantee stable order of rules in the program.
Ensure the order of rules in the resulting plan follows the priorities
set forward by extends relationship b/w languages. So that even if
rule template tables are unrelated, they are still ordered according to
language extension graph.
Ensure the order of rule lists in the resulting plan is stable b/w invocations of
RulesPlanHandler.allPlans().
Ensure the order of aspects in AspectClique is stable b/w invocations
of buildClique().

Associate RuleTemplatesTable with Manifest, and Manifest with CoderulesAspect.
Tentatively rename RulesList (the runtime object) to RulesPlan,
RulesListTable to RulesPlanHandler.
2020-10-23 12:26:30 +02:00
Grigorii Kirgizov cc9c4c54b3 Specify notion of required nodes: separately for tmpl application & for UpdatesRecorder
Too many nodes get into tmpl application process, which is unnecessary.
Many of those nodes are required actually only for correctly tracking
changes to nodes with WatchingTypecheckingStrategy.

Now implicitly required only nodes which are mentioned inside
constraint arguments. In other cases user must require them explicitly.
2020-10-23 12:26:30 +02:00
Grigorii Kirgizov 99c823d4f7 Integrate tmpl trace in ApplyTemplatesStep with TypecheckingOptions
Introduce TraceReport object for passing program results
(traces+report items) instead of using tuples.
2020-10-08 17:34:43 +03:00
Grigorii Kirgizov 1de365de9c Introduce trace tool for rule template application 2020-10-08 17:34:42 +03:00
Fedor Isakov 25e8e5fd78 Clear shared caches on releasing queries for generator. 2020-09-15 13:32:43 +02:00
Fedor Isakov 613b981977 Refactor UpdatesRecorder for better handling of nodes invalidation.
Alter the way invalidated nodes are handled by UpdatesRecorder.
A set of "source" nodes is now maintained, which helps to
detect the appropriate input for a changed node.
Templates are applied only to "new" or "invalidated" nodes.
2020-09-13 13:31:03 +02:00
Fedor Isakov 534c4832ce Re-saved models -- update resolve info. 2020-09-10 09:59:42 +02:00
Fedor Isakov 2d9e3547b6 Refactoring: simplify RelevantNodes[Tracker -> Monitor], drop interface and stub impl.
Rename TypeDependenciesNodeTracker to RelevantNodesMonitor and
have it the only implementation.
The "stub" implementation was never really used.
Simplify creation of and access to the monitor.
2020-09-10 09:57:53 +02:00
Fedor Isakov 9c7307286b Minor refactoring of UpdatesRecorder: straighten up API, better encapsulation. 2020-09-10 09:53:01 +02:00
Fedor Isakov 74e8eb86b1 Drop unused method in TemplateApplicationSession 2020-09-10 09:53:01 +02:00
Fedor Isakov 2d9861e8a2 Avoid triggering NPE on calling ProviderInitToken.deactivate. 2020-09-10 09:53:01 +02:00
Grigorii Kirgizov 3a8bff821f Don't process macro args in 'usedDataHash' in RuleBuilder: it's unnecessary
Commit f9ca9f27 handles hash of macro bodies, making this functionality unnecessary.
Potentially less nodes can pass into 'required'.
2020-09-01 13:37:45 +03:00
Fedor Isakov 394459b17b Refactor typechecking cache to avoid updating model roots.
Instead of copying cached data just re-plant the fields to the new cache.
The new types-model to contain only the newly reported types. Types reported on earlier invocations are retained
in previously created models.
2020-08-20 14:20:52 +02:00
Fedor Isakov ca62bb0781 Ensure queries cache gets cleared even with no root node. 2020-08-20 14:20:52 +02:00
Fedor Isakov 248f71bb1d Drop unused overridden methods. 2020-08-20 14:20:52 +02:00
Fedor Isakov f085d10369 Temporary fix for tests: set tracking=true in TypecheckingTesetHelper.checkTypes(). 2020-08-14 17:42:19 +02:00
Fedor Isakov 54439e255e Refactor typechecking state/cache subsystem.
Refactor whe way TypecheckingResultsCache is updated:
all mutatiting methods extracted to Update subclass, which is
only available to the updater.

Make TypecheckingState a regular container for (unit) caches.
Make TypecheckingService responsible for managing caches.

Extract TypeModuleOwner and TypeModelHandler classes.
Get rid of QueryResultsCache, merge into TypecheckingResultsCache.
TypeModuleOwner to manage "repository" cache.
2020-08-14 16:57:36 +02:00
Fedor Isakov 905e11ac33 Refactor TypecheckingService API: simplify usage, extract Request.
Request is to keep all the parameters of a given API call,
whereas TypecheckingService is to handle the state between
calls.
2020-08-14 16:17:23 +02:00
Fedor Isakov d07b1d1517 Add option to report evaluation results. Reorganize options in pref pane.
When running typechecking with trace=on too much memory is taken up
by the traces, the new option enables to see the evaluation results
without collecting the traces.
2020-08-12 12:38:51 +02:00