Commit Graph

68 Commits

Author SHA1 Message Date
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 42d9970172 Extend ValueFeature with type, deprecate getter 2021-09-21 17:54:50 +02:00
Fedor Isakov 5bd41f1098 Introduce typechecking term table 2021-08-17 09:30:35 +02:00
Fedor Isakov 4ea1d0cadd Feature: isGround and isNonground predicates, MPSCR-94 2021-07-22 13:59:19 +02:00
Fedor Isakov e03a65760c Adjust style for fail constraint 2021-06-18 18:41:00 +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 a9fc3db841 Migrate to TermFeatureOverrid to LogicalItem
Deprecate TFO.getter
Disable entering LogicalItemExpression
2021-05-04 18:24:29 +02:00
Fedor Isakov ff6b5ec6ae Apply migrations and rebuild project 2021-04-14 13:19:50 +02:00
Fedor Isakov c450462fa5 Drop "final" flag on term feature: unused 2021-01-23 16:59:45 +01:00
Fedor Isakov 4991536db1 Fix diff view showing insertion wrongly, dont assume vertical layout 2021-01-23 16:59:42 +01:00
Fedor Isakov 32b11c0c7f Introduce memo expression to enable memoization of values.
During template application memo can be used to store results
of a computation in the session. The memo will be automatically
cleared on an event that invalidates the caches.
2020-07-30 17:14:40 +02: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
Fedor Isakov d5a259bbde Re-apply all re-runnable migrations (one fix). 2020-07-11 15:59:51 +02: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
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 2dc2191be3 Editor improvement: auto-substitute name from target concept for rule templates. 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 3e65376561 Drop deprecated stuff from coderules lang and runtime. 2020-04-22 12:07:50 +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 296b3e9271 Re-apply all rerunnable migrations. 2020-04-13 17:58:33 +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 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 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 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
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
Fedor Isakov 2e9a1e8dbf Support deleting pattern from logical variable in head. 2020-02-26 16:08:50 +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 ee36d879b3 Make better editor for provide feedback and fail constraints. 2020-02-20 11:59:28 +01:00
Fedor Isakov 25585f9166 Deprecate assert constraint: a simple $() should serve. 2020-02-12 10:53:40 +01:00
Fedor Isakov 115c368a2f Reconcile different syntaxes for ExpressionConstraint and LateExpression. Use $() for both.
This is an important change in coderules syntax: all expressions to be evaluated from
constraints/predicates are to be wrapped in parentheses and preceded by dollar sign.
So, instead of eval/backticks the new syntax is to be used: $(<expression>).
Also the expressions to be passed to "feedback reporting" predicates are to be wrapped similarly.
2020-02-12 10:53:40 +01:00
Fedor Isakov a35b5b46ec Deprecated condition block in rule template, isApplicable method in API. Migration to use if statement instead. 2020-02-07 13:14:24 +01:00
Fedor Isakov 73219399f4 Deprecate unused flag "principal" in rule template, drop usages. 2020-02-07 12:05:45 +01:00
Fedor Isakov b76ed3d3e0 Add folding to rule list editor, fix constraint rule editor. 2020-02-07 11:58:11 +01:00
Fedor Isakov 3ae40153a2 Un-deprecate local logical var declaration, drop MITM concept. 2020-02-07 11:33:26 +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 58a1cf16fe Introduce TermType (term) to be represented as "DataForm" in runtime. Migration to specify term type where expected. 2020-02-05 12:24:40 +01:00
Fedor Isakov b6e4e80010 Coderules/logic editor: support entering standalone item as logical clause, allow to type = and == naturally. 2020-02-04 17:34:38 +01:00
Fedor Isakov 9403087c11 Drop RepositoryProvider interface (unused). 2020-02-04 11:43:20 +01:00
Fedor Isakov f92148094a Drop long deprecated concepts with zero instances. 2019-11-11 13:53:41 +01:00
Fedor Isakov bb8fffc7ea Enable to use origin{} block to specify no origin.
Rules that are used only as auxiliary resolvers don't have an associated
origin node, even though they are produced from a specific location.
To enable tracking of correct origin to report errors to one can use
origin(no origin){} to override the default behaviour.
2019-11-05 18:46:02 +01: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