You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2020/12/26 03:24:31 UTC

[incubator-nlpcraft] branch NLPCRAFT-178 updated: WIP on refactoring flow matching imp (compiles BUT does not work yet).

This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch NLPCRAFT-178
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-178 by this push:
     new f84f793  WIP on refactoring flow matching imp (compiles BUT does not work yet).
f84f793 is described below

commit f84f793b7cf803a5335c9a764bdd0f7ea72ebca3
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Fri Dec 25 19:24:20 2020 -0800

    WIP on refactoring flow matching imp (compiles BUT does not work yet).
---
 .../model/intent/impl/NCIntentDslCompiler.scala    |  46 +-
 .../model/intent/impl/NCIntentSolver.scala         |  17 +-
 .../model/intent/impl/NCIntentSolverEngine.scala   |  57 +-
 .../model/intent/impl/antlr4/NCIntentDsl.g4        |  18 +-
 .../model/intent/impl/antlr4/NCIntentDsl.interp    |  10 +-
 .../model/intent/impl/antlr4/NCIntentDsl.tokens    |  16 +-
 .../impl/antlr4/NCIntentDslBaseListener.java       |  50 +-
 .../intent/impl/antlr4/NCIntentDslLexer.interp     |   8 +-
 .../model/intent/impl/antlr4/NCIntentDslLexer.java | 193 ++---
 .../intent/impl/antlr4/NCIntentDslLexer.tokens     |  16 +-
 .../intent/impl/antlr4/NCIntentDslListener.java    |  42 +-
 .../intent/impl/antlr4/NCIntentDslParser.java      | 819 +++++++--------------
 .../model/intent/utils/NCDslFlowItem.scala         |  43 --
 .../nlpcraft/model/intent/utils/NCDslIntent.scala  |  30 +-
 .../intent/impl/NCIntentSolverEngineSpec.scala     |  34 +-
 15 files changed, 426 insertions(+), 973 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentDslCompiler.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentDslCompiler.scala
index edb8591..cf7082e 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentDslCompiler.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentDslCompiler.scala
@@ -22,7 +22,7 @@ import org.antlr.v4.runtime._
 import org.antlr.v4.runtime.tree._
 import org.apache.nlpcraft.model.NCToken
 import org.apache.nlpcraft.model.intent.impl.antlr4.{NCIntentDslBaseListener, NCIntentDslLexer, NCIntentDslParser}
-import org.apache.nlpcraft.model.intent.utils.{NCDslFlowItem, NCDslIntent, NCDslTerm, NCDslTokenPredicate}
+import org.apache.nlpcraft.model.intent.utils.{NCDslIntent, NCDslTerm, NCDslTokenPredicate}
 import org.apache.nlpcraft.common._
 
 import scala.collection.JavaConverters._
@@ -46,9 +46,8 @@ object NCIntentDslCompiler extends LazyLogging {
         private var ordered: Boolean = false
         private var id: String = _
         private val terms = ArrayBuffer.empty[NCDslTerm] // Accumulator for parsed terms.
-        private val flow = ArrayBuffer.empty[NCDslFlowItem] // Accumulator for flow items.
-        private val flowItemIds = mutable.HashSet.empty[String] // Accumulator for flow items IDs.
-    
+        private var flowRegex: Option[String] = None
+
         // Currently parsed term.
         private var termId: String = _
         private var termConv: Boolean = _
@@ -70,7 +69,7 @@ object NCIntentDslCompiler extends LazyLogging {
             require(id != null)
             require(terms.nonEmpty)
             
-            NCDslIntent(id, ordered, flow.toArray, terms.toArray)
+            NCDslIntent(id, ordered, flowRegex, terms.toArray)
         }
     
         /**
@@ -99,7 +98,7 @@ object NCIntentDslCompiler extends LazyLogging {
         }
     
         override def exitTermId(ctx: NCIntentDslParser.TermIdContext): Unit = {
-            termId = ctx.ID().getText
+            termId = ctx.ID().getText.trim
         }
 
         override def exitTermEq(ctx: NCIntentDslParser.TermEqContext): Unit = {
@@ -107,8 +106,8 @@ object NCIntentDslCompiler extends LazyLogging {
         }
 
         override def exitMinMaxRange(ctx: NCIntentDslParser.MinMaxRangeContext): Unit = {
-            val minStr = ctx.getChild(1).getText
-            val maxStr = ctx.getChild(3).getText
+            val minStr = ctx.getChild(1).getText.trim
+            val maxStr = ctx.getChild(3).getText.trim
             
             try
                 setMinMax(java.lang.Integer.parseInt(minStr), java.lang.Integer.parseInt(maxStr))
@@ -117,13 +116,17 @@ object NCIntentDslCompiler extends LazyLogging {
                 case _: NumberFormatException ⇒ assert(false)
             }
         }
-    
+
+        override def exitFlowDecl(ctx: NCIntentDslParser.FlowDeclContext): Unit = {
+            flowRegex = Some(ctx.qstring().getText.trim)
+        }
+
         override def exitIntentId(ctx: NCIntentDslParser.IntentIdContext): Unit = {
-            id = ctx.ID().getText
+            id = ctx.ID().getText.trim
         }
     
         override def exitOrderedDecl(ctx: NCIntentDslParser.OrderedDeclContext): Unit = {
-            ordered = ctx.BOOL().getText == "true"
+            ordered = ctx.BOOL().getText.trim == "true"
         }
     
         override def exitTerm(ctx: NCIntentDslParser.TermContext): Unit = {
@@ -135,7 +138,7 @@ object NCIntentDslCompiler extends LazyLogging {
                 termId,
                 new java.util.function.Function[NCToken, java.lang.Boolean]() {
                     override def apply(tok: NCToken): java.lang.Boolean = p.apply(tok)
-                    override def toString: String = p.toString() //ctx.item().getText
+                    override def toString: String = p.toString().trim //ctx.item().getText
                 },
                 min,
                 max,
@@ -154,25 +157,6 @@ object NCIntentDslCompiler extends LazyLogging {
             rvalList += rval
         }
     
-        override def exitFlowItemIds(ctx: NCIntentDslParser.FlowItemIdsContext): Unit = {
-            val id = ctx.ID()
-            
-            if (id != null)
-                flowItemIds.add(ctx.ID().getText)
-        }
-    
-        override def exitIdList(ctx: NCIntentDslParser.IdListContext): Unit = {
-            flowItemIds.add(ctx.ID().getText)
-        }
-    
-        override def exitFlowItem(ctx: NCIntentDslParser.FlowItemContext): Unit = {
-            flow += NCDslFlowItem(Seq.empty ++ flowItemIds, min, max)
-            
-            // Reset
-            setMinMax(1, 1)
-            flowItemIds.clear()
-        }
-    
         override def exitItem(ctx: NCIntentDslParser.ItemContext): Unit = {
             if (ctx.EXCL() != null) {
                 val p = predStack.pop
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolver.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolver.scala
index 835f4c6..5d972a7 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolver.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolver.scala
@@ -35,22 +35,7 @@ import scala.collection.JavaConverters._
 class NCIntentSolver(intents: List[(NCDslIntent/*Intent*/, NCIntentMatch ⇒ NCResult/*Callback*/)])
     extends LazyLogging with NCOpenCensusTrace {
     class RedoSolver extends RuntimeException
-    
-    validate()
-    
-    /**
-     * Validates intents.
-     */
-    private def validate(): Unit = {
-        val ids = intents.map(_._1.id)
-        
-        // Check that flow declaration has valid intent IDs.
-        for (intent ← intents.map(_._1))
-            for (id ← intent.flow.flatMap(_.intents))
-                if (!ids.contains(id))
-                    throw new NCException(s"Invalid intent ID '$id' in flow specification for intent '${intent.id}'.")
-    }
-    
+
     /**
      *
      * @param in
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolverEngine.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolverEngine.scala
index db41dd0..51085fe 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolverEngine.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolverEngine.scala
@@ -24,7 +24,7 @@ import org.apache.nlpcraft.common._
 import org.apache.nlpcraft.common.ascii.NCAsciiTable
 import org.apache.nlpcraft.common.debug.{NCLogGroupToken, NCLogHolder}
 import org.apache.nlpcraft.common.opencensus.NCOpenCensusTrace
-import org.apache.nlpcraft.model.intent.utils.{NCDslFlowItem, NCDslIntent, NCDslTerm}
+import org.apache.nlpcraft.model.intent.utils.{NCDslIntent, NCDslTerm}
 import org.apache.nlpcraft.model._
 import org.apache.nlpcraft.model.impl.NCTokenLogger
 import org.apache.nlpcraft.probe.mgrs.dialogflow.NCDialogFlowManager
@@ -326,58 +326,7 @@ object NCIntentSolverEngine extends LazyLogging with NCOpenCensusTrace {
         
         buf.toList
     }
-    
-    /**
-     * 
-     * @param flow
-     * @param hist
-     * @return
-     */
-    private[impl] def matchFlow(flow: Array[NCDslFlowItem], hist: Seq[String]): Boolean = {
-        var flowIdx = 0
-        var histIdx = 0
-        var abort = false
-        
-        while (flowIdx < flow.length && !abort) {
-            val item = flow(flowIdx)
-    
-            val intents = item.intents
-            val min = item.min
-            val max = item.max
-            
-            var i = 0
-            
-            // Check min first.
-            while (i < min && histIdx < hist.length && !abort) {
-                abort = !intents.contains(hist(histIdx))
-                
-                histIdx += 1
-                i += 1
-            }
-            
-            if (!abort && i < min)
-                abort = true // Need at least min.
 
-            if (!abort) {
-                var ok = true
-                
-                // Grab up until max, if available.
-                while (i < max && histIdx < hist.length && ok) {
-                    ok = intents.contains(hist(histIdx))
-        
-                    if (ok)
-                        histIdx += 1
-                    
-                    i += 1
-                }
-            }
-            
-            flowIdx += 1
-        }
-        
-        !abort
-    }
-    
     /**
       *
       * @param intent
@@ -397,9 +346,9 @@ object NCIntentSolverEngine extends LazyLogging with NCOpenCensusTrace {
         val hist = NCDialogFlowManager.getDialogFlow(ctx.getRequest.getUser.getId, ctx.getModel.getId)
         
         val varStr = s"(variant #${varIdx + 1})"
-    
+
         // Check dialog flow first.
-        if (!intent.flow.isEmpty && !matchFlow(intent.flow, hist)) {
+        if (intent.flowRegex.isDefined && !intent.flowRegex.get.matcher(hist.mkString(" ")).matches()) {
             logger.info(s"Intent '$intentId' didn't match because of dialog flow $varStr.")
 
             None
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.g4 b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.g4
index b3025c4..9d20c04 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.g4
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.g4
@@ -20,21 +20,7 @@ grammar NCIntentDsl;
 intent: intentId orderedDecl? flowDecl? terms EOF;
 intentId: 'intent' EQ ID;
 orderedDecl: 'ordered' EQ BOOL;
-flowDecl: 'flow' EQ SQUOTE flow SQUOTE;
-flow
-    :
-    | flowItem
-    | flow RIGHT flowItem
-    ;
-flowItem: flowItemIds minMax?;
-flowItemIds
-    : ID
-    | LPAREN idList RPAREN
-    ;
-idList
-    : ID
-    | idList VERT ID
-    ;
+flowDecl: 'flow' EQ qstring;
 terms: term | terms term;
 termEq: EQ | TILDA;
 term: 'term' termId? termEq LCURLY item RCURLY minMax?;
@@ -98,6 +84,8 @@ EQ: '=';
 PLUS: '+';
 QUESTION: '?';
 STAR: '*';
+DOLLAR: '$';
+POWER: '^';
 BOOL: 'true' | 'false';
 INT: '0' | [1-9][_0-9]*;
 EXP: DOT [0-9]+;
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.interp b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.interp
index 40e4f1c..cc2c536 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.interp
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.interp
@@ -36,6 +36,8 @@ null
 '+'
 '?'
 '*'
+'$'
+'^'
 null
 null
 null
@@ -81,6 +83,8 @@ EQ
 PLUS
 QUESTION
 STAR
+DOLLAR
+POWER
 BOOL
 INT
 EXP
@@ -93,10 +97,6 @@ intent
 intentId
 orderedDecl
 flowDecl
-flow
-flowItem
-flowItemIds
-idList
 terms
 termEq
 term
@@ -117,4 +117,4 @@ minMaxRange
 
 
 atn:
-[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 44, 263, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 3, 2, 3, 2, 5, 2, 55, 10, 2, 3, 2, 5, 2, 58, 10, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3 [...]
\ No newline at end of file
+[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 219, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 3, 2, 3, 2, 5, 2, 47, 10, 2, 3, 2, 5, 2, 50, 10, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5,  [...]
\ No newline at end of file
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.tokens b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.tokens
index e2c3312..1fec3a7 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.tokens
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.tokens
@@ -34,12 +34,14 @@ EQ=33
 PLUS=34
 QUESTION=35
 STAR=36
-BOOL=37
-INT=38
-EXP=39
-ID=40
-WS=41
-ErrorCharacter=42
+DOLLAR=37
+POWER=38
+BOOL=39
+INT=40
+EXP=41
+ID=42
+WS=43
+ErrorCharacter=44
 'intent'=1
 'ordered'=2
 'flow'=3
@@ -75,3 +77,5 @@ ErrorCharacter=42
 '+'=34
 '?'=35
 '*'=36
+'$'=37
+'^'=38
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslBaseListener.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslBaseListener.java
index 32fdf9c..cf22077 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslBaseListener.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslBaseListener.java
@@ -1,4 +1,4 @@
-// Generated from C:/Users/Nikita Ivanov/Documents/GitHub/incubator-nlpcraft/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4\NCIntentDsl.g4 by ANTLR 4.8
+// Generated from C:/Users/Nikita Ivanov/Documents/GitHub/incubator-nlpcraft/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4\NCIntentDsl.g4 by ANTLR 4.9
 package org.apache.nlpcraft.model.intent.impl.antlr4;
 
 import org.antlr.v4.runtime.ParserRuleContext;
@@ -64,54 +64,6 @@ public class NCIntentDslBaseListener implements NCIntentDslListener {
 	 *
 	 * <p>The default implementation does nothing.</p>
 	 */
-	@Override public void enterFlow(NCIntentDslParser.FlowContext ctx) { }
-	/**
-	 * {@inheritDoc}
-	 *
-	 * <p>The default implementation does nothing.</p>
-	 */
-	@Override public void exitFlow(NCIntentDslParser.FlowContext ctx) { }
-	/**
-	 * {@inheritDoc}
-	 *
-	 * <p>The default implementation does nothing.</p>
-	 */
-	@Override public void enterFlowItem(NCIntentDslParser.FlowItemContext ctx) { }
-	/**
-	 * {@inheritDoc}
-	 *
-	 * <p>The default implementation does nothing.</p>
-	 */
-	@Override public void exitFlowItem(NCIntentDslParser.FlowItemContext ctx) { }
-	/**
-	 * {@inheritDoc}
-	 *
-	 * <p>The default implementation does nothing.</p>
-	 */
-	@Override public void enterFlowItemIds(NCIntentDslParser.FlowItemIdsContext ctx) { }
-	/**
-	 * {@inheritDoc}
-	 *
-	 * <p>The default implementation does nothing.</p>
-	 */
-	@Override public void exitFlowItemIds(NCIntentDslParser.FlowItemIdsContext ctx) { }
-	/**
-	 * {@inheritDoc}
-	 *
-	 * <p>The default implementation does nothing.</p>
-	 */
-	@Override public void enterIdList(NCIntentDslParser.IdListContext ctx) { }
-	/**
-	 * {@inheritDoc}
-	 *
-	 * <p>The default implementation does nothing.</p>
-	 */
-	@Override public void exitIdList(NCIntentDslParser.IdListContext ctx) { }
-	/**
-	 * {@inheritDoc}
-	 *
-	 * <p>The default implementation does nothing.</p>
-	 */
 	@Override public void enterTerms(NCIntentDslParser.TermsContext ctx) { }
 	/**
 	 * {@inheritDoc}
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.interp b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.interp
index 4fb76df..8202aae 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.interp
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.interp
@@ -36,6 +36,8 @@ null
 '+'
 '?'
 '*'
+'$'
+'^'
 null
 null
 null
@@ -81,6 +83,8 @@ EQ
 PLUS
 QUESTION
 STAR
+DOLLAR
+POWER
 BOOL
 INT
 EXP
@@ -125,6 +129,8 @@ EQ
 PLUS
 QUESTION
 STAR
+DOLLAR
+POWER
 BOOL
 INT
 EXP
@@ -140,4 +146,4 @@ mode names:
 DEFAULT_MODE
 
 atn:
-[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 44, 287, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9,  [...]
\ No newline at end of file
+[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 295, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9,  [...]
\ No newline at end of file
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.java
index a7c7c26..10bbb93 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.java
@@ -1,4 +1,4 @@
-// Generated from C:/Users/Nikita Ivanov/Documents/GitHub/incubator-nlpcraft/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4\NCIntentDsl.g4 by ANTLR 4.8
+// Generated from C:/Users/Nikita Ivanov/Documents/GitHub/incubator-nlpcraft/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4\NCIntentDsl.g4 by ANTLR 4.9
 package org.apache.nlpcraft.model.intent.impl.antlr4;
 import org.antlr.v4.runtime.Lexer;
 import org.antlr.v4.runtime.CharStream;
@@ -11,7 +11,7 @@ import org.antlr.v4.runtime.misc.*;
 
 @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
 public class NCIntentDslLexer extends Lexer {
-	static { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); }
+	static { RuntimeMetaData.checkVersion("4.9", RuntimeMetaData.VERSION); }
 
 	protected static final DFA[] _decisionToDFA;
 	protected static final PredictionContextCache _sharedContextCache =
@@ -21,8 +21,8 @@ public class NCIntentDslLexer extends Lexer {
 		T__9=10, T__10=11, T__11=12, T__12=13, PRED_OP=14, AND=15, OR=16, VERT=17, 
 		EXCL=18, LPAREN=19, RPAREN=20, LCURLY=21, RCURLY=22, SQUOTE=23, TILDA=24, 
 		RIGHT=25, LBR=26, RBR=27, COMMA=28, COLON=29, MINUS=30, DOT=31, UNDERSCORE=32, 
-		EQ=33, PLUS=34, QUESTION=35, STAR=36, BOOL=37, INT=38, EXP=39, ID=40, 
-		WS=41, ErrorCharacter=42;
+		EQ=33, PLUS=34, QUESTION=35, STAR=36, DOLLAR=37, POWER=38, BOOL=39, INT=40, 
+		EXP=41, ID=42, WS=43, ErrorCharacter=44;
 	public static String[] channelNames = {
 		"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
 	};
@@ -37,7 +37,8 @@ public class NCIntentDslLexer extends Lexer {
 			"T__9", "T__10", "T__11", "T__12", "PRED_OP", "AND", "OR", "VERT", "EXCL", 
 			"LPAREN", "RPAREN", "LCURLY", "RCURLY", "SQUOTE", "TILDA", "RIGHT", "LBR", 
 			"RBR", "COMMA", "COLON", "MINUS", "DOT", "UNDERSCORE", "EQ", "PLUS", 
-			"QUESTION", "STAR", "BOOL", "INT", "EXP", "ID", "WS", "ErrorCharacter"
+			"QUESTION", "STAR", "DOLLAR", "POWER", "BOOL", "INT", "EXP", "ID", "WS", 
+			"ErrorCharacter"
 		};
 	}
 	public static final String[] ruleNames = makeRuleNames();
@@ -48,7 +49,7 @@ public class NCIntentDslLexer extends Lexer {
 			"'startidx'", "'endidx'", "'parent'", "'groups'", "'ancestors'", "'value'", 
 			"'null'", null, "'&&'", "'||'", "'|'", "'!'", "'('", "')'", "'{'", "'}'", 
 			"'''", "'~'", "'>>'", "'['", "']'", "','", "':'", "'-'", "'.'", "'_'", 
-			"'='", "'+'", "'?'", "'*'"
+			"'='", "'+'", "'?'", "'*'", "'$'", "'^'"
 		};
 	}
 	private static final String[] _LITERAL_NAMES = makeLiteralNames();
@@ -58,7 +59,7 @@ public class NCIntentDslLexer extends Lexer {
 			null, null, "PRED_OP", "AND", "OR", "VERT", "EXCL", "LPAREN", "RPAREN", 
 			"LCURLY", "RCURLY", "SQUOTE", "TILDA", "RIGHT", "LBR", "RBR", "COMMA", 
 			"COLON", "MINUS", "DOT", "UNDERSCORE", "EQ", "PLUS", "QUESTION", "STAR", 
-			"BOOL", "INT", "EXP", "ID", "WS", "ErrorCharacter"
+			"DOLLAR", "POWER", "BOOL", "INT", "EXP", "ID", "WS", "ErrorCharacter"
 		};
 	}
 	private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
@@ -120,98 +121,100 @@ public class NCIntentDslLexer extends Lexer {
 	public ATN getATN() { return _ATN; }
 
 	public static final String _serializedATN =
-		"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2,\u011f\b\1\4\2\t"+
+		"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2.\u0127\b\1\4\2\t"+
 		"\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+
 		"\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
 		"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
 		"\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+
-		"\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\3"+
-		"\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4"+
-		"\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3"+
-		"\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n"+
-		"\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3"+
-		"\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16"+
-		"\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+
-		"\3\17\5\17\u00bc\n\17\3\20\3\20\3\20\3\21\3\21\3\21\3\22\3\22\3\23\3\23"+
-		"\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30\3\31\3\31\3\32\3\32"+
-		"\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3!\3!\3"+
-		"\"\3\"\3#\3#\3$\3$\3%\3%\3&\3&\3&\3&\3&\3&\3&\3&\3&\5&\u00f6\n&\3\'\3"+
-		"\'\3\'\7\'\u00fb\n\'\f\'\16\'\u00fe\13\'\5\'\u0100\n\'\3(\3(\6(\u0104"+
-		"\n(\r(\16(\u0105\3)\3)\6)\u010a\n)\r)\16)\u010b\3)\3)\3)\3)\7)\u0112\n"+
-		")\f)\16)\u0115\13)\3*\6*\u0118\n*\r*\16*\u0119\3*\3*\3+\3+\2\2,\3\3\5"+
-		"\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21"+
-		"!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!"+
-		"A\"C#E$G%I&K\'M(O)Q*S+U,\3\2\t\4\2>>@@\3\2\63;\4\2\62;aa\3\2\62;\4\2C"+
-		"\\c|\5\2\62;C\\c|\5\2\13\f\16\17\"\"\2\u012f\2\3\3\2\2\2\2\5\3\2\2\2\2"+
-		"\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2"+
-		"\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2"+
-		"\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2"+
-		"\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2"+
-		"\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2"+
-		"\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2"+
-		"M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\3W\3\2\2\2\5^\3"+
-		"\2\2\2\7f\3\2\2\2\tk\3\2\2\2\13p\3\2\2\2\rs\3\2\2\2\17{\3\2\2\2\21\u0084"+
-		"\3\2\2\2\23\u008b\3\2\2\2\25\u0092\3\2\2\2\27\u0099\3\2\2\2\31\u00a3\3"+
-		"\2\2\2\33\u00a9\3\2\2\2\35\u00bb\3\2\2\2\37\u00bd\3\2\2\2!\u00c0\3\2\2"+
-		"\2#\u00c3\3\2\2\2%\u00c5\3\2\2\2\'\u00c7\3\2\2\2)\u00c9\3\2\2\2+\u00cb"+
-		"\3\2\2\2-\u00cd\3\2\2\2/\u00cf\3\2\2\2\61\u00d1\3\2\2\2\63\u00d3\3\2\2"+
-		"\2\65\u00d6\3\2\2\2\67\u00d8\3\2\2\29\u00da\3\2\2\2;\u00dc\3\2\2\2=\u00de"+
-		"\3\2\2\2?\u00e0\3\2\2\2A\u00e2\3\2\2\2C\u00e4\3\2\2\2E\u00e6\3\2\2\2G"+
-		"\u00e8\3\2\2\2I\u00ea\3\2\2\2K\u00f5\3\2\2\2M\u00ff\3\2\2\2O\u0101\3\2"+
-		"\2\2Q\u0109\3\2\2\2S\u0117\3\2\2\2U\u011d\3\2\2\2WX\7k\2\2XY\7p\2\2YZ"+
-		"\7v\2\2Z[\7g\2\2[\\\7p\2\2\\]\7v\2\2]\4\3\2\2\2^_\7q\2\2_`\7t\2\2`a\7"+
-		"f\2\2ab\7g\2\2bc\7t\2\2cd\7g\2\2de\7f\2\2e\6\3\2\2\2fg\7h\2\2gh\7n\2\2"+
-		"hi\7q\2\2ij\7y\2\2j\b\3\2\2\2kl\7v\2\2lm\7g\2\2mn\7t\2\2no\7o\2\2o\n\3"+
-		"\2\2\2pq\7k\2\2qr\7f\2\2r\f\3\2\2\2st\7c\2\2tu\7n\2\2uv\7k\2\2vw\7c\2"+
-		"\2wx\7u\2\2xy\7g\2\2yz\7u\2\2z\16\3\2\2\2{|\7u\2\2|}\7v\2\2}~\7c\2\2~"+
-		"\177\7t\2\2\177\u0080\7v\2\2\u0080\u0081\7k\2\2\u0081\u0082\7f\2\2\u0082"+
-		"\u0083\7z\2\2\u0083\20\3\2\2\2\u0084\u0085\7g\2\2\u0085\u0086\7p\2\2\u0086"+
-		"\u0087\7f\2\2\u0087\u0088\7k\2\2\u0088\u0089\7f\2\2\u0089\u008a\7z\2\2"+
-		"\u008a\22\3\2\2\2\u008b\u008c\7r\2\2\u008c\u008d\7c\2\2\u008d\u008e\7"+
-		"t\2\2\u008e\u008f\7g\2\2\u008f\u0090\7p\2\2\u0090\u0091\7v\2\2\u0091\24"+
-		"\3\2\2\2\u0092\u0093\7i\2\2\u0093\u0094\7t\2\2\u0094\u0095\7q\2\2\u0095"+
-		"\u0096\7w\2\2\u0096\u0097\7r\2\2\u0097\u0098\7u\2\2\u0098\26\3\2\2\2\u0099"+
-		"\u009a\7c\2\2\u009a\u009b\7p\2\2\u009b\u009c\7e\2\2\u009c\u009d\7g\2\2"+
-		"\u009d\u009e\7u\2\2\u009e\u009f\7v\2\2\u009f\u00a0\7q\2\2\u00a0\u00a1"+
-		"\7t\2\2\u00a1\u00a2\7u\2\2\u00a2\30\3\2\2\2\u00a3\u00a4\7x\2\2\u00a4\u00a5"+
-		"\7c\2\2\u00a5\u00a6\7n\2\2\u00a6\u00a7\7w\2\2\u00a7\u00a8\7g\2\2\u00a8"+
-		"\32\3\2\2\2\u00a9\u00aa\7p\2\2\u00aa\u00ab\7w\2\2\u00ab\u00ac\7n\2\2\u00ac"+
-		"\u00ad\7n\2\2\u00ad\34\3\2\2\2\u00ae\u00af\7?\2\2\u00af\u00bc\7?\2\2\u00b0"+
-		"\u00b1\7#\2\2\u00b1\u00bc\7?\2\2\u00b2\u00b3\7@\2\2\u00b3\u00bc\7?\2\2"+
-		"\u00b4\u00b5\7>\2\2\u00b5\u00bc\7?\2\2\u00b6\u00bc\t\2\2\2\u00b7\u00b8"+
-		"\7B\2\2\u00b8\u00bc\7B\2\2\u00b9\u00ba\7#\2\2\u00ba\u00bc\7B\2\2\u00bb"+
-		"\u00ae\3\2\2\2\u00bb\u00b0\3\2\2\2\u00bb\u00b2\3\2\2\2\u00bb\u00b4\3\2"+
-		"\2\2\u00bb\u00b6\3\2\2\2\u00bb\u00b7\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bc"+
-		"\36\3\2\2\2\u00bd\u00be\7(\2\2\u00be\u00bf\7(\2\2\u00bf \3\2\2\2\u00c0"+
-		"\u00c1\7~\2\2\u00c1\u00c2\7~\2\2\u00c2\"\3\2\2\2\u00c3\u00c4\7~\2\2\u00c4"+
-		"$\3\2\2\2\u00c5\u00c6\7#\2\2\u00c6&\3\2\2\2\u00c7\u00c8\7*\2\2\u00c8("+
-		"\3\2\2\2\u00c9\u00ca\7+\2\2\u00ca*\3\2\2\2\u00cb\u00cc\7}\2\2\u00cc,\3"+
-		"\2\2\2\u00cd\u00ce\7\177\2\2\u00ce.\3\2\2\2\u00cf\u00d0\7)\2\2\u00d0\60"+
-		"\3\2\2\2\u00d1\u00d2\7\u0080\2\2\u00d2\62\3\2\2\2\u00d3\u00d4\7@\2\2\u00d4"+
-		"\u00d5\7@\2\2\u00d5\64\3\2\2\2\u00d6\u00d7\7]\2\2\u00d7\66\3\2\2\2\u00d8"+
-		"\u00d9\7_\2\2\u00d98\3\2\2\2\u00da\u00db\7.\2\2\u00db:\3\2\2\2\u00dc\u00dd"+
-		"\7<\2\2\u00dd<\3\2\2\2\u00de\u00df\7/\2\2\u00df>\3\2\2\2\u00e0\u00e1\7"+
-		"\60\2\2\u00e1@\3\2\2\2\u00e2\u00e3\7a\2\2\u00e3B\3\2\2\2\u00e4\u00e5\7"+
-		"?\2\2\u00e5D\3\2\2\2\u00e6\u00e7\7-\2\2\u00e7F\3\2\2\2\u00e8\u00e9\7A"+
-		"\2\2\u00e9H\3\2\2\2\u00ea\u00eb\7,\2\2\u00ebJ\3\2\2\2\u00ec\u00ed\7v\2"+
-		"\2\u00ed\u00ee\7t\2\2\u00ee\u00ef\7w\2\2\u00ef\u00f6\7g\2\2\u00f0\u00f1"+
-		"\7h\2\2\u00f1\u00f2\7c\2\2\u00f2\u00f3\7n\2\2\u00f3\u00f4\7u\2\2\u00f4"+
-		"\u00f6\7g\2\2\u00f5\u00ec\3\2\2\2\u00f5\u00f0\3\2\2\2\u00f6L\3\2\2\2\u00f7"+
-		"\u0100\7\62\2\2\u00f8\u00fc\t\3\2\2\u00f9\u00fb\t\4\2\2\u00fa\u00f9\3"+
-		"\2\2\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd"+
-		"\u0100\3\2\2\2\u00fe\u00fc\3\2\2\2\u00ff\u00f7\3\2\2\2\u00ff\u00f8\3\2"+
-		"\2\2\u0100N\3\2\2\2\u0101\u0103\5? \2\u0102\u0104\t\5\2\2\u0103\u0102"+
-		"\3\2\2\2\u0104\u0105\3\2\2\2\u0105\u0103\3\2\2\2\u0105\u0106\3\2\2\2\u0106"+
-		"P\3\2\2\2\u0107\u010a\5A!\2\u0108\u010a\t\6\2\2\u0109\u0107\3\2\2\2\u0109"+
-		"\u0108\3\2\2\2\u010a\u010b\3\2\2\2\u010b\u0109\3\2\2\2\u010b\u010c\3\2"+
-		"\2\2\u010c\u0113\3\2\2\2\u010d\u0112\t\7\2\2\u010e\u0112\5;\36\2\u010f"+
-		"\u0112\5=\37\2\u0110\u0112\5A!\2\u0111\u010d\3\2\2\2\u0111\u010e\3\2\2"+
-		"\2\u0111\u010f\3\2\2\2\u0111\u0110\3\2\2\2\u0112\u0115\3\2\2\2\u0113\u0111"+
-		"\3\2\2\2\u0113\u0114\3\2\2\2\u0114R\3\2\2\2\u0115\u0113\3\2\2\2\u0116"+
-		"\u0118\t\b\2\2\u0117\u0116\3\2\2\2\u0118\u0119\3\2\2\2\u0119\u0117\3\2"+
-		"\2\2\u0119\u011a\3\2\2\2\u011a\u011b\3\2\2\2\u011b\u011c\b*\2\2\u011c"+
-		"T\3\2\2\2\u011d\u011e\13\2\2\2\u011eV\3\2\2\2\r\2\u00bb\u00f5\u00fc\u00ff"+
-		"\u0105\u0109\u010b\u0111\u0113\u0119\3\b\2\2";
+		"\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+
+		",\t,\4-\t-\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3"+
+		"\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3"+
+		"\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t"+
+		"\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
+		"\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\16"+
+		"\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+
+		"\3\17\3\17\3\17\5\17\u00c0\n\17\3\20\3\20\3\20\3\21\3\21\3\21\3\22\3\22"+
+		"\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30\3\31\3\31"+
+		"\3\32\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3"+
+		" \3!\3!\3\"\3\"\3#\3#\3$\3$\3%\3%\3&\3&\3\'\3\'\3(\3(\3(\3(\3(\3(\3(\3"+
+		"(\3(\5(\u00fe\n(\3)\3)\3)\7)\u0103\n)\f)\16)\u0106\13)\5)\u0108\n)\3*"+
+		"\3*\6*\u010c\n*\r*\16*\u010d\3+\3+\6+\u0112\n+\r+\16+\u0113\3+\3+\3+\3"+
+		"+\7+\u011a\n+\f+\16+\u011d\13+\3,\6,\u0120\n,\r,\16,\u0121\3,\3,\3-\3"+
+		"-\2\2.\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17"+
+		"\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\35"+
+		"9\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.\3\2\t\4\2>>@@\3\2\63;\4\2\62"+
+		";aa\3\2\62;\4\2C\\c|\5\2\62;C\\c|\5\2\13\f\16\17\"\"\2\u0137\2\3\3\2\2"+
+		"\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3"+
+		"\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2"+
+		"\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2"+
+		"\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2"+
+		"\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3"+
+		"\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2"+
+		"\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2"+
+		"W\3\2\2\2\2Y\3\2\2\2\3[\3\2\2\2\5b\3\2\2\2\7j\3\2\2\2\to\3\2\2\2\13t\3"+
+		"\2\2\2\rw\3\2\2\2\17\177\3\2\2\2\21\u0088\3\2\2\2\23\u008f\3\2\2\2\25"+
+		"\u0096\3\2\2\2\27\u009d\3\2\2\2\31\u00a7\3\2\2\2\33\u00ad\3\2\2\2\35\u00bf"+
+		"\3\2\2\2\37\u00c1\3\2\2\2!\u00c4\3\2\2\2#\u00c7\3\2\2\2%\u00c9\3\2\2\2"+
+		"\'\u00cb\3\2\2\2)\u00cd\3\2\2\2+\u00cf\3\2\2\2-\u00d1\3\2\2\2/\u00d3\3"+
+		"\2\2\2\61\u00d5\3\2\2\2\63\u00d7\3\2\2\2\65\u00da\3\2\2\2\67\u00dc\3\2"+
+		"\2\29\u00de\3\2\2\2;\u00e0\3\2\2\2=\u00e2\3\2\2\2?\u00e4\3\2\2\2A\u00e6"+
+		"\3\2\2\2C\u00e8\3\2\2\2E\u00ea\3\2\2\2G\u00ec\3\2\2\2I\u00ee\3\2\2\2K"+
+		"\u00f0\3\2\2\2M\u00f2\3\2\2\2O\u00fd\3\2\2\2Q\u0107\3\2\2\2S\u0109\3\2"+
+		"\2\2U\u0111\3\2\2\2W\u011f\3\2\2\2Y\u0125\3\2\2\2[\\\7k\2\2\\]\7p\2\2"+
+		"]^\7v\2\2^_\7g\2\2_`\7p\2\2`a\7v\2\2a\4\3\2\2\2bc\7q\2\2cd\7t\2\2de\7"+
+		"f\2\2ef\7g\2\2fg\7t\2\2gh\7g\2\2hi\7f\2\2i\6\3\2\2\2jk\7h\2\2kl\7n\2\2"+
+		"lm\7q\2\2mn\7y\2\2n\b\3\2\2\2op\7v\2\2pq\7g\2\2qr\7t\2\2rs\7o\2\2s\n\3"+
+		"\2\2\2tu\7k\2\2uv\7f\2\2v\f\3\2\2\2wx\7c\2\2xy\7n\2\2yz\7k\2\2z{\7c\2"+
+		"\2{|\7u\2\2|}\7g\2\2}~\7u\2\2~\16\3\2\2\2\177\u0080\7u\2\2\u0080\u0081"+
+		"\7v\2\2\u0081\u0082\7c\2\2\u0082\u0083\7t\2\2\u0083\u0084\7v\2\2\u0084"+
+		"\u0085\7k\2\2\u0085\u0086\7f\2\2\u0086\u0087\7z\2\2\u0087\20\3\2\2\2\u0088"+
+		"\u0089\7g\2\2\u0089\u008a\7p\2\2\u008a\u008b\7f\2\2\u008b\u008c\7k\2\2"+
+		"\u008c\u008d\7f\2\2\u008d\u008e\7z\2\2\u008e\22\3\2\2\2\u008f\u0090\7"+
+		"r\2\2\u0090\u0091\7c\2\2\u0091\u0092\7t\2\2\u0092\u0093\7g\2\2\u0093\u0094"+
+		"\7p\2\2\u0094\u0095\7v\2\2\u0095\24\3\2\2\2\u0096\u0097\7i\2\2\u0097\u0098"+
+		"\7t\2\2\u0098\u0099\7q\2\2\u0099\u009a\7w\2\2\u009a\u009b\7r\2\2\u009b"+
+		"\u009c\7u\2\2\u009c\26\3\2\2\2\u009d\u009e\7c\2\2\u009e\u009f\7p\2\2\u009f"+
+		"\u00a0\7e\2\2\u00a0\u00a1\7g\2\2\u00a1\u00a2\7u\2\2\u00a2\u00a3\7v\2\2"+
+		"\u00a3\u00a4\7q\2\2\u00a4\u00a5\7t\2\2\u00a5\u00a6\7u\2\2\u00a6\30\3\2"+
+		"\2\2\u00a7\u00a8\7x\2\2\u00a8\u00a9\7c\2\2\u00a9\u00aa\7n\2\2\u00aa\u00ab"+
+		"\7w\2\2\u00ab\u00ac\7g\2\2\u00ac\32\3\2\2\2\u00ad\u00ae\7p\2\2\u00ae\u00af"+
+		"\7w\2\2\u00af\u00b0\7n\2\2\u00b0\u00b1\7n\2\2\u00b1\34\3\2\2\2\u00b2\u00b3"+
+		"\7?\2\2\u00b3\u00c0\7?\2\2\u00b4\u00b5\7#\2\2\u00b5\u00c0\7?\2\2\u00b6"+
+		"\u00b7\7@\2\2\u00b7\u00c0\7?\2\2\u00b8\u00b9\7>\2\2\u00b9\u00c0\7?\2\2"+
+		"\u00ba\u00c0\t\2\2\2\u00bb\u00bc\7B\2\2\u00bc\u00c0\7B\2\2\u00bd\u00be"+
+		"\7#\2\2\u00be\u00c0\7B\2\2\u00bf\u00b2\3\2\2\2\u00bf\u00b4\3\2\2\2\u00bf"+
+		"\u00b6\3\2\2\2\u00bf\u00b8\3\2\2\2\u00bf\u00ba\3\2\2\2\u00bf\u00bb\3\2"+
+		"\2\2\u00bf\u00bd\3\2\2\2\u00c0\36\3\2\2\2\u00c1\u00c2\7(\2\2\u00c2\u00c3"+
+		"\7(\2\2\u00c3 \3\2\2\2\u00c4\u00c5\7~\2\2\u00c5\u00c6\7~\2\2\u00c6\"\3"+
+		"\2\2\2\u00c7\u00c8\7~\2\2\u00c8$\3\2\2\2\u00c9\u00ca\7#\2\2\u00ca&\3\2"+
+		"\2\2\u00cb\u00cc\7*\2\2\u00cc(\3\2\2\2\u00cd\u00ce\7+\2\2\u00ce*\3\2\2"+
+		"\2\u00cf\u00d0\7}\2\2\u00d0,\3\2\2\2\u00d1\u00d2\7\177\2\2\u00d2.\3\2"+
+		"\2\2\u00d3\u00d4\7)\2\2\u00d4\60\3\2\2\2\u00d5\u00d6\7\u0080\2\2\u00d6"+
+		"\62\3\2\2\2\u00d7\u00d8\7@\2\2\u00d8\u00d9\7@\2\2\u00d9\64\3\2\2\2\u00da"+
+		"\u00db\7]\2\2\u00db\66\3\2\2\2\u00dc\u00dd\7_\2\2\u00dd8\3\2\2\2\u00de"+
+		"\u00df\7.\2\2\u00df:\3\2\2\2\u00e0\u00e1\7<\2\2\u00e1<\3\2\2\2\u00e2\u00e3"+
+		"\7/\2\2\u00e3>\3\2\2\2\u00e4\u00e5\7\60\2\2\u00e5@\3\2\2\2\u00e6\u00e7"+
+		"\7a\2\2\u00e7B\3\2\2\2\u00e8\u00e9\7?\2\2\u00e9D\3\2\2\2\u00ea\u00eb\7"+
+		"-\2\2\u00ebF\3\2\2\2\u00ec\u00ed\7A\2\2\u00edH\3\2\2\2\u00ee\u00ef\7,"+
+		"\2\2\u00efJ\3\2\2\2\u00f0\u00f1\7&\2\2\u00f1L\3\2\2\2\u00f2\u00f3\7`\2"+
+		"\2\u00f3N\3\2\2\2\u00f4\u00f5\7v\2\2\u00f5\u00f6\7t\2\2\u00f6\u00f7\7"+
+		"w\2\2\u00f7\u00fe\7g\2\2\u00f8\u00f9\7h\2\2\u00f9\u00fa\7c\2\2\u00fa\u00fb"+
+		"\7n\2\2\u00fb\u00fc\7u\2\2\u00fc\u00fe\7g\2\2\u00fd\u00f4\3\2\2\2\u00fd"+
+		"\u00f8\3\2\2\2\u00feP\3\2\2\2\u00ff\u0108\7\62\2\2\u0100\u0104\t\3\2\2"+
+		"\u0101\u0103\t\4\2\2\u0102\u0101\3\2\2\2\u0103\u0106\3\2\2\2\u0104\u0102"+
+		"\3\2\2\2\u0104\u0105\3\2\2\2\u0105\u0108\3\2\2\2\u0106\u0104\3\2\2\2\u0107"+
+		"\u00ff\3\2\2\2\u0107\u0100\3\2\2\2\u0108R\3\2\2\2\u0109\u010b\5? \2\u010a"+
+		"\u010c\t\5\2\2\u010b\u010a\3\2\2\2\u010c\u010d\3\2\2\2\u010d\u010b\3\2"+
+		"\2\2\u010d\u010e\3\2\2\2\u010eT\3\2\2\2\u010f\u0112\5A!\2\u0110\u0112"+
+		"\t\6\2\2\u0111\u010f\3\2\2\2\u0111\u0110\3\2\2\2\u0112\u0113\3\2\2\2\u0113"+
+		"\u0111\3\2\2\2\u0113\u0114\3\2\2\2\u0114\u011b\3\2\2\2\u0115\u011a\t\7"+
+		"\2\2\u0116\u011a\5;\36\2\u0117\u011a\5=\37\2\u0118\u011a\5A!\2\u0119\u0115"+
+		"\3\2\2\2\u0119\u0116\3\2\2\2\u0119\u0117\3\2\2\2\u0119\u0118\3\2\2\2\u011a"+
+		"\u011d\3\2\2\2\u011b\u0119\3\2\2\2\u011b\u011c\3\2\2\2\u011cV\3\2\2\2"+
+		"\u011d\u011b\3\2\2\2\u011e\u0120\t\b\2\2\u011f\u011e\3\2\2\2\u0120\u0121"+
+		"\3\2\2\2\u0121\u011f\3\2\2\2\u0121\u0122\3\2\2\2\u0122\u0123\3\2\2\2\u0123"+
+		"\u0124\b,\2\2\u0124X\3\2\2\2\u0125\u0126\13\2\2\2\u0126Z\3\2\2\2\r\2\u00bf"+
+		"\u00fd\u0104\u0107\u010d\u0111\u0113\u0119\u011b\u0121\3\b\2\2";
 	public static final ATN _ATN =
 		new ATNDeserializer().deserialize(_serializedATN.toCharArray());
 	static {
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.tokens b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.tokens
index e2c3312..1fec3a7 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.tokens
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.tokens
@@ -34,12 +34,14 @@ EQ=33
 PLUS=34
 QUESTION=35
 STAR=36
-BOOL=37
-INT=38
-EXP=39
-ID=40
-WS=41
-ErrorCharacter=42
+DOLLAR=37
+POWER=38
+BOOL=39
+INT=40
+EXP=41
+ID=42
+WS=43
+ErrorCharacter=44
 'intent'=1
 'ordered'=2
 'flow'=3
@@ -75,3 +77,5 @@ ErrorCharacter=42
 '+'=34
 '?'=35
 '*'=36
+'$'=37
+'^'=38
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslListener.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslListener.java
index 59ff399..66e4d5a 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslListener.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslListener.java
@@ -1,4 +1,4 @@
-// Generated from C:/Users/Nikita Ivanov/Documents/GitHub/incubator-nlpcraft/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4\NCIntentDsl.g4 by ANTLR 4.8
+// Generated from C:/Users/Nikita Ivanov/Documents/GitHub/incubator-nlpcraft/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4\NCIntentDsl.g4 by ANTLR 4.9
 package org.apache.nlpcraft.model.intent.impl.antlr4;
 import org.antlr.v4.runtime.tree.ParseTreeListener;
 
@@ -48,46 +48,6 @@ public interface NCIntentDslListener extends ParseTreeListener {
 	 */
 	void exitFlowDecl(NCIntentDslParser.FlowDeclContext ctx);
 	/**
-	 * Enter a parse tree produced by {@link NCIntentDslParser#flow}.
-	 * @param ctx the parse tree
-	 */
-	void enterFlow(NCIntentDslParser.FlowContext ctx);
-	/**
-	 * Exit a parse tree produced by {@link NCIntentDslParser#flow}.
-	 * @param ctx the parse tree
-	 */
-	void exitFlow(NCIntentDslParser.FlowContext ctx);
-	/**
-	 * Enter a parse tree produced by {@link NCIntentDslParser#flowItem}.
-	 * @param ctx the parse tree
-	 */
-	void enterFlowItem(NCIntentDslParser.FlowItemContext ctx);
-	/**
-	 * Exit a parse tree produced by {@link NCIntentDslParser#flowItem}.
-	 * @param ctx the parse tree
-	 */
-	void exitFlowItem(NCIntentDslParser.FlowItemContext ctx);
-	/**
-	 * Enter a parse tree produced by {@link NCIntentDslParser#flowItemIds}.
-	 * @param ctx the parse tree
-	 */
-	void enterFlowItemIds(NCIntentDslParser.FlowItemIdsContext ctx);
-	/**
-	 * Exit a parse tree produced by {@link NCIntentDslParser#flowItemIds}.
-	 * @param ctx the parse tree
-	 */
-	void exitFlowItemIds(NCIntentDslParser.FlowItemIdsContext ctx);
-	/**
-	 * Enter a parse tree produced by {@link NCIntentDslParser#idList}.
-	 * @param ctx the parse tree
-	 */
-	void enterIdList(NCIntentDslParser.IdListContext ctx);
-	/**
-	 * Exit a parse tree produced by {@link NCIntentDslParser#idList}.
-	 * @param ctx the parse tree
-	 */
-	void exitIdList(NCIntentDslParser.IdListContext ctx);
-	/**
 	 * Enter a parse tree produced by {@link NCIntentDslParser#terms}.
 	 * @param ctx the parse tree
 	 */
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslParser.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslParser.java
index ef12ce8..e34b4f8 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslParser.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslParser.java
@@ -1,4 +1,4 @@
-// Generated from C:/Users/Nikita Ivanov/Documents/GitHub/incubator-nlpcraft/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4\NCIntentDsl.g4 by ANTLR 4.8
+// Generated from C:/Users/Nikita Ivanov/Documents/GitHub/incubator-nlpcraft/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4\NCIntentDsl.g4 by ANTLR 4.9
 package org.apache.nlpcraft.model.intent.impl.antlr4;
 import org.antlr.v4.runtime.atn.*;
 import org.antlr.v4.runtime.dfa.DFA;
@@ -11,7 +11,7 @@ import java.util.ArrayList;
 
 @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
 public class NCIntentDslParser extends Parser {
-	static { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); }
+	static { RuntimeMetaData.checkVersion("4.9", RuntimeMetaData.VERSION); }
 
 	protected static final DFA[] _decisionToDFA;
 	protected static final PredictionContextCache _sharedContextCache =
@@ -21,21 +21,19 @@ public class NCIntentDslParser extends Parser {
 		T__9=10, T__10=11, T__11=12, T__12=13, PRED_OP=14, AND=15, OR=16, VERT=17, 
 		EXCL=18, LPAREN=19, RPAREN=20, LCURLY=21, RCURLY=22, SQUOTE=23, TILDA=24, 
 		RIGHT=25, LBR=26, RBR=27, COMMA=28, COLON=29, MINUS=30, DOT=31, UNDERSCORE=32, 
-		EQ=33, PLUS=34, QUESTION=35, STAR=36, BOOL=37, INT=38, EXP=39, ID=40, 
-		WS=41, ErrorCharacter=42;
+		EQ=33, PLUS=34, QUESTION=35, STAR=36, DOLLAR=37, POWER=38, BOOL=39, INT=40, 
+		EXP=41, ID=42, WS=43, ErrorCharacter=44;
 	public static final int
 		RULE_intent = 0, RULE_intentId = 1, RULE_orderedDecl = 2, RULE_flowDecl = 3, 
-		RULE_flow = 4, RULE_flowItem = 5, RULE_flowItemIds = 6, RULE_idList = 7, 
-		RULE_terms = 8, RULE_termEq = 9, RULE_term = 10, RULE_termId = 11, RULE_item = 12, 
-		RULE_predicate = 13, RULE_lval = 14, RULE_lvalQual = 15, RULE_lvalPart = 16, 
-		RULE_rvalSingle = 17, RULE_rval = 18, RULE_rvalList = 19, RULE_meta = 20, 
-		RULE_qstring = 21, RULE_minMax = 22, RULE_minMaxShortcut = 23, RULE_minMaxRange = 24;
+		RULE_terms = 4, RULE_termEq = 5, RULE_term = 6, RULE_termId = 7, RULE_item = 8, 
+		RULE_predicate = 9, RULE_lval = 10, RULE_lvalQual = 11, RULE_lvalPart = 12, 
+		RULE_rvalSingle = 13, RULE_rval = 14, RULE_rvalList = 15, RULE_meta = 16, 
+		RULE_qstring = 17, RULE_minMax = 18, RULE_minMaxShortcut = 19, RULE_minMaxRange = 20;
 	private static String[] makeRuleNames() {
 		return new String[] {
-			"intent", "intentId", "orderedDecl", "flowDecl", "flow", "flowItem", 
-			"flowItemIds", "idList", "terms", "termEq", "term", "termId", "item", 
-			"predicate", "lval", "lvalQual", "lvalPart", "rvalSingle", "rval", "rvalList", 
-			"meta", "qstring", "minMax", "minMaxShortcut", "minMaxRange"
+			"intent", "intentId", "orderedDecl", "flowDecl", "terms", "termEq", "term", 
+			"termId", "item", "predicate", "lval", "lvalQual", "lvalPart", "rvalSingle", 
+			"rval", "rvalList", "meta", "qstring", "minMax", "minMaxShortcut", "minMaxRange"
 		};
 	}
 	public static final String[] ruleNames = makeRuleNames();
@@ -46,7 +44,7 @@ public class NCIntentDslParser extends Parser {
 			"'startidx'", "'endidx'", "'parent'", "'groups'", "'ancestors'", "'value'", 
 			"'null'", null, "'&&'", "'||'", "'|'", "'!'", "'('", "')'", "'{'", "'}'", 
 			"'''", "'~'", "'>>'", "'['", "']'", "','", "':'", "'-'", "'.'", "'_'", 
-			"'='", "'+'", "'?'", "'*'"
+			"'='", "'+'", "'?'", "'*'", "'$'", "'^'"
 		};
 	}
 	private static final String[] _LITERAL_NAMES = makeLiteralNames();
@@ -56,7 +54,7 @@ public class NCIntentDslParser extends Parser {
 			null, null, "PRED_OP", "AND", "OR", "VERT", "EXCL", "LPAREN", "RPAREN", 
 			"LCURLY", "RCURLY", "SQUOTE", "TILDA", "RIGHT", "LBR", "RBR", "COMMA", 
 			"COLON", "MINUS", "DOT", "UNDERSCORE", "EQ", "PLUS", "QUESTION", "STAR", 
-			"BOOL", "INT", "EXP", "ID", "WS", "ErrorCharacter"
+			"DOLLAR", "POWER", "BOOL", "INT", "EXP", "ID", "WS", "ErrorCharacter"
 		};
 	}
 	private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
@@ -145,31 +143,31 @@ public class NCIntentDslParser extends Parser {
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(50);
+			setState(42);
 			intentId();
-			setState(52);
+			setState(44);
 			_errHandler.sync(this);
 			_la = _input.LA(1);
 			if (_la==T__1) {
 				{
-				setState(51);
+				setState(43);
 				orderedDecl();
 				}
 			}
 
-			setState(55);
+			setState(47);
 			_errHandler.sync(this);
 			_la = _input.LA(1);
 			if (_la==T__2) {
 				{
-				setState(54);
+				setState(46);
 				flowDecl();
 				}
 			}
 
-			setState(57);
+			setState(49);
 			terms(0);
-			setState(58);
+			setState(50);
 			match(EOF);
 			}
 		}
@@ -207,11 +205,11 @@ public class NCIntentDslParser extends Parser {
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(60);
+			setState(52);
 			match(T__0);
-			setState(61);
+			setState(53);
 			match(EQ);
-			setState(62);
+			setState(54);
 			match(ID);
 			}
 		}
@@ -249,11 +247,11 @@ public class NCIntentDslParser extends Parser {
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(64);
+			setState(56);
 			match(T__1);
-			setState(65);
+			setState(57);
 			match(EQ);
-			setState(66);
+			setState(58);
 			match(BOOL);
 			}
 		}
@@ -270,12 +268,8 @@ public class NCIntentDslParser extends Parser {
 
 	public static class FlowDeclContext extends ParserRuleContext {
 		public TerminalNode EQ() { return getToken(NCIntentDslParser.EQ, 0); }
-		public List<TerminalNode> SQUOTE() { return getTokens(NCIntentDslParser.SQUOTE); }
-		public TerminalNode SQUOTE(int i) {
-			return getToken(NCIntentDslParser.SQUOTE, i);
-		}
-		public FlowContext flow() {
-			return getRuleContext(FlowContext.class,0);
+		public QstringContext qstring() {
+			return getRuleContext(QstringContext.class,0);
 		}
 		public FlowDeclContext(ParserRuleContext parent, int invokingState) {
 			super(parent, invokingState);
@@ -297,218 +291,12 @@ public class NCIntentDslParser extends Parser {
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(68);
+			setState(60);
 			match(T__2);
-			setState(69);
+			setState(61);
 			match(EQ);
-			setState(70);
-			match(SQUOTE);
-			setState(71);
-			flow(0);
-			setState(72);
-			match(SQUOTE);
-			}
-		}
-		catch (RecognitionException re) {
-			_localctx.exception = re;
-			_errHandler.reportError(this, re);
-			_errHandler.recover(this, re);
-		}
-		finally {
-			exitRule();
-		}
-		return _localctx;
-	}
-
-	public static class FlowContext extends ParserRuleContext {
-		public FlowItemContext flowItem() {
-			return getRuleContext(FlowItemContext.class,0);
-		}
-		public FlowContext flow() {
-			return getRuleContext(FlowContext.class,0);
-		}
-		public TerminalNode RIGHT() { return getToken(NCIntentDslParser.RIGHT, 0); }
-		public FlowContext(ParserRuleContext parent, int invokingState) {
-			super(parent, invokingState);
-		}
-		@Override public int getRuleIndex() { return RULE_flow; }
-		@Override
-		public void enterRule(ParseTreeListener listener) {
-			if ( listener instanceof NCIntentDslListener ) ((NCIntentDslListener)listener).enterFlow(this);
-		}
-		@Override
-		public void exitRule(ParseTreeListener listener) {
-			if ( listener instanceof NCIntentDslListener ) ((NCIntentDslListener)listener).exitFlow(this);
-		}
-	}
-
-	public final FlowContext flow() throws RecognitionException {
-		return flow(0);
-	}
-
-	private FlowContext flow(int _p) throws RecognitionException {
-		ParserRuleContext _parentctx = _ctx;
-		int _parentState = getState();
-		FlowContext _localctx = new FlowContext(_ctx, _parentState);
-		FlowContext _prevctx = _localctx;
-		int _startState = 8;
-		enterRecursionRule(_localctx, 8, RULE_flow, _p);
-		try {
-			int _alt;
-			enterOuterAlt(_localctx, 1);
-			{
-			setState(76);
-			_errHandler.sync(this);
-			switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
-			case 1:
-				{
-				}
-				break;
-			case 2:
-				{
-				setState(75);
-				flowItem();
-				}
-				break;
-			}
-			_ctx.stop = _input.LT(-1);
-			setState(83);
-			_errHandler.sync(this);
-			_alt = getInterpreter().adaptivePredict(_input,3,_ctx);
-			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
-				if ( _alt==1 ) {
-					if ( _parseListeners!=null ) triggerExitRuleEvent();
-					_prevctx = _localctx;
-					{
-					{
-					_localctx = new FlowContext(_parentctx, _parentState);
-					pushNewRecursionContext(_localctx, _startState, RULE_flow);
-					setState(78);
-					if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
-					setState(79);
-					match(RIGHT);
-					setState(80);
-					flowItem();
-					}
-					} 
-				}
-				setState(85);
-				_errHandler.sync(this);
-				_alt = getInterpreter().adaptivePredict(_input,3,_ctx);
-			}
-			}
-		}
-		catch (RecognitionException re) {
-			_localctx.exception = re;
-			_errHandler.reportError(this, re);
-			_errHandler.recover(this, re);
-		}
-		finally {
-			unrollRecursionContexts(_parentctx);
-		}
-		return _localctx;
-	}
-
-	public static class FlowItemContext extends ParserRuleContext {
-		public FlowItemIdsContext flowItemIds() {
-			return getRuleContext(FlowItemIdsContext.class,0);
-		}
-		public MinMaxContext minMax() {
-			return getRuleContext(MinMaxContext.class,0);
-		}
-		public FlowItemContext(ParserRuleContext parent, int invokingState) {
-			super(parent, invokingState);
-		}
-		@Override public int getRuleIndex() { return RULE_flowItem; }
-		@Override
-		public void enterRule(ParseTreeListener listener) {
-			if ( listener instanceof NCIntentDslListener ) ((NCIntentDslListener)listener).enterFlowItem(this);
-		}
-		@Override
-		public void exitRule(ParseTreeListener listener) {
-			if ( listener instanceof NCIntentDslListener ) ((NCIntentDslListener)listener).exitFlowItem(this);
-		}
-	}
-
-	public final FlowItemContext flowItem() throws RecognitionException {
-		FlowItemContext _localctx = new FlowItemContext(_ctx, getState());
-		enterRule(_localctx, 10, RULE_flowItem);
-		try {
-			enterOuterAlt(_localctx, 1);
-			{
-			setState(86);
-			flowItemIds();
-			setState(88);
-			_errHandler.sync(this);
-			switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
-			case 1:
-				{
-				setState(87);
-				minMax();
-				}
-				break;
-			}
-			}
-		}
-		catch (RecognitionException re) {
-			_localctx.exception = re;
-			_errHandler.reportError(this, re);
-			_errHandler.recover(this, re);
-		}
-		finally {
-			exitRule();
-		}
-		return _localctx;
-	}
-
-	public static class FlowItemIdsContext extends ParserRuleContext {
-		public TerminalNode ID() { return getToken(NCIntentDslParser.ID, 0); }
-		public TerminalNode LPAREN() { return getToken(NCIntentDslParser.LPAREN, 0); }
-		public IdListContext idList() {
-			return getRuleContext(IdListContext.class,0);
-		}
-		public TerminalNode RPAREN() { return getToken(NCIntentDslParser.RPAREN, 0); }
-		public FlowItemIdsContext(ParserRuleContext parent, int invokingState) {
-			super(parent, invokingState);
-		}
-		@Override public int getRuleIndex() { return RULE_flowItemIds; }
-		@Override
-		public void enterRule(ParseTreeListener listener) {
-			if ( listener instanceof NCIntentDslListener ) ((NCIntentDslListener)listener).enterFlowItemIds(this);
-		}
-		@Override
-		public void exitRule(ParseTreeListener listener) {
-			if ( listener instanceof NCIntentDslListener ) ((NCIntentDslListener)listener).exitFlowItemIds(this);
-		}
-	}
-
-	public final FlowItemIdsContext flowItemIds() throws RecognitionException {
-		FlowItemIdsContext _localctx = new FlowItemIdsContext(_ctx, getState());
-		enterRule(_localctx, 12, RULE_flowItemIds);
-		try {
-			setState(95);
-			_errHandler.sync(this);
-			switch (_input.LA(1)) {
-			case ID:
-				enterOuterAlt(_localctx, 1);
-				{
-				setState(90);
-				match(ID);
-				}
-				break;
-			case LPAREN:
-				enterOuterAlt(_localctx, 2);
-				{
-				setState(91);
-				match(LPAREN);
-				setState(92);
-				idList(0);
-				setState(93);
-				match(RPAREN);
-				}
-				break;
-			default:
-				throw new NoViableAltException(this);
+			setState(62);
+			qstring();
 			}
 		}
 		catch (RecognitionException re) {
@@ -522,83 +310,6 @@ public class NCIntentDslParser extends Parser {
 		return _localctx;
 	}
 
-	public static class IdListContext extends ParserRuleContext {
-		public TerminalNode ID() { return getToken(NCIntentDslParser.ID, 0); }
-		public IdListContext idList() {
-			return getRuleContext(IdListContext.class,0);
-		}
-		public TerminalNode VERT() { return getToken(NCIntentDslParser.VERT, 0); }
-		public IdListContext(ParserRuleContext parent, int invokingState) {
-			super(parent, invokingState);
-		}
-		@Override public int getRuleIndex() { return RULE_idList; }
-		@Override
-		public void enterRule(ParseTreeListener listener) {
-			if ( listener instanceof NCIntentDslListener ) ((NCIntentDslListener)listener).enterIdList(this);
-		}
-		@Override
-		public void exitRule(ParseTreeListener listener) {
-			if ( listener instanceof NCIntentDslListener ) ((NCIntentDslListener)listener).exitIdList(this);
-		}
-	}
-
-	public final IdListContext idList() throws RecognitionException {
-		return idList(0);
-	}
-
-	private IdListContext idList(int _p) throws RecognitionException {
-		ParserRuleContext _parentctx = _ctx;
-		int _parentState = getState();
-		IdListContext _localctx = new IdListContext(_ctx, _parentState);
-		IdListContext _prevctx = _localctx;
-		int _startState = 14;
-		enterRecursionRule(_localctx, 14, RULE_idList, _p);
-		try {
-			int _alt;
-			enterOuterAlt(_localctx, 1);
-			{
-			{
-			setState(98);
-			match(ID);
-			}
-			_ctx.stop = _input.LT(-1);
-			setState(105);
-			_errHandler.sync(this);
-			_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
-			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
-				if ( _alt==1 ) {
-					if ( _parseListeners!=null ) triggerExitRuleEvent();
-					_prevctx = _localctx;
-					{
-					{
-					_localctx = new IdListContext(_parentctx, _parentState);
-					pushNewRecursionContext(_localctx, _startState, RULE_idList);
-					setState(100);
-					if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
-					setState(101);
-					match(VERT);
-					setState(102);
-					match(ID);
-					}
-					} 
-				}
-				setState(107);
-				_errHandler.sync(this);
-				_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
-			}
-			}
-		}
-		catch (RecognitionException re) {
-			_localctx.exception = re;
-			_errHandler.reportError(this, re);
-			_errHandler.recover(this, re);
-		}
-		finally {
-			unrollRecursionContexts(_parentctx);
-		}
-		return _localctx;
-	}
-
 	public static class TermsContext extends ParserRuleContext {
 		public TermContext term() {
 			return getRuleContext(TermContext.class,0);
@@ -629,20 +340,20 @@ public class NCIntentDslParser extends Parser {
 		int _parentState = getState();
 		TermsContext _localctx = new TermsContext(_ctx, _parentState);
 		TermsContext _prevctx = _localctx;
-		int _startState = 16;
-		enterRecursionRule(_localctx, 16, RULE_terms, _p);
+		int _startState = 8;
+		enterRecursionRule(_localctx, 8, RULE_terms, _p);
 		try {
 			int _alt;
 			enterOuterAlt(_localctx, 1);
 			{
 			{
-			setState(109);
+			setState(65);
 			term();
 			}
 			_ctx.stop = _input.LT(-1);
-			setState(115);
+			setState(71);
 			_errHandler.sync(this);
-			_alt = getInterpreter().adaptivePredict(_input,7,_ctx);
+			_alt = getInterpreter().adaptivePredict(_input,2,_ctx);
 			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
 				if ( _alt==1 ) {
 					if ( _parseListeners!=null ) triggerExitRuleEvent();
@@ -651,16 +362,16 @@ public class NCIntentDslParser extends Parser {
 					{
 					_localctx = new TermsContext(_parentctx, _parentState);
 					pushNewRecursionContext(_localctx, _startState, RULE_terms);
-					setState(111);
+					setState(67);
 					if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
-					setState(112);
+					setState(68);
 					term();
 					}
 					} 
 				}
-				setState(117);
+				setState(73);
 				_errHandler.sync(this);
-				_alt = getInterpreter().adaptivePredict(_input,7,_ctx);
+				_alt = getInterpreter().adaptivePredict(_input,2,_ctx);
 			}
 			}
 		}
@@ -694,12 +405,12 @@ public class NCIntentDslParser extends Parser {
 
 	public final TermEqContext termEq() throws RecognitionException {
 		TermEqContext _localctx = new TermEqContext(_ctx, getState());
-		enterRule(_localctx, 18, RULE_termEq);
+		enterRule(_localctx, 10, RULE_termEq);
 		int _la;
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(118);
+			setState(74);
 			_la = _input.LA(1);
 			if ( !(_la==TILDA || _la==EQ) ) {
 			_errHandler.recoverInline(this);
@@ -753,37 +464,37 @@ public class NCIntentDslParser extends Parser {
 
 	public final TermContext term() throws RecognitionException {
 		TermContext _localctx = new TermContext(_ctx, getState());
-		enterRule(_localctx, 20, RULE_term);
+		enterRule(_localctx, 12, RULE_term);
 		int _la;
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(120);
+			setState(76);
 			match(T__3);
-			setState(122);
+			setState(78);
 			_errHandler.sync(this);
 			_la = _input.LA(1);
 			if (_la==LPAREN) {
 				{
-				setState(121);
+				setState(77);
 				termId();
 				}
 			}
 
-			setState(124);
+			setState(80);
 			termEq();
-			setState(125);
+			setState(81);
 			match(LCURLY);
-			setState(126);
+			setState(82);
 			item(0);
-			setState(127);
+			setState(83);
 			match(RCURLY);
-			setState(129);
+			setState(85);
 			_errHandler.sync(this);
-			switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) {
+			switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
 			case 1:
 				{
-				setState(128);
+				setState(84);
 				minMax();
 				}
 				break;
@@ -821,15 +532,15 @@ public class NCIntentDslParser extends Parser {
 
 	public final TermIdContext termId() throws RecognitionException {
 		TermIdContext _localctx = new TermIdContext(_ctx, getState());
-		enterRule(_localctx, 22, RULE_termId);
+		enterRule(_localctx, 14, RULE_termId);
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(131);
+			setState(87);
 			match(LPAREN);
-			setState(132);
+			setState(88);
 			match(ID);
-			setState(133);
+			setState(89);
 			match(RPAREN);
 			}
 		}
@@ -882,14 +593,14 @@ public class NCIntentDslParser extends Parser {
 		int _parentState = getState();
 		ItemContext _localctx = new ItemContext(_ctx, _parentState);
 		ItemContext _prevctx = _localctx;
-		int _startState = 24;
-		enterRecursionRule(_localctx, 24, RULE_item, _p);
+		int _startState = 16;
+		enterRecursionRule(_localctx, 16, RULE_item, _p);
 		int _la;
 		try {
 			int _alt;
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(143);
+			setState(99);
 			_errHandler.sync(this);
 			switch (_input.LA(1)) {
 			case T__4:
@@ -903,25 +614,25 @@ public class NCIntentDslParser extends Parser {
 			case TILDA:
 			case ID:
 				{
-				setState(136);
+				setState(92);
 				predicate();
 				}
 				break;
 			case LPAREN:
 				{
-				setState(137);
+				setState(93);
 				match(LPAREN);
-				setState(138);
+				setState(94);
 				item(0);
-				setState(139);
+				setState(95);
 				match(RPAREN);
 				}
 				break;
 			case EXCL:
 				{
-				setState(141);
+				setState(97);
 				match(EXCL);
-				setState(142);
+				setState(98);
 				item(1);
 				}
 				break;
@@ -929,9 +640,9 @@ public class NCIntentDslParser extends Parser {
 				throw new NoViableAltException(this);
 			}
 			_ctx.stop = _input.LT(-1);
-			setState(150);
+			setState(106);
 			_errHandler.sync(this);
-			_alt = getInterpreter().adaptivePredict(_input,11,_ctx);
+			_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
 			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
 				if ( _alt==1 ) {
 					if ( _parseListeners!=null ) triggerExitRuleEvent();
@@ -940,9 +651,9 @@ public class NCIntentDslParser extends Parser {
 					{
 					_localctx = new ItemContext(_parentctx, _parentState);
 					pushNewRecursionContext(_localctx, _startState, RULE_item);
-					setState(145);
+					setState(101);
 					if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
-					setState(146);
+					setState(102);
 					_la = _input.LA(1);
 					if ( !(_la==AND || _la==OR) ) {
 					_errHandler.recoverInline(this);
@@ -952,14 +663,14 @@ public class NCIntentDslParser extends Parser {
 						_errHandler.reportMatch(this);
 						consume();
 					}
-					setState(147);
+					setState(103);
 					item(3);
 					}
 					} 
 				}
-				setState(152);
+				setState(108);
 				_errHandler.sync(this);
-				_alt = getInterpreter().adaptivePredict(_input,11,_ctx);
+				_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
 			}
 			}
 		}
@@ -1001,36 +712,36 @@ public class NCIntentDslParser extends Parser {
 
 	public final PredicateContext predicate() throws RecognitionException {
 		PredicateContext _localctx = new PredicateContext(_ctx, getState());
-		enterRule(_localctx, 26, RULE_predicate);
+		enterRule(_localctx, 18, RULE_predicate);
 		try {
-			setState(164);
+			setState(120);
 			_errHandler.sync(this);
-			switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) {
+			switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) {
 			case 1:
 				enterOuterAlt(_localctx, 1);
 				{
-				setState(153);
+				setState(109);
 				lval();
-				setState(154);
+				setState(110);
 				match(PRED_OP);
-				setState(155);
+				setState(111);
 				rval();
 				}
 				break;
 			case 2:
 				enterOuterAlt(_localctx, 2);
 				{
-				setState(157);
+				setState(113);
 				match(ID);
-				setState(158);
+				setState(114);
 				match(LPAREN);
-				setState(159);
+				setState(115);
 				lval();
-				setState(160);
+				setState(116);
 				match(RPAREN);
-				setState(161);
+				setState(117);
 				match(PRED_OP);
-				setState(162);
+				setState(118);
 				rval();
 				}
 				break;
@@ -1070,75 +781,75 @@ public class NCIntentDslParser extends Parser {
 
 	public final LvalContext lval() throws RecognitionException {
 		LvalContext _localctx = new LvalContext(_ctx, getState());
-		enterRule(_localctx, 28, RULE_lval);
+		enterRule(_localctx, 20, RULE_lval);
 		int _la;
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(167);
+			setState(123);
 			_errHandler.sync(this);
 			_la = _input.LA(1);
 			if (_la==ID) {
 				{
-				setState(166);
+				setState(122);
 				lvalQual(0);
 				}
 			}
 
-			setState(178);
+			setState(134);
 			_errHandler.sync(this);
 			switch (_input.LA(1)) {
 			case T__4:
 				{
-				setState(169);
+				setState(125);
 				match(T__4);
 				}
 				break;
 			case T__5:
 				{
-				setState(170);
+				setState(126);
 				match(T__5);
 				}
 				break;
 			case T__6:
 				{
-				setState(171);
+				setState(127);
 				match(T__6);
 				}
 				break;
 			case T__7:
 				{
-				setState(172);
+				setState(128);
 				match(T__7);
 				}
 				break;
 			case T__8:
 				{
-				setState(173);
+				setState(129);
 				match(T__8);
 				}
 				break;
 			case T__9:
 				{
-				setState(174);
+				setState(130);
 				match(T__9);
 				}
 				break;
 			case T__10:
 				{
-				setState(175);
+				setState(131);
 				match(T__10);
 				}
 				break;
 			case T__11:
 				{
-				setState(176);
+				setState(132);
 				match(T__11);
 				}
 				break;
 			case TILDA:
 				{
-				setState(177);
+				setState(133);
 				meta();
 				}
 				break;
@@ -1188,20 +899,20 @@ public class NCIntentDslParser extends Parser {
 		int _parentState = getState();
 		LvalQualContext _localctx = new LvalQualContext(_ctx, _parentState);
 		LvalQualContext _prevctx = _localctx;
-		int _startState = 30;
-		enterRecursionRule(_localctx, 30, RULE_lvalQual, _p);
+		int _startState = 22;
+		enterRecursionRule(_localctx, 22, RULE_lvalQual, _p);
 		try {
 			int _alt;
 			enterOuterAlt(_localctx, 1);
 			{
 			{
-			setState(181);
+			setState(137);
 			lvalPart();
 			}
 			_ctx.stop = _input.LT(-1);
-			setState(187);
+			setState(143);
 			_errHandler.sync(this);
-			_alt = getInterpreter().adaptivePredict(_input,15,_ctx);
+			_alt = getInterpreter().adaptivePredict(_input,10,_ctx);
 			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
 				if ( _alt==1 ) {
 					if ( _parseListeners!=null ) triggerExitRuleEvent();
@@ -1210,16 +921,16 @@ public class NCIntentDslParser extends Parser {
 					{
 					_localctx = new LvalQualContext(_parentctx, _parentState);
 					pushNewRecursionContext(_localctx, _startState, RULE_lvalQual);
-					setState(183);
+					setState(139);
 					if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
-					setState(184);
+					setState(140);
 					lvalPart();
 					}
 					} 
 				}
-				setState(189);
+				setState(145);
 				_errHandler.sync(this);
-				_alt = getInterpreter().adaptivePredict(_input,15,_ctx);
+				_alt = getInterpreter().adaptivePredict(_input,10,_ctx);
 			}
 			}
 		}
@@ -1253,13 +964,13 @@ public class NCIntentDslParser extends Parser {
 
 	public final LvalPartContext lvalPart() throws RecognitionException {
 		LvalPartContext _localctx = new LvalPartContext(_ctx, getState());
-		enterRule(_localctx, 32, RULE_lvalPart);
+		enterRule(_localctx, 24, RULE_lvalPart);
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(190);
+			setState(146);
 			match(ID);
-			setState(191);
+			setState(147);
 			match(DOT);
 			}
 		}
@@ -1298,16 +1009,16 @@ public class NCIntentDslParser extends Parser {
 
 	public final RvalSingleContext rvalSingle() throws RecognitionException {
 		RvalSingleContext _localctx = new RvalSingleContext(_ctx, getState());
-		enterRule(_localctx, 34, RULE_rvalSingle);
+		enterRule(_localctx, 26, RULE_rvalSingle);
 		int _la;
 		try {
-			setState(204);
+			setState(160);
 			_errHandler.sync(this);
 			switch (_input.LA(1)) {
 			case T__12:
 				enterOuterAlt(_localctx, 1);
 				{
-				setState(193);
+				setState(149);
 				match(T__12);
 				}
 				break;
@@ -1315,30 +1026,30 @@ public class NCIntentDslParser extends Parser {
 			case INT:
 				enterOuterAlt(_localctx, 2);
 				{
-				setState(195);
+				setState(151);
 				_errHandler.sync(this);
 				_la = _input.LA(1);
 				if (_la==MINUS) {
 					{
-					setState(194);
+					setState(150);
 					match(MINUS);
 					}
 				}
 
-				setState(200);
+				setState(156);
 				_errHandler.sync(this);
-				switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) {
+				switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) {
 				case 1:
 					{
-					setState(197);
+					setState(153);
 					match(INT);
 					}
 					break;
 				case 2:
 					{
-					setState(198);
+					setState(154);
 					match(INT);
-					setState(199);
+					setState(155);
 					match(EXP);
 					}
 					break;
@@ -1348,14 +1059,14 @@ public class NCIntentDslParser extends Parser {
 			case BOOL:
 				enterOuterAlt(_localctx, 3);
 				{
-				setState(202);
+				setState(158);
 				match(BOOL);
 				}
 				break;
 			case SQUOTE:
 				enterOuterAlt(_localctx, 4);
 				{
-				setState(203);
+				setState(159);
 				qstring();
 				}
 				break;
@@ -1399,9 +1110,9 @@ public class NCIntentDslParser extends Parser {
 
 	public final RvalContext rval() throws RecognitionException {
 		RvalContext _localctx = new RvalContext(_ctx, getState());
-		enterRule(_localctx, 36, RULE_rval);
+		enterRule(_localctx, 28, RULE_rval);
 		try {
-			setState(211);
+			setState(167);
 			_errHandler.sync(this);
 			switch (_input.LA(1)) {
 			case T__12:
@@ -1411,18 +1122,18 @@ public class NCIntentDslParser extends Parser {
 			case INT:
 				enterOuterAlt(_localctx, 1);
 				{
-				setState(206);
+				setState(162);
 				rvalSingle();
 				}
 				break;
 			case LPAREN:
 				enterOuterAlt(_localctx, 2);
 				{
-				setState(207);
+				setState(163);
 				match(LPAREN);
-				setState(208);
+				setState(164);
 				rvalList(0);
-				setState(209);
+				setState(165);
 				match(RPAREN);
 				}
 				break;
@@ -1472,20 +1183,20 @@ public class NCIntentDslParser extends Parser {
 		int _parentState = getState();
 		RvalListContext _localctx = new RvalListContext(_ctx, _parentState);
 		RvalListContext _prevctx = _localctx;
-		int _startState = 38;
-		enterRecursionRule(_localctx, 38, RULE_rvalList, _p);
+		int _startState = 30;
+		enterRecursionRule(_localctx, 30, RULE_rvalList, _p);
 		try {
 			int _alt;
 			enterOuterAlt(_localctx, 1);
 			{
 			{
-			setState(214);
+			setState(170);
 			rvalSingle();
 			}
 			_ctx.stop = _input.LT(-1);
-			setState(221);
+			setState(177);
 			_errHandler.sync(this);
-			_alt = getInterpreter().adaptivePredict(_input,20,_ctx);
+			_alt = getInterpreter().adaptivePredict(_input,15,_ctx);
 			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
 				if ( _alt==1 ) {
 					if ( _parseListeners!=null ) triggerExitRuleEvent();
@@ -1494,18 +1205,18 @@ public class NCIntentDslParser extends Parser {
 					{
 					_localctx = new RvalListContext(_parentctx, _parentState);
 					pushNewRecursionContext(_localctx, _startState, RULE_rvalList);
-					setState(216);
+					setState(172);
 					if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
-					setState(217);
+					setState(173);
 					match(COMMA);
-					setState(218);
+					setState(174);
 					rvalSingle();
 					}
 					} 
 				}
-				setState(223);
+				setState(179);
 				_errHandler.sync(this);
-				_alt = getInterpreter().adaptivePredict(_input,20,_ctx);
+				_alt = getInterpreter().adaptivePredict(_input,15,_ctx);
 			}
 			}
 		}
@@ -1545,47 +1256,47 @@ public class NCIntentDslParser extends Parser {
 
 	public final MetaContext meta() throws RecognitionException {
 		MetaContext _localctx = new MetaContext(_ctx, getState());
-		enterRule(_localctx, 40, RULE_meta);
+		enterRule(_localctx, 32, RULE_meta);
 		try {
-			setState(237);
+			setState(193);
 			_errHandler.sync(this);
-			switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) {
+			switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) {
 			case 1:
 				enterOuterAlt(_localctx, 1);
 				{
-				setState(224);
+				setState(180);
 				match(TILDA);
-				setState(225);
+				setState(181);
 				match(ID);
 				}
 				break;
 			case 2:
 				enterOuterAlt(_localctx, 2);
 				{
-				setState(226);
+				setState(182);
 				match(TILDA);
-				setState(227);
+				setState(183);
 				match(ID);
-				setState(228);
+				setState(184);
 				match(LBR);
-				setState(229);
+				setState(185);
 				match(INT);
-				setState(230);
+				setState(186);
 				match(RBR);
 				}
 				break;
 			case 3:
 				enterOuterAlt(_localctx, 3);
 				{
-				setState(231);
+				setState(187);
 				match(TILDA);
-				setState(232);
+				setState(188);
 				match(ID);
-				setState(233);
+				setState(189);
 				match(LBR);
-				setState(234);
+				setState(190);
 				qstring();
-				setState(235);
+				setState(191);
 				match(RBR);
 				}
 				break;
@@ -1623,20 +1334,20 @@ public class NCIntentDslParser extends Parser {
 
 	public final QstringContext qstring() throws RecognitionException {
 		QstringContext _localctx = new QstringContext(_ctx, getState());
-		enterRule(_localctx, 42, RULE_qstring);
+		enterRule(_localctx, 34, RULE_qstring);
 		int _la;
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(239);
+			setState(195);
 			match(SQUOTE);
-			setState(243);
+			setState(199);
 			_errHandler.sync(this);
 			_la = _input.LA(1);
-			while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__1) | (1L << T__2) | (1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << PRED_OP) | (1L << AND) | (1L << OR) | (1L << VERT) | (1L << EXCL) | (1L << LPAREN) | (1L << RPAREN) | (1L << LCURLY) | (1L << RCURLY) | (1L << TILDA) | (1L << RIGHT) | (1L << LBR) | (1L << RBR) | (1L << COMMA) | (1L << COLON) | (1L << M [...]
+			while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__1) | (1L << T__2) | (1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << PRED_OP) | (1L << AND) | (1L << OR) | (1L << VERT) | (1L << EXCL) | (1L << LPAREN) | (1L << RPAREN) | (1L << LCURLY) | (1L << RCURLY) | (1L << TILDA) | (1L << RIGHT) | (1L << LBR) | (1L << RBR) | (1L << COMMA) | (1L << COLON) | (1L << M [...]
 				{
 				{
-				setState(240);
+				setState(196);
 				_la = _input.LA(1);
 				if ( _la <= 0 || (_la==SQUOTE) ) {
 				_errHandler.recoverInline(this);
@@ -1648,11 +1359,11 @@ public class NCIntentDslParser extends Parser {
 				}
 				}
 				}
-				setState(245);
+				setState(201);
 				_errHandler.sync(this);
 				_la = _input.LA(1);
 			}
-			setState(246);
+			setState(202);
 			match(SQUOTE);
 			}
 		}
@@ -1690,9 +1401,9 @@ public class NCIntentDslParser extends Parser {
 
 	public final MinMaxContext minMax() throws RecognitionException {
 		MinMaxContext _localctx = new MinMaxContext(_ctx, getState());
-		enterRule(_localctx, 44, RULE_minMax);
+		enterRule(_localctx, 36, RULE_minMax);
 		try {
-			setState(250);
+			setState(206);
 			_errHandler.sync(this);
 			switch (_input.LA(1)) {
 			case PLUS:
@@ -1700,14 +1411,14 @@ public class NCIntentDslParser extends Parser {
 			case STAR:
 				enterOuterAlt(_localctx, 1);
 				{
-				setState(248);
+				setState(204);
 				minMaxShortcut();
 				}
 				break;
 			case LBR:
 				enterOuterAlt(_localctx, 2);
 				{
-				setState(249);
+				setState(205);
 				minMaxRange();
 				}
 				break;
@@ -1746,12 +1457,12 @@ public class NCIntentDslParser extends Parser {
 
 	public final MinMaxShortcutContext minMaxShortcut() throws RecognitionException {
 		MinMaxShortcutContext _localctx = new MinMaxShortcutContext(_ctx, getState());
-		enterRule(_localctx, 46, RULE_minMaxShortcut);
+		enterRule(_localctx, 38, RULE_minMaxShortcut);
 		int _la;
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(252);
+			setState(208);
 			_la = _input.LA(1);
 			if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PLUS) | (1L << QUESTION) | (1L << STAR))) != 0)) ) {
 			_errHandler.recoverInline(this);
@@ -1798,19 +1509,19 @@ public class NCIntentDslParser extends Parser {
 
 	public final MinMaxRangeContext minMaxRange() throws RecognitionException {
 		MinMaxRangeContext _localctx = new MinMaxRangeContext(_ctx, getState());
-		enterRule(_localctx, 48, RULE_minMaxRange);
+		enterRule(_localctx, 40, RULE_minMaxRange);
 		try {
 			enterOuterAlt(_localctx, 1);
 			{
-			setState(254);
+			setState(210);
 			match(LBR);
-			setState(255);
+			setState(211);
 			match(INT);
-			setState(256);
+			setState(212);
 			match(COMMA);
-			setState(257);
+			setState(213);
 			match(INT);
-			setState(258);
+			setState(214);
 			match(RBR);
 			}
 		}
@@ -1828,151 +1539,115 @@ public class NCIntentDslParser extends Parser {
 	public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
 		switch (ruleIndex) {
 		case 4:
-			return flow_sempred((FlowContext)_localctx, predIndex);
-		case 7:
-			return idList_sempred((IdListContext)_localctx, predIndex);
-		case 8:
 			return terms_sempred((TermsContext)_localctx, predIndex);
-		case 12:
+		case 8:
 			return item_sempred((ItemContext)_localctx, predIndex);
-		case 15:
+		case 11:
 			return lvalQual_sempred((LvalQualContext)_localctx, predIndex);
-		case 19:
+		case 15:
 			return rvalList_sempred((RvalListContext)_localctx, predIndex);
 		}
 		return true;
 	}
-	private boolean flow_sempred(FlowContext _localctx, int predIndex) {
-		switch (predIndex) {
-		case 0:
-			return precpred(_ctx, 1);
-		}
-		return true;
-	}
-	private boolean idList_sempred(IdListContext _localctx, int predIndex) {
-		switch (predIndex) {
-		case 1:
-			return precpred(_ctx, 1);
-		}
-		return true;
-	}
 	private boolean terms_sempred(TermsContext _localctx, int predIndex) {
 		switch (predIndex) {
-		case 2:
+		case 0:
 			return precpred(_ctx, 1);
 		}
 		return true;
 	}
 	private boolean item_sempred(ItemContext _localctx, int predIndex) {
 		switch (predIndex) {
-		case 3:
+		case 1:
 			return precpred(_ctx, 2);
 		}
 		return true;
 	}
 	private boolean lvalQual_sempred(LvalQualContext _localctx, int predIndex) {
 		switch (predIndex) {
-		case 4:
+		case 2:
 			return precpred(_ctx, 1);
 		}
 		return true;
 	}
 	private boolean rvalList_sempred(RvalListContext _localctx, int predIndex) {
 		switch (predIndex) {
-		case 5:
+		case 3:
 			return precpred(_ctx, 1);
 		}
 		return true;
 	}
 
 	public static final String _serializedATN =
-		"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3,\u0107\4\2\t\2\4"+
+		"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.\u00db\4\2\t\2\4"+
 		"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
 		"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
-		"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
-		"\4\32\t\32\3\2\3\2\5\2\67\n\2\3\2\5\2:\n\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3"+
-		"\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\5\6O\n\6\3\6\3\6\3\6"+
-		"\7\6T\n\6\f\6\16\6W\13\6\3\7\3\7\5\7[\n\7\3\b\3\b\3\b\3\b\3\b\5\bb\n\b"+
-		"\3\t\3\t\3\t\3\t\3\t\3\t\7\tj\n\t\f\t\16\tm\13\t\3\n\3\n\3\n\3\n\3\n\7"+
-		"\nt\n\n\f\n\16\nw\13\n\3\13\3\13\3\f\3\f\5\f}\n\f\3\f\3\f\3\f\3\f\3\f"+
-		"\5\f\u0084\n\f\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16"+
-		"\5\16\u0092\n\16\3\16\3\16\3\16\7\16\u0097\n\16\f\16\16\16\u009a\13\16"+
-		"\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\5\17\u00a7\n\17"+
-		"\3\20\5\20\u00aa\n\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\5\20"+
-		"\u00b5\n\20\3\21\3\21\3\21\3\21\3\21\7\21\u00bc\n\21\f\21\16\21\u00bf"+
-		"\13\21\3\22\3\22\3\22\3\23\3\23\5\23\u00c6\n\23\3\23\3\23\3\23\5\23\u00cb"+
-		"\n\23\3\23\3\23\5\23\u00cf\n\23\3\24\3\24\3\24\3\24\3\24\5\24\u00d6\n"+
-		"\24\3\25\3\25\3\25\3\25\3\25\3\25\7\25\u00de\n\25\f\25\16\25\u00e1\13"+
-		"\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5"+
-		"\26\u00f0\n\26\3\27\3\27\7\27\u00f4\n\27\f\27\16\27\u00f7\13\27\3\27\3"+
-		"\27\3\30\3\30\5\30\u00fd\n\30\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32"+
-		"\3\32\2\b\n\20\22\32 (\33\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&"+
-		"(*,.\60\62\2\6\4\2\32\32##\3\2\21\22\3\2\31\31\3\2$&\2\u0110\2\64\3\2"+
-		"\2\2\4>\3\2\2\2\6B\3\2\2\2\bF\3\2\2\2\nN\3\2\2\2\fX\3\2\2\2\16a\3\2\2"+
-		"\2\20c\3\2\2\2\22n\3\2\2\2\24x\3\2\2\2\26z\3\2\2\2\30\u0085\3\2\2\2\32"+
-		"\u0091\3\2\2\2\34\u00a6\3\2\2\2\36\u00a9\3\2\2\2 \u00b6\3\2\2\2\"\u00c0"+
-		"\3\2\2\2$\u00ce\3\2\2\2&\u00d5\3\2\2\2(\u00d7\3\2\2\2*\u00ef\3\2\2\2,"+
-		"\u00f1\3\2\2\2.\u00fc\3\2\2\2\60\u00fe\3\2\2\2\62\u0100\3\2\2\2\64\66"+
-		"\5\4\3\2\65\67\5\6\4\2\66\65\3\2\2\2\66\67\3\2\2\2\679\3\2\2\28:\5\b\5"+
-		"\298\3\2\2\29:\3\2\2\2:;\3\2\2\2;<\5\22\n\2<=\7\2\2\3=\3\3\2\2\2>?\7\3"+
-		"\2\2?@\7#\2\2@A\7*\2\2A\5\3\2\2\2BC\7\4\2\2CD\7#\2\2DE\7\'\2\2E\7\3\2"+
-		"\2\2FG\7\5\2\2GH\7#\2\2HI\7\31\2\2IJ\5\n\6\2JK\7\31\2\2K\t\3\2\2\2LO\b"+
-		"\6\1\2MO\5\f\7\2NL\3\2\2\2NM\3\2\2\2OU\3\2\2\2PQ\f\3\2\2QR\7\33\2\2RT"+
-		"\5\f\7\2SP\3\2\2\2TW\3\2\2\2US\3\2\2\2UV\3\2\2\2V\13\3\2\2\2WU\3\2\2\2"+
-		"XZ\5\16\b\2Y[\5.\30\2ZY\3\2\2\2Z[\3\2\2\2[\r\3\2\2\2\\b\7*\2\2]^\7\25"+
-		"\2\2^_\5\20\t\2_`\7\26\2\2`b\3\2\2\2a\\\3\2\2\2a]\3\2\2\2b\17\3\2\2\2"+
-		"cd\b\t\1\2de\7*\2\2ek\3\2\2\2fg\f\3\2\2gh\7\23\2\2hj\7*\2\2if\3\2\2\2"+
-		"jm\3\2\2\2ki\3\2\2\2kl\3\2\2\2l\21\3\2\2\2mk\3\2\2\2no\b\n\1\2op\5\26"+
-		"\f\2pu\3\2\2\2qr\f\3\2\2rt\5\26\f\2sq\3\2\2\2tw\3\2\2\2us\3\2\2\2uv\3"+
-		"\2\2\2v\23\3\2\2\2wu\3\2\2\2xy\t\2\2\2y\25\3\2\2\2z|\7\6\2\2{}\5\30\r"+
-		"\2|{\3\2\2\2|}\3\2\2\2}~\3\2\2\2~\177\5\24\13\2\177\u0080\7\27\2\2\u0080"+
-		"\u0081\5\32\16\2\u0081\u0083\7\30\2\2\u0082\u0084\5.\30\2\u0083\u0082"+
-		"\3\2\2\2\u0083\u0084\3\2\2\2\u0084\27\3\2\2\2\u0085\u0086\7\25\2\2\u0086"+
-		"\u0087\7*\2\2\u0087\u0088\7\26\2\2\u0088\31\3\2\2\2\u0089\u008a\b\16\1"+
-		"\2\u008a\u0092\5\34\17\2\u008b\u008c\7\25\2\2\u008c\u008d\5\32\16\2\u008d"+
-		"\u008e\7\26\2\2\u008e\u0092\3\2\2\2\u008f\u0090\7\24\2\2\u0090\u0092\5"+
-		"\32\16\3\u0091\u0089\3\2\2\2\u0091\u008b\3\2\2\2\u0091\u008f\3\2\2\2\u0092"+
-		"\u0098\3\2\2\2\u0093\u0094\f\4\2\2\u0094\u0095\t\3\2\2\u0095\u0097\5\32"+
-		"\16\5\u0096\u0093\3\2\2\2\u0097\u009a\3\2\2\2\u0098\u0096\3\2\2\2\u0098"+
-		"\u0099\3\2\2\2\u0099\33\3\2\2\2\u009a\u0098\3\2\2\2\u009b\u009c\5\36\20"+
-		"\2\u009c\u009d\7\20\2\2\u009d\u009e\5&\24\2\u009e\u00a7\3\2\2\2\u009f"+
-		"\u00a0\7*\2\2\u00a0\u00a1\7\25\2\2\u00a1\u00a2\5\36\20\2\u00a2\u00a3\7"+
-		"\26\2\2\u00a3\u00a4\7\20\2\2\u00a4\u00a5\5&\24\2\u00a5\u00a7\3\2\2\2\u00a6"+
-		"\u009b\3\2\2\2\u00a6\u009f\3\2\2\2\u00a7\35\3\2\2\2\u00a8\u00aa\5 \21"+
-		"\2\u00a9\u00a8\3\2\2\2\u00a9\u00aa\3\2\2\2\u00aa\u00b4\3\2\2\2\u00ab\u00b5"+
-		"\7\7\2\2\u00ac\u00b5\7\b\2\2\u00ad\u00b5\7\t\2\2\u00ae\u00b5\7\n\2\2\u00af"+
-		"\u00b5\7\13\2\2\u00b0\u00b5\7\f\2\2\u00b1\u00b5\7\r\2\2\u00b2\u00b5\7"+
-		"\16\2\2\u00b3\u00b5\5*\26\2\u00b4\u00ab\3\2\2\2\u00b4\u00ac\3\2\2\2\u00b4"+
-		"\u00ad\3\2\2\2\u00b4\u00ae\3\2\2\2\u00b4\u00af\3\2\2\2\u00b4\u00b0\3\2"+
-		"\2\2\u00b4\u00b1\3\2\2\2\u00b4\u00b2\3\2\2\2\u00b4\u00b3\3\2\2\2\u00b5"+
-		"\37\3\2\2\2\u00b6\u00b7\b\21\1\2\u00b7\u00b8\5\"\22\2\u00b8\u00bd\3\2"+
-		"\2\2\u00b9\u00ba\f\3\2\2\u00ba\u00bc\5\"\22\2\u00bb\u00b9\3\2\2\2\u00bc"+
-		"\u00bf\3\2\2\2\u00bd\u00bb\3\2\2\2\u00bd\u00be\3\2\2\2\u00be!\3\2\2\2"+
-		"\u00bf\u00bd\3\2\2\2\u00c0\u00c1\7*\2\2\u00c1\u00c2\7!\2\2\u00c2#\3\2"+
-		"\2\2\u00c3\u00cf\7\17\2\2\u00c4\u00c6\7 \2\2\u00c5\u00c4\3\2\2\2\u00c5"+
-		"\u00c6\3\2\2\2\u00c6\u00ca\3\2\2\2\u00c7\u00cb\7(\2\2\u00c8\u00c9\7(\2"+
-		"\2\u00c9\u00cb\7)\2\2\u00ca\u00c7\3\2\2\2\u00ca\u00c8\3\2\2\2\u00cb\u00cf"+
-		"\3\2\2\2\u00cc\u00cf\7\'\2\2\u00cd\u00cf\5,\27\2\u00ce\u00c3\3\2\2\2\u00ce"+
-		"\u00c5\3\2\2\2\u00ce\u00cc\3\2\2\2\u00ce\u00cd\3\2\2\2\u00cf%\3\2\2\2"+
-		"\u00d0\u00d6\5$\23\2\u00d1\u00d2\7\25\2\2\u00d2\u00d3\5(\25\2\u00d3\u00d4"+
-		"\7\26\2\2\u00d4\u00d6\3\2\2\2\u00d5\u00d0\3\2\2\2\u00d5\u00d1\3\2\2\2"+
-		"\u00d6\'\3\2\2\2\u00d7\u00d8\b\25\1\2\u00d8\u00d9\5$\23\2\u00d9\u00df"+
-		"\3\2\2\2\u00da\u00db\f\3\2\2\u00db\u00dc\7\36\2\2\u00dc\u00de\5$\23\2"+
-		"\u00dd\u00da\3\2\2\2\u00de\u00e1\3\2\2\2\u00df\u00dd\3\2\2\2\u00df\u00e0"+
-		"\3\2\2\2\u00e0)\3\2\2\2\u00e1\u00df\3\2\2\2\u00e2\u00e3\7\32\2\2\u00e3"+
-		"\u00f0\7*\2\2\u00e4\u00e5\7\32\2\2\u00e5\u00e6\7*\2\2\u00e6\u00e7\7\34"+
-		"\2\2\u00e7\u00e8\7(\2\2\u00e8\u00f0\7\35\2\2\u00e9\u00ea\7\32\2\2\u00ea"+
-		"\u00eb\7*\2\2\u00eb\u00ec\7\34\2\2\u00ec\u00ed\5,\27\2\u00ed\u00ee\7\35"+
-		"\2\2\u00ee\u00f0\3\2\2\2\u00ef\u00e2\3\2\2\2\u00ef\u00e4\3\2\2\2\u00ef"+
-		"\u00e9\3\2\2\2\u00f0+\3\2\2\2\u00f1\u00f5\7\31\2\2\u00f2\u00f4\n\4\2\2"+
-		"\u00f3\u00f2\3\2\2\2\u00f4\u00f7\3\2\2\2\u00f5\u00f3\3\2\2\2\u00f5\u00f6"+
-		"\3\2\2\2\u00f6\u00f8\3\2\2\2\u00f7\u00f5\3\2\2\2\u00f8\u00f9\7\31\2\2"+
-		"\u00f9-\3\2\2\2\u00fa\u00fd\5\60\31\2\u00fb\u00fd\5\62\32\2\u00fc\u00fa"+
-		"\3\2\2\2\u00fc\u00fb\3\2\2\2\u00fd/\3\2\2\2\u00fe\u00ff\t\5\2\2\u00ff"+
-		"\61\3\2\2\2\u0100\u0101\7\34\2\2\u0101\u0102\7(\2\2\u0102\u0103\7\36\2"+
-		"\2\u0103\u0104\7(\2\2\u0104\u0105\7\35\2\2\u0105\63\3\2\2\2\32\669NUZ"+
-		"aku|\u0083\u0091\u0098\u00a6\u00a9\u00b4\u00bd\u00c5\u00ca\u00ce\u00d5"+
-		"\u00df\u00ef\u00f5\u00fc";
+		"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\3\2\3\2\5\2/\n\2\3\2\5\2\62\n"+
+		"\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\6\3\6"+
+		"\3\6\3\6\3\6\7\6H\n\6\f\6\16\6K\13\6\3\7\3\7\3\b\3\b\5\bQ\n\b\3\b\3\b"+
+		"\3\b\3\b\3\b\5\bX\n\b\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n"+
+		"\5\nf\n\n\3\n\3\n\3\n\7\nk\n\n\f\n\16\nn\13\n\3\13\3\13\3\13\3\13\3\13"+
+		"\3\13\3\13\3\13\3\13\3\13\3\13\5\13{\n\13\3\f\5\f~\n\f\3\f\3\f\3\f\3\f"+
+		"\3\f\3\f\3\f\3\f\3\f\5\f\u0089\n\f\3\r\3\r\3\r\3\r\3\r\7\r\u0090\n\r\f"+
+		"\r\16\r\u0093\13\r\3\16\3\16\3\16\3\17\3\17\5\17\u009a\n\17\3\17\3\17"+
+		"\3\17\5\17\u009f\n\17\3\17\3\17\5\17\u00a3\n\17\3\20\3\20\3\20\3\20\3"+
+		"\20\5\20\u00aa\n\20\3\21\3\21\3\21\3\21\3\21\3\21\7\21\u00b2\n\21\f\21"+
+		"\16\21\u00b5\13\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3"+
+		"\22\3\22\3\22\5\22\u00c4\n\22\3\23\3\23\7\23\u00c8\n\23\f\23\16\23\u00cb"+
+		"\13\23\3\23\3\23\3\24\3\24\5\24\u00d1\n\24\3\25\3\25\3\26\3\26\3\26\3"+
+		"\26\3\26\3\26\3\26\2\6\n\22\30 \27\2\4\6\b\n\f\16\20\22\24\26\30\32\34"+
+		"\36 \"$&(*\2\6\4\2\32\32##\3\2\21\22\3\2\31\31\3\2$&\2\u00e3\2,\3\2\2"+
+		"\2\4\66\3\2\2\2\6:\3\2\2\2\b>\3\2\2\2\nB\3\2\2\2\fL\3\2\2\2\16N\3\2\2"+
+		"\2\20Y\3\2\2\2\22e\3\2\2\2\24z\3\2\2\2\26}\3\2\2\2\30\u008a\3\2\2\2\32"+
+		"\u0094\3\2\2\2\34\u00a2\3\2\2\2\36\u00a9\3\2\2\2 \u00ab\3\2\2\2\"\u00c3"+
+		"\3\2\2\2$\u00c5\3\2\2\2&\u00d0\3\2\2\2(\u00d2\3\2\2\2*\u00d4\3\2\2\2,"+
+		".\5\4\3\2-/\5\6\4\2.-\3\2\2\2./\3\2\2\2/\61\3\2\2\2\60\62\5\b\5\2\61\60"+
+		"\3\2\2\2\61\62\3\2\2\2\62\63\3\2\2\2\63\64\5\n\6\2\64\65\7\2\2\3\65\3"+
+		"\3\2\2\2\66\67\7\3\2\2\678\7#\2\289\7,\2\29\5\3\2\2\2:;\7\4\2\2;<\7#\2"+
+		"\2<=\7)\2\2=\7\3\2\2\2>?\7\5\2\2?@\7#\2\2@A\5$\23\2A\t\3\2\2\2BC\b\6\1"+
+		"\2CD\5\16\b\2DI\3\2\2\2EF\f\3\2\2FH\5\16\b\2GE\3\2\2\2HK\3\2\2\2IG\3\2"+
+		"\2\2IJ\3\2\2\2J\13\3\2\2\2KI\3\2\2\2LM\t\2\2\2M\r\3\2\2\2NP\7\6\2\2OQ"+
+		"\5\20\t\2PO\3\2\2\2PQ\3\2\2\2QR\3\2\2\2RS\5\f\7\2ST\7\27\2\2TU\5\22\n"+
+		"\2UW\7\30\2\2VX\5&\24\2WV\3\2\2\2WX\3\2\2\2X\17\3\2\2\2YZ\7\25\2\2Z[\7"+
+		",\2\2[\\\7\26\2\2\\\21\3\2\2\2]^\b\n\1\2^f\5\24\13\2_`\7\25\2\2`a\5\22"+
+		"\n\2ab\7\26\2\2bf\3\2\2\2cd\7\24\2\2df\5\22\n\3e]\3\2\2\2e_\3\2\2\2ec"+
+		"\3\2\2\2fl\3\2\2\2gh\f\4\2\2hi\t\3\2\2ik\5\22\n\5jg\3\2\2\2kn\3\2\2\2"+
+		"lj\3\2\2\2lm\3\2\2\2m\23\3\2\2\2nl\3\2\2\2op\5\26\f\2pq\7\20\2\2qr\5\36"+
+		"\20\2r{\3\2\2\2st\7,\2\2tu\7\25\2\2uv\5\26\f\2vw\7\26\2\2wx\7\20\2\2x"+
+		"y\5\36\20\2y{\3\2\2\2zo\3\2\2\2zs\3\2\2\2{\25\3\2\2\2|~\5\30\r\2}|\3\2"+
+		"\2\2}~\3\2\2\2~\u0088\3\2\2\2\177\u0089\7\7\2\2\u0080\u0089\7\b\2\2\u0081"+
+		"\u0089\7\t\2\2\u0082\u0089\7\n\2\2\u0083\u0089\7\13\2\2\u0084\u0089\7"+
+		"\f\2\2\u0085\u0089\7\r\2\2\u0086\u0089\7\16\2\2\u0087\u0089\5\"\22\2\u0088"+
+		"\177\3\2\2\2\u0088\u0080\3\2\2\2\u0088\u0081\3\2\2\2\u0088\u0082\3\2\2"+
+		"\2\u0088\u0083\3\2\2\2\u0088\u0084\3\2\2\2\u0088\u0085\3\2\2\2\u0088\u0086"+
+		"\3\2\2\2\u0088\u0087\3\2\2\2\u0089\27\3\2\2\2\u008a\u008b\b\r\1\2\u008b"+
+		"\u008c\5\32\16\2\u008c\u0091\3\2\2\2\u008d\u008e\f\3\2\2\u008e\u0090\5"+
+		"\32\16\2\u008f\u008d\3\2\2\2\u0090\u0093\3\2\2\2\u0091\u008f\3\2\2\2\u0091"+
+		"\u0092\3\2\2\2\u0092\31\3\2\2\2\u0093\u0091\3\2\2\2\u0094\u0095\7,\2\2"+
+		"\u0095\u0096\7!\2\2\u0096\33\3\2\2\2\u0097\u00a3\7\17\2\2\u0098\u009a"+
+		"\7 \2\2\u0099\u0098\3\2\2\2\u0099\u009a\3\2\2\2\u009a\u009e\3\2\2\2\u009b"+
+		"\u009f\7*\2\2\u009c\u009d\7*\2\2\u009d\u009f\7+\2\2\u009e\u009b\3\2\2"+
+		"\2\u009e\u009c\3\2\2\2\u009f\u00a3\3\2\2\2\u00a0\u00a3\7)\2\2\u00a1\u00a3"+
+		"\5$\23\2\u00a2\u0097\3\2\2\2\u00a2\u0099\3\2\2\2\u00a2\u00a0\3\2\2\2\u00a2"+
+		"\u00a1\3\2\2\2\u00a3\35\3\2\2\2\u00a4\u00aa\5\34\17\2\u00a5\u00a6\7\25"+
+		"\2\2\u00a6\u00a7\5 \21\2\u00a7\u00a8\7\26\2\2\u00a8\u00aa\3\2\2\2\u00a9"+
+		"\u00a4\3\2\2\2\u00a9\u00a5\3\2\2\2\u00aa\37\3\2\2\2\u00ab\u00ac\b\21\1"+
+		"\2\u00ac\u00ad\5\34\17\2\u00ad\u00b3\3\2\2\2\u00ae\u00af\f\3\2\2\u00af"+
+		"\u00b0\7\36\2\2\u00b0\u00b2\5\34\17\2\u00b1\u00ae\3\2\2\2\u00b2\u00b5"+
+		"\3\2\2\2\u00b3\u00b1\3\2\2\2\u00b3\u00b4\3\2\2\2\u00b4!\3\2\2\2\u00b5"+
+		"\u00b3\3\2\2\2\u00b6\u00b7\7\32\2\2\u00b7\u00c4\7,\2\2\u00b8\u00b9\7\32"+
+		"\2\2\u00b9\u00ba\7,\2\2\u00ba\u00bb\7\34\2\2\u00bb\u00bc\7*\2\2\u00bc"+
+		"\u00c4\7\35\2\2\u00bd\u00be\7\32\2\2\u00be\u00bf\7,\2\2\u00bf\u00c0\7"+
+		"\34\2\2\u00c0\u00c1\5$\23\2\u00c1\u00c2\7\35\2\2\u00c2\u00c4\3\2\2\2\u00c3"+
+		"\u00b6\3\2\2\2\u00c3\u00b8\3\2\2\2\u00c3\u00bd\3\2\2\2\u00c4#\3\2\2\2"+
+		"\u00c5\u00c9\7\31\2\2\u00c6\u00c8\n\4\2\2\u00c7\u00c6\3\2\2\2\u00c8\u00cb"+
+		"\3\2\2\2\u00c9\u00c7\3\2\2\2\u00c9\u00ca\3\2\2\2\u00ca\u00cc\3\2\2\2\u00cb"+
+		"\u00c9\3\2\2\2\u00cc\u00cd\7\31\2\2\u00cd%\3\2\2\2\u00ce\u00d1\5(\25\2"+
+		"\u00cf\u00d1\5*\26\2\u00d0\u00ce\3\2\2\2\u00d0\u00cf\3\2\2\2\u00d1\'\3"+
+		"\2\2\2\u00d2\u00d3\t\5\2\2\u00d3)\3\2\2\2\u00d4\u00d5\7\34\2\2\u00d5\u00d6"+
+		"\7*\2\2\u00d6\u00d7\7\36\2\2\u00d7\u00d8\7*\2\2\u00d8\u00d9\7\35\2\2\u00d9"+
+		"+\3\2\2\2\25.\61IPWelz}\u0088\u0091\u0099\u009e\u00a2\u00a9\u00b3\u00c3"+
+		"\u00c9\u00d0";
 	public static final ATN _ATN =
 		new ATNDeserializer().deserialize(_serializedATN.toCharArray());
 	static {
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/NCDslFlowItem.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/NCDslFlowItem.scala
deleted file mode 100644
index 1fdd62c..0000000
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/NCDslFlowItem.scala
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nlpcraft.model.intent.utils
-
-/**
- * Flow item from intent DSL.
- */
-case class NCDslFlowItem(intents: Seq[String], min: Int, max: Int) {
-    if (intents == null || intents.isEmpty)
-        throw new IllegalArgumentException(s"Intent DSL flow item must have at least one intent ID.")
-    if (min < 0 || max < 1 || min > max)
-        throw new IllegalArgumentException(s"Invalid intent DSL flow item quantifier: [$min,$max]")
-
-    override def toString = {
-        val minMax = if (min == 0 && max == 1) "?"
-            else if (min == 1 && max == Integer.MAX_VALUE) "+"
-            else if (min == 0 && max == Integer.MAX_VALUE) "*"
-            else if (min == 1 && max == 1) ""
-            else s"[$min,$max]"
-
-        val ids = intents.size match {
-            case 1 ⇒ intents.head
-            case _ ⇒ intents.mkString("(", "|", ")")
-        }
-        
-        ids + minMax
-    }
-}
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/NCDslIntent.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/NCDslIntent.scala
index 3274edf..db7c765 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/NCDslIntent.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/NCDslIntent.scala
@@ -17,18 +17,36 @@
 
 package org.apache.nlpcraft.model.intent.utils
 
+import java.util.regex.{Pattern, PatternSyntaxException}
+
 /**
  * Intent from intent DSL.
+ *
+ * @param id Intent ID.
+ * @param ordered Whether or not the order of terms is important for matching.
+ * @param flow Optional flow matching regex.
+ * @param terms Array of terms comprising this intent.
  */
-case class NCDslIntent(id: String, ordered: Boolean, flow: Array[NCDslFlowItem], terms: Array[NCDslTerm]) {
+case class NCDslIntent(id: String, ordered: Boolean, flow: Option[String], terms: Array[NCDslTerm]) {
     if (id == null)
         throw new IllegalArgumentException("Intent ID must be provided.")
     if (terms.length == 0)
         throw new IllegalArgumentException("Intent should have at least one term.")
-    
+
+    // Flow regex as a compiled pattern.
+    val flowRegex = flow match {
+        case Some(r) ⇒
+            try
+                Some(Pattern.compile(r))
+            catch {
+                case e: PatternSyntaxException ⇒ throw new IllegalArgumentException(s"Invalid flow regex: ${e.getLocalizedMessage}")
+            }
+        case None ⇒ None
+    }
+
     override def toString: String =
         s"Intent: '$id'"
-    
+
     /**
      * Gets full intent string representation in text DSL format.
      *
@@ -36,9 +54,9 @@ case class NCDslIntent(id: String, ordered: Boolean, flow: Array[NCDslFlowItem],
      */
     def toDslString: String = {
         val orderedStr = if (!ordered) "" else " ordered=true"
-        val flowStr = flow.mkString(" >> ") match {
-            case s: String if s.nonEmpty ⇒ s" flow=$s"
-            case _ ⇒ ""
+        val flowStr = flow match {
+            case Some(r) ⇒ s"flow='$r''"
+            case None ⇒ ""
         }
 
         s"intent=$id$orderedStr$flowStr ${terms.mkString(" ")}"
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolverEngineSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolverEngineSpec.scala
index 6f0ca0f..401c501 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolverEngineSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/impl/NCIntentSolverEngineSpec.scala
@@ -17,41 +17,9 @@
 
 package org.apache.nlpcraft.model.intent.impl
 
-import org.apache.nlpcraft.common._
-import org.apache.nlpcraft.model.intent.utils.NCDslFlowItem
-import org.junit.jupiter.api.Assertions.{assertFalse, assertTrue}
-import org.junit.jupiter.api.Test
-
 /**
  * Unit tests for intent solver engine.
  */
 class NCIntentSolverEngineSpec  {
-    /**
-     *
-     * @param hist Matched intents.
-     * @param flow Dialog flow template.
-     * @return
-     */
-    private def matchFlow(hist: String, flow: (String/*Intent ID*/, Int/*min*/, Int/*max*/)*): Boolean = {
-        NCIntentSolverEngine.matchFlow(
-            flow.toArray.map(x ⇒ NCDslFlowItem(x._1.split('|').map(_.trim), x._2, x._3)),
-            U.splitTrimFilter(hist, " ")
-        )
-    }
-
-    @Test
-    def testMatchDialogFlow() {
-        assertTrue(!matchFlow("", ("a", 1, 1)))
-        assertTrue(matchFlow("a c", ("a", 1, 1), ("b", 0, 2), ("c", 1, 1)))
-        assertTrue(matchFlow("a b c", ("a", 1, 1), ("b", 0, 2), ("c", 1, 1)))
-        assertTrue(matchFlow("a b b c", ("a", 1, 1), ("b", 0, 2), ("c", 1, 1)))
-        assertTrue(matchFlow("a b b c", ("a", 1, 1), ("b|c", 0, 2), ("c", 1, 1)))
-        assertTrue(matchFlow("a a c c", ("a", 2, 2), ("b|c", 1, 2), ("d", 0, 1)))
-        assertTrue(matchFlow("a a c c d", ("a", 2, 2), ("b|c", 1, 2), ("d", 0, 1)))
-        assertTrue(matchFlow("a a c c e f g h", ("a", 2, 2), ("b|c", 1, 2), ("d", 0, 1)))
-        assertFalse(matchFlow("a a c c x", ("a", 2, 2), ("b|c", 1, 2), ("d", 1, 1)))
-
-        assertTrue(matchFlow(hist = "a", flow = ("a", 1, 1)))
-        assertFalse(matchFlow(hist = "a a", flow = ("a", 1, 1)))
-    }
+    // TODO
 }