@@ -181,25 +181,25 @@ public JSONObject getDefinition() {
181181 return queued ;
182182 });
183183 memoryProcedures .put (Pattern .compile ("SET\\ h+?([^=]*?)\\ h+?=\\ h+?([^=]*)\\ h*?" ), (flow , matcher ) -> {
184- String remember = flow .unify (matcher .group (1 ), false , Integer . MAX_VALUE ), matching = flow .unify (matcher .group (2 ), false , Integer . MAX_VALUE );
184+ String remember = flow .unify (matcher .group (1 )), matching = flow .unify (matcher .group (2 ));
185185 return see (flow , "%1% AS " + remember , matching , Pattern .compile ("(.*)" ));
186186 });
187187 memoryProcedures .put (Pattern .compile ("SET\\ h+?([^=]*?)\\ h+?=\\ h+?([^=]*?)\\ h+?MATCHING\\ h+?(.*)\\ h*?" ), (flow , matcher ) -> {
188- String remember = flow .unify (matcher .group (1 ), false , Integer . MAX_VALUE ), matching = flow .unify (matcher .group (2 ), false , Integer . MAX_VALUE ), pattern = flow .unify (matcher .group (3 ), false , Integer . MAX_VALUE );
188+ String remember = flow .unify (matcher .group (1 )), matching = flow .unify (matcher .group (2 )), pattern = flow .unify (matcher .group (3 ));
189189 return see (flow , remember , matching , Pattern .compile (pattern ));
190190 });
191191 memoryProcedures .put (Pattern .compile ("CLEAR\\ h+?(.*)\\ h*?" ), (flow , matcher ) -> {
192192 String clear = matcher .group (1 );
193- return see (flow , "%1% AS " + flow .unify (clear , false , Integer . MAX_VALUE ), "" , Pattern .compile ("(.*)" ));
193+ return see (flow , "%1% AS " + flow .unify (clear ), "" , Pattern .compile ("(.*)" ));
194194 });
195195 memoryProcedures .put (Pattern .compile ("IF\\ h+?([^=]*)\\ h*?" ), (flow , matcher ) -> {
196- String expect = flow .unify (matcher .group (1 ), false , Integer . MAX_VALUE );
196+ String expect = flow .unify (matcher .group (1 ));
197197 if (expect == null || expect .length () == 0 ) return new SusiThought (); // empty thought -> fail
198198 return new SusiThought ().addObservation ("EXPECTED" , matcher .group (1 ));
199199 });
200200 memoryProcedures .put (Pattern .compile ("IF\\ h+?([^=]*?)\\ h*=\\ h*([^=]*)\\ h*?" ), (flow , matcher ) -> {
201- String expect = matcher .group (1 ), matching = flow .unify (matcher .group (2 ), false , Integer . MAX_VALUE );
202- SusiThought t = see (flow , "%1% AS EXPECTED" , flow .unify (expect , false , Integer . MAX_VALUE ), Pattern .compile (matching ));
201+ String expect = matcher .group (1 ), matching = flow .unify (matcher .group (2 ));
202+ SusiThought t = see (flow , "%1% AS EXPECTED" , flow .unify (expect ), Pattern .compile (matching ));
203203 if (t .isFailed () || t .hasEmptyObservation ("EXPECTED" )) return new SusiThought (); // empty thought -> fail
204204 return t ;
205205 });
@@ -209,20 +209,20 @@ public JSONObject getDefinition() {
209209 return new SusiThought ().addObservation ("REJECTED" , "" );
210210 });
211211 memoryProcedures .put (Pattern .compile ("NOT\\ h+?([^=]*)\\ h*?" ), (flow , matcher ) -> {
212- String reject = flow .unify (matcher .group (1 ), false , Integer . MAX_VALUE );
212+ String reject = flow .unify (matcher .group (1 ));
213213 if (reject == null || reject .length () == 0 ) return new SusiThought ().addObservation ("REJECTED" , matcher .group (1 ));
214214 return new SusiThought (); // empty thought -> fail
215215 });
216216 memoryProcedures .put (Pattern .compile ("NOT\\ h+?([^=]*?)\\ h*=\\ h*([^=]*)\\ h*?" ), (flow , matcher ) -> {
217217 // This is a not of an assignment. This must fail if the assigned value is non-empty
218- String reject = matcher .group (1 ), matching = flow .unify (matcher .group (2 ), false , Integer . MAX_VALUE );
219- SusiThought t = see (flow , "%1% AS EXPECTED" , flow .unify (reject , false , Integer . MAX_VALUE ), Pattern .compile (matching ));
218+ String reject = matcher .group (1 ), matching = flow .unify (matcher .group (2 ));
219+ SusiThought t = see (flow , "%1% AS EXPECTED" , flow .unify (reject ), Pattern .compile (matching ));
220220 if (t .isFailed () || t .hasEmptyObservation ("EXPECTED" )) return new SusiThought ().addObservation ("REJECTED(" + matcher .group (2 ) + ")" , matcher .group (1 ));
221221 return new SusiThought (); // empty thought -> fail
222222 });
223223 javascriptProcedures .put (Pattern .compile ("(?s:(.*))" ), (flow , matcher ) -> {
224224 String term = matcher .group (1 );
225- term = flow .unify (term , false , Integer . MAX_VALUE );
225+ term = flow .unify (term );
226226 while (term .indexOf ('`' ) >= 0 ) try {
227227 Reflection reflection = new Reflection (term , flow , false );
228228 term = reflection .expression ;
@@ -249,7 +249,7 @@ public JSONObject getDefinition() {
249249 }
250250 });
251251 prologProcedures .put (Pattern .compile ("(?s:(.*))" ), (flow , matcher ) -> {
252- String term = flow .unify (matcher .group (1 ), false , Integer . MAX_VALUE );
252+ String term = flow .unify (matcher .group (1 ));
253253 try {
254254 Prolog engine = new Prolog ();
255255 try {
@@ -297,7 +297,7 @@ private static final SusiThought see(SusiArgument flow, String transferExpr, Str
297297 // example: see $1$ as idea from ""
298298 SusiThought nextThought = new SusiThought ();
299299 try {
300- Matcher m = pattern .matcher (flow .unify (expr , false , Integer . MAX_VALUE ));
300+ Matcher m = pattern .matcher (flow .unify (expr ));
301301 int gc = -1 ;
302302 if (new TimeoutMatcher (m ).matches ()) {
303303 SusiTransfer transfer = new SusiTransfer (transferExpr );
@@ -360,7 +360,7 @@ public SusiThought applyProcedures(SusiArgument flow) {
360360 SusiArgument .Reflection reflection = new SusiArgument .Reflection (url , flow , true );
361361 url = reflection .expression ;
362362 }} catch (ReactionException e ) {}
363- String path = definition .has ("path" ) ? flow .unify (definition .getString ("path" ), false , Integer . MAX_VALUE ) : null ;
363+ String path = definition .has ("path" ) ? flow .unify (definition .getString ("path" )) : null ;
364364
365365 // make a custom request header
366366 Map <String , String > request_header = new HashMap <>();
0 commit comments