Commit Graph

45 Commits

Author SHA1 Message Date
Fedor Isakov 4ce08f4b99 Refactor project structure and reduce the number of modules 2024-07-04 18:17:56 +02:00
Fedor Isakov 8d9b3d4730 Fix behaviour method signature 2023-10-13 18:13:09 +02:00
Fedor Isakov de9fd05c45 Intentions and methods to facilitate working with macros 2023-10-13 18:13:09 +02:00
Fedor Isakov 530ace6399 Rework editor for expand macro template and prototype
Expand macro prototype: "virtual macro".
Expand macro template: "override".
Override macro displays parameters declared in the prototype as R/O.
Introduce "usages" of prototype parameters to serve as local anchors;
this avoids problems with generation.
The existing code is going to work as before, but marked as erroneous
until migrated.
2023-10-04 12:52:09 +02:00
Fedor Isakov 3cf666e633 Apply migrations and make project 2023-07-31 12:57:24 +02:00
Fedor Isakov 6a849f82f2 Apply migrations and rebuild project 2023-06-12 12:01:02 +02:00
Fedor Isakov ad3ea9d63d Apply all migrations from 2022.2 2022-11-21 11:25:13 +01:00
Fedor Isakov 77eb3f30c7 Implement a missing BH method 2022-06-13 11:11:57 +02:00
Fedor Isakov 874a2a4b4e Ensure rule tags have unique group name 2022-05-25 13:49:11 +02:00
Fedor Isakov 2f34591b0b Support list feature in recovery 2022-02-08 10:09:40 +01:00
Fedor Isakov ff6b5ec6ae Apply migrations and rebuild project 2021-04-14 13:19:50 +02:00
Fedor Isakov 5e147837ec Drop node pointer in QueryTemplate behaviour 2020-12-30 18:28:46 +01: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 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
Fedor Isakov 29ffc46fa4 Introduce ProvideFeedbackOperation: enable providing feedback from templates.
Operations such as 'error' and 'warning' are available on input
node in templates and serve to report issues found during
template application, in contrast with those found during evaluation.
2020-07-13 18:14:12 +02:00
Grigorii Kirgizov ad9f02dd7d Fix rule name generation (consider query rules also). Sort results of principals analyzers
Also deprecate unsude 'queryName' prop in QueryTemplate
(it inherits from INamed.. so it has name, which is used)
2020-07-01 14:36:48 +03:00
Fedor Isakov 5c376168b4 Introduce match constraint.
Match constraint is provided for use cases where the intention
is to pattern-match a term capturing features into logical
variables.
A term constructor in the right-hand side of match constraint
is a pattern, and all its non-overridden features are
to be defined as wildcards.
2020-06-18 13:05:24 +02:00
Grigorii Kirgizov f3d62dbc94 Handle MacroTemplates in principal constraints analysis
It's possible to activate constraints in macros, so they must be also handled.
Also restrict a bit principal rules analysis: consider only rules with template input.
2020-06-08 19:02:20 +03:00
Grigorii Kirgizov 9bbcf6ecef Allow terms to inherit features from ancestor terms
Avoides the need to exactly duplicate features of ancestors.
Opens possibility to match on super-terms
with partially provided (overriden) features.

For example, suppose there's `typeParameterized(child: param)`
term which is extended by `classifier` and `methodSignature`.
Then it becomes possible to write a common rule for both terms,
matching on `typeParameterized(param=[Smth])`.
2020-05-21 16:31:36 +03:00
Fedor Isakov 14780b5561 Apply automatic migrations. 2020-05-09 15:04:25 +02:00
Fedor Isakov d3a72049e8 Drop deprecated stuff from coderules lang. 2020-05-05 15:58:48 +02:00
Fedor Isakov f43b262e7f Introduce helper behaivour methods to be used from typesystem. 2020-05-05 10:19:38 +02:00
Fedor Isakov 866cd3fb04 Support extends relation between term tables.
A term table is now allowed to extend another term table.
Term prototypes can be imported through extends relation.
2020-04-28 12:54:35 +02:00
Fedor Isakov 33739d7303 Support query table in generator templates.
Runtime switched to use newly generated query table definitions.
2020-04-23 10:15:39 +02:00
Fedor Isakov 71dadaff0f Redesign query template to accept Query as parameter
Introduce QueryParameter as the way to refer to Query instance
in templates.
Introduce QueryTable.
2020-04-22 11:24:19 +02:00
Fedor Isakov 20263ea520 Delete a bunch of deprecated/unused/obsolete concepts.
The API calls are deprecated and result in UnsupportedOperationException.
2020-04-19 16:30:11 +02:00
Fedor Isakov ed821053ec Rename concepts for consistency to Term*. Move one more concept to coderules. 2020-04-13 18:00:15 +02:00
Fedor Isakov a0bc96b3e0 Move all concepts related to term to j.m.coderules. 2020-04-13 17:58:34 +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 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
Fedor Isakov 0d7316adf4 Introduce LogicalItemValueExpr, deprecate ValueOfExpr, migration.
LogicalItemValueExpression is to play the same role as valueOf(logical)
within an instance of EvaluationSubject.
LogicalItemExpression is to represent the logical variable itself.
2020-02-12 12:18:30 +01:00
Fedor Isakov fa4537dbc3 Introduce BodyBlock to contain multiple body clause lists. Support multi-line body. Migration. 2020-02-06 12:50:26 +01:00
Fedor Isakov c15c6694de Ensure all rule parameters of same type are displayed on separate lines. Deprecte ParameterContainer. Migration. 2020-02-05 17:02:31 +01:00
Fedor Isakov f92148094a Drop long deprecated concepts with zero instances. 2019-11-11 13:53:41 +01:00
Fedor Isakov c797b5d2ad Breaking change: logical vars must be declared by constraint rule that uses them.
Stronger rules for logical variables scope: constraint rule can't reference logical variable defined in another constraint rule. Logical variable definitions are localized to ConstraintRule template.
Simplify/cleanup the logic of searching for available logical variables.
2019-10-25 22:45:55 +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 bd1c56d9d0 Rename concept Handler -> RulesList 2019-05-09 17:30:14 +02:00
Fedor Isakov adcfba5e9a Introduce two built-in predicates to be used instead of eval(false) etc.: fail and report message (debug/info/warning/error/fatal). 2019-02-18 11:49:11 +01:00
Fedor Isakov 19ce84f7ef Switch to 2018.3 RC. Apply all migrations. 2018-11-28 16:48:59 +01:00
Fedor Isakov 0bacffb611 Move type setting operation to typechecking lang. 2018-07-22 11:09:49 +02:00
Fedor Isakov ea9919f38a Bring the hierarchy of DataForm concepts in line with the runtime.
Merge DataForm constructors into logic language.
Repackaging logic runtime.
Drop obsolete code.
2018-07-21 13:29:22 +02:00
Fedor Isakov a8e6c565b5 Rename the language and runtime solution: typesystem2 -> coderules. Move typechecking-related stuff to typechecking solution. Reorganize modules, delete obsolete stuck files. 2018-06-12 18:00:30 +02:00