Browse Source

got ZIP from from Mikhail Auguston 20150412

Notes from @mikau2: "
I’ve fixed some bugs in the nested composition operation constructs.

The test lexer.mp (one of the examples from the Tech Report) also
demonstrates the nested composition operations and
how to avoid traveling too far into the combinatorial exploration
without need.
It runs well for scopes  1 and 2, but takes too long for scope 3.
In MP world the Small Scope Hypothesis (“most flaws in models can be
demonstrated on relatively small counterexamples”)
provides us with the justification to stay with relatively small scope.
"
Kyle P Davis 10 years ago
parent
commit
2dbb032be6
2 changed files with 19 additions and 7 deletions
  1. 18 6
      lexer.mp
  2. 1 1
      mp2.h

+ 18 - 6
lexer.mp

@@ -1,17 +1,29 @@
 /* from the ACM TOSEM paper draft 
- runs for scope 1 and 2, for scope 3 takes too long
+ runs for scope 1 and 2 (~16 sec), 
+ for scope 3 it takes much longer.
+ 
+ The iteration limits <n..m> should be used to curb 
+ traveling too far into the combinatorial ocean.
+  
+ When ENSURE construct will be added to the Text_input
+ constraining the numbers of Get_char and Unget_char further,
+ the number of traces will drop significantly, 
+ and hopefully will become affordable for scope 3.
+ Meanwhile, this example demonstrates that we should be 
+ carefull with selecting limits for iterations, 
+ to avoid going too far into combinatorial exploration without real need.
 */
 
 SCHEMA lexer
 
-ROOT Text_Input:  	(* String_processing *);
-	String_processing:	Get_string (+ Unget_char +);
+ROOT Text_Input:  	(*<1..2> String_processing *);
+	String_processing:	Get_string (+<1..2> Unget_char +);
 	Get_string:			(+<2..3> Get_char +);
 
-ROOT Token_processing: 	(* Token_recognition *);
+ROOT Token_processing: 	(*<1..2> Token_recognition *);
 	Token_recognition: 	{+ RegExpr_Match +}
-				(+ Unget_char +)  Fire_rule;
- 	RegExpr_Match:		(+ Get_char +);
+				(+<1..2> Unget_char +)  Fire_rule;
+ 	RegExpr_Match:		(+<2..3> Get_char +);
  	Fire_rule: 		[ Put_token ];
 
 COORDINATE 	$t: Token_recognition 	FROM 	Token_processing,

+ 1 - 1
mp2.h

@@ -5,7 +5,7 @@
  *  recursive descent trace generation
  *	common declarations and globals
  *
- *	last update: 03/26/15
+ *	last modified: 03/26/15
  */
 #include <iostream>
 #include <fstream>