Commit Graph

456 Commits

Author SHA1 Message Date
Fedor Isakov 4845e120e9 Introduce termlist type, rename multilogical type to logical[]. 2020-04-13 17:58:33 +02:00
Fedor Isakov e8a19249e6 Migration to replace spliced LogicalItemExpression on a list node.
Usually one uses Splice with LogicalItemExpression wrapping a logical variable.
Using LogicalDataForm wrapping same variable makes Splice unnecessary.
In order to keep code readable these are wrapped again in a cons list.
In general, one should avoid using bare LogicalDataForm, as these are
indistiguishable from normal LogicalVariable.
2020-04-13 17:58:33 +02:00
Fedor Isakov 065aac819c Introduce construct to directly insert term constructor in data form.
Usually one uses Splice with LogicalItemExpression wrapping a constructor.
The new TermConstructorDataForm provides a shortcut.
2020-04-13 17:58:33 +02:00
Fedor Isakov 2af087428d Document j.m.logic language. Rearrange virtual packages. 2020-04-13 17:58:33 +02:00
Fedor Isakov 922fe7ef2e Prevent bad migrations from being re-applied.
Replacing of == with = is not always justified.
ListNodeCons is now deprecated and already replaced with
new concept.
2020-04-13 17:58:33 +02:00
Fedor Isakov 1109471f9a Replace usages of MultiMetaLogical with MetaLogicalArray.
The new class MetaLogicalArray does not inherit from MetaLogical,
which should help catch subtle bugs related to errors in
generator code.
2020-04-13 17:58:33 +02:00
Fedor Isakov 73beb56834 Introduce ConsListNode to replace a deprecated concept. Migration.
Prefer aggregation over inheritance: ListNodeCons extending ListNode
is not a good design.
Also drop LogicalUnrapContext, as it has no real use.
2020-04-13 17:58:33 +02:00
Fedor Isakov cf77688a71 Replace instances of deprecated ListRole with ChildRole. 2020-04-13 17:58:33 +02:00
Fedor Isakov def1d9fbc6 Optimize generator, drop usages of ListRole. 2020-04-13 17:58:33 +02:00
Fedor Isakov b3d71ad13d Drop unused method from ListNode, simplify dataform-logical bridging. 2020-04-13 17:58:33 +02:00
Fedor Isakov 021853b996 Documenting LogicalUtil, minor refactorings.
MetaLogical are accessed through MetaLogicalFactory in generated code.
2020-04-13 17:58:33 +02:00
Fedor Isakov 749f60e665 Deprecate a bunch of obsolete concepts. 2020-04-13 17:58:33 +02:00
Fedor Isakov 4a60bc36f6 Migrate test lang to new macro system. 2020-04-13 17:58:33 +02:00
Fedor Isakov ace1303a96 Fix analysis to support new pseudo constraints. 2020-04-13 17:58:32 +02:00
Grigorii Kirgizov d00b55e679 Provide more robust way to discover a single aspect clique for nodes in TypecheckingActions
Several aspect licques can be found, some irrelevant
(e.g. for typechecking.annotation lang), so a relevant
clique must be chosen.
2020-04-13 12:41:12 +03:00
Grigorii Kirgizov 6348f89d34 Achieve regeneration of rules from deep changes to "imported" data
requiredHash of a rule now includes hashes not only of SNode & SNodeRef
but also of anything except Coderules rt types (e.g. MetaLogical & DataForm).
The motivation is that if something else is used -- then it must come
from AST, so the rule must be regenerated on any changes to that data.
requiredHash is renamed to usedDataHash to reflect that fact.

In particular, fixes dependence of IndexedTupleAccess rule on idx
from `idx = tuple.index.getCompileTimeConstant()`.
2020-04-12 16:11:44 +03:00
Grigorii Kirgizov 27f26047d3 Fix aspect lookup for typechecking actions and coerceTo query
Not all used languages were collected in case of buliding
aspect clique by nodes -- use model of nodes instead.
2020-04-08 19:55:25 +03:00
Fedor Isakov 9a8b3585d7 Fix runtime and generator to support queries and call macros.
Expand macro supports dispatching by concept.
Logical variables declared on macro's body are init'ed in apply method.
Enable the hack to ensure dependencies on macro input are tracked.
2020-03-31 18:43:22 +02:00
Fedor Isakov f261002feb Introduce extends clause in macro table. Drop name from expand macro.
Macro table can extend another macro table. All prototype template
declarations are imported automatically.
The editor now substitutes default values when entering new
expand macro/constraint filling the slots provided by the prototype.
Expand macro does not require name.
Minor editor improvements.
2020-03-31 11:27:09 +02:00
Fedor Isakov a2b369b9c3 Specify logicals on every expand template. Minor editor improvements.
Expand macro template must have declaration of logicals matching
exactly the logical declarations in the prototype.
Can't refer to logicals declared directly in the prototype.
2020-03-31 11:27:09 +02:00
Fedor Isakov 28d21f5349 Cleanup in macro runtime, expand macro parameter access.
Parameters can be specified for call macro only.
Logicals can be specified for expand and call macro.
Expand macro params are treated exactly as "context"
parameters.
2020-03-31 11:27:09 +02:00
Fedor Isakov 4260346cb9 Introduce expand/call macro pseudo constraints.
The old expand/call constructs are to be replaced by these.
Expand macro constraint refers to a named prototype, which
is specified in a macro table for matching concept.
Call macro constraint refers directly to a macro template.
Contex parameters are to be retired and explicit
parameters to expand macro constraint are to be used instead.
2020-03-31 11:27:09 +02:00
Fedor Isakov 6672ab21e8 Runtime support for new expand and call macro constraints. 2020-03-31 11:27:09 +02:00
Fedor Isakov a72327630e Implement runtime support for call and expand macro templates. 2020-03-31 11:27:09 +02:00
Fedor Isakov ea670422f1 Introduce ExpandMacro template and prototype.
ExpandMacroTemplate to be used for dispatching macro invocations
based on the concept of the specified node.
Prototype is an abstraction to be implemented by
specific templates.
2020-03-31 11:27:09 +02:00
Fedor Isakov d5ea8e8006 Introduce CallMacroTemplate, necessary refactorings. MPSCR-25
Call macros are to be parameterized with logicals and other parameters.
To replace combined expand/call macros causing confusion.
Context parameters to be passed explicitly.
2020-03-31 11:27:09 +02:00
Grigorii Kirgizov b6aaec8870 Revert temporary workaround for MPSCR-51 from 16e39a93 2020-03-23 14:39:54 +03:00
Grigorii Kirgizov 91e4d2b582 Revive 'principal' rule feature for MPSCR-51. Mark those rules in BL typesystem.
Introduce 'auxiliary/essential' notions instead of 'principal/not principal'.
2020-03-23 14:28:14 +03:00
Grigorii Kirgizov 16e39a9345 Check applicable scope for certain checking rules in BL (workaround for BL for MPSCR-51). Fix SubclassingUtil.
Modified TYPECHECK query to include "checkingScope" query parameter:
it is a root node for which program is generated (for local typechecking it's local node).
Rules additionally match on a constraint `checkDecls(node<>)` bearing this node,
so while rules will be generated for all scopes, only those in applicable scopes will run.

Also split rule for EnumConstantDeclaration on declration checking and just typing rule.
2020-03-17 17:54:38 +03:00
Grigorii Kirgizov 831871a81b minor refactor: drop few usages of LogicalDataForm.logical() which were used for checking equality, use appropriate .symbol() instead 2020-03-06 14:04:18 +03:00
Grigorii Kirgizov 7f840e2899 Refactor: drop deprecated Path class and DataForm.attached() method operating on it 2020-03-06 14:04:18 +03:00
Grigorii Kirgizov 92f95674b3 Refactor: drop meaningless DataForm.asRoot (used symbolPath which is deprecated) 2020-03-06 14:04:18 +03:00
Grigorii Kirgizov f5f1fe3916 Reproduce cause of MPSCR-45 in unification solver 2020-03-06 14:04:18 +03:00
Fedor Isakov 485eedea5e Ensure no infinite recursion is possible in toString.
Scheduler in rxjava2-swing seems to cause a peculiar bug
that is difficult to reproduce.
Seems like AtomicReference or one of its subclasses
gets itself as the value, which triggers infinite recursion.
2020-03-05 22:18:13 +01:00
Fedor Isakov 77c44e9066 Ensure RxSwingPlugins is unset and scheduler initialized. 2020-03-05 18:18:20 +01:00
Fedor Isakov 5a16c4d23b Drop ModelPropertiesChecker temporarily from CheckProjectModules test. 2020-03-05 16:48:04 +01:00
Fedor Isakov 8328467a54 Fix java stub locations for RxJava. 2020-03-05 16:23:47 +01:00
Fedor Isakov a894b33983 Update to the latest RxJava2 and Swing adapter. 2020-03-05 15:49:04 +01:00
Fedor Isakov 719956007a Increase timeout to 10 sec, try to fix the test. 2020-03-05 10:11:37 +01:00
Fedor Isakov fec446f006 Drop wrapping substitutions in favour of regular actions.
The editor for evaluating late expression inserts $() construct
first, then allows to enter the expression.
A couple of minor fixes and a workaround.
2020-02-27 14:48:37 +01:00
Grigorii Kirgizov a619b017ec Fix NPE in UpdatesRecorder on roots move/remove
In such cases typechecking was failing on the point of computing changeSetClosure,
because changeSet got null nodes from SNodeChangeEvents
2020-02-26 18:58:05 +03:00
Grigorii Kirgizov 707982fbe9 Include changed nodes from different roots in invalidated set for incremental program update. (MPSCR-46)
The core chang in is InvalidateAndApplyTemplatesStep.
Also rename SNodeEventsFilter to RelevantNodesTracker.
2020-02-26 18:58:05 +03:00
Grigorii Kirgizov 025232969d Track change events from all referred models (MPSCR-46)
UnitTypecheckingCacheHolder now holds the data needed for ChangesTrackers.
This data is updated by UpdatesRecorder: different models and nodes from different roots are tracked.
2020-02-26 18:58:05 +03:00
Fedor Isakov 2e9a1e8dbf Support deleting pattern from logical variable in head. 2020-02-26 16:08:50 +01:00
Fedor Isakov f2bb87e1b0 Apply migration to replace deprecated concept. 2020-02-26 15:03:31 +01:00
Fedor Isakov c064972266 Deprecate obsolete concept, provide migration. Minor editor fixes.
ExpressionLogicalVariable is replaced with ExpressionItem wrapping
the same expression.
Fixes ensure correct application of transformations.
Late expression can't be used as "placeholder" logical item.
2020-02-26 15:01:29 +01:00
Fedor Isakov 2a5b3661b8 Use EvaluationSetting tag for constraint context.
Concepts supposed to contain constraints are
effectively implementing evaluation setting.
2020-02-24 22:57:05 +01:00
Fedor Isakov 7ba7c983cb Apply migration to use logical variable ref expression. 2020-02-24 22:57:05 +01:00
Fedor Isakov 630fd33629 Introduce logical var reference expression.
This expression is to be used in those rare cases
when a logical var is to be passed to an external method.
Not available within EvaluationSetting (new marker interface).
Normally logical variable (as an instance of LogicalItem)
is only to be used within a logical context.
Logical item value expr only to contain a logical variable.
2020-02-24 22:56:54 +01:00
Fedor Isakov 2c43762f93 Replace all instances of .pointer in constraints to node reference.
SNode is supported now directly as an argument to constraint/predicate.
Pointer operation is no longer necessary, as is node-ptr<> type for logical vars.
2020-02-20 11:59:28 +01:00