summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2020-12-17 14:47:27 +1100
committerJed Barber <jjbarber@y7mail.com>2020-12-17 14:47:27 +1100
commit7b4adc611d65915eaf8c62b47975b48327a9f83f (patch)
tree56140b570bb53fbbd436d3bdb6add8d3c5b9a6d3
parent46fed171c49eee1ffe192e04ba34ec120bc486b0 (diff)
Very very rough notes on curtailment issues
-rw-r--r--curtail.txt23
-rw-r--r--minustrace.txt188
-rw-r--r--minustraceamend.txt188
3 files changed, 399 insertions, 0 deletions
diff --git a/curtail.txt b/curtail.txt
new file mode 100644
index 0000000..ff418ec
--- /dev/null
+++ b/curtail.txt
@@ -0,0 +1,23 @@
+
+
+Scratch space for notes about curtailment
+
+
+
+all results must track curtails
+ - done
+
+when merging two results that have curtails for the same combinator, use the smaller curtail
+ - done
+
+when updating a result, replace the curtails with the leftrec level for the current context
+ - done
+
+ignore a previous result when the current leftrec level is less than the previous result curtail level for even one of the curtails
+ - done
+
+the function to check if reusable needs to take into account a +1 for the combinator being currently memoized
+ - done
+
+
+
diff --git a/minustrace.txt b/minustrace.txt
new file mode 100644
index 0000000..0fb4046
--- /dev/null
+++ b/minustrace.txt
@@ -0,0 +1,188 @@
+ENTERING SEQUENCE P1 D1 Expr
+BEGIN STAMP SUM P1 D1 Sum
+ENTERING CHOICE P1 D1 Sum_Choice
+OPTION 1 CHOICE P1 D1 Sum_Choice
+ENTERING SEQUENCE P1 D1 Sum_Plus
+BEGIN STAMP SUM P1 D2 Sum
+ENTERING CHOICE P1 D2 Sum_Choice
+OPTION 1 CHOICE P1 D2 Sum_Choice
+ENTERING SEQUENCE P1 D2 Sum_Plus
+BEGIN STAMP SUM P1 D3 Sum
+ENTERING CHOICE P1 D3 Sum_Choice
+OPTION 1 CHOICE P1 D3 Sum_Choice
+ENTERING SEQUENCE P1 D3 Sum_Plus
+BEGIN STAMP SUM P1 D4 Sum
+ENTERING CHOICE P1 D4 Sum_Choice
+OPTION 1 CHOICE P1 D4 Sum_Choice
+ENTERING SEQUENCE P1 D4 Sum_Plus
+BEGIN STAMP SUM P1 D5 Sum
+ENTERING CHOICE P1 D5 Sum_Choice
+OPTION 1 CHOICE P1 D5 Sum_Choice
+ENTERING SEQUENCE P1 D5 Sum_Plus
+BEGIN STAMP SUM P1 D6 Sum
+ENTERING CHOICE P1 D6 Sum_Choice
+OPTION 1 CHOICE P1 D6 Sum_Choice
+ENTERING SEQUENCE P1 D6 Sum_Plus
+BEGIN STAMP SUM P1 D7 Sum
+CURTAILING AT P1 D7
+STORING FAILURE C7 Sum p1 d7 Fail c7
+FAIL STAMP SUM P1 D7 Sum
+STORING FAILURE C7 Sum_Plus p1 d6 Fail (Sum c7)
+FAILED SEQUENCE P1 D6 Sum_Plus
+OPTION 2 CHOICE P1 D6 Sum_Choice
+ENTERING SEQUENCE P1 D1 Sum_Minus
+BEGIN STAMP SUM P1 D7 Sum
+REUSING FAILURE C7 Reuse Sum p1 d7 Fail c7
+FAIL STAMP SUM P1 D7 Sum
+STORING FAILURE C7 Sum_Minus p1 d1 Fail (Sum c7)
+FAILED SEQUENCE P1 D1 Sum_Minus
+OPTION 3 CHOICE P1 D6 Sum_Choice
+BEGIN STAMP FACTOR P1 D1 Factor
+ENTERING SATISFY P1 Sat_Number
+STORING SUCCESS 1 Sat_Number p1 Success
+SUCCESS SATISFY P1 Sat_Number
+STORING SUCCESS 1 Factor p1 d1 Success
+SUCCESS STAMP FACTOR P1 D1 Factor
+STORING SUCCESS 1 Sum_Choice p1 d6 Success 1
+SUCCESS CHOICE 1 P1 D6 Sum_Choice
+UPDATING FAILURE C7 WITH SUCCESS 1 Update Sum p1 d6 Success 1
+SUCCESS STAMP SUM P1 D6 Sum
+CONT SEQUENCE P1 D5 Sum_Plus
+ENTERING SATISFY P2 Sat_Plus
+STORING FAILURE Sat_Plus p2 Fail
+FAILED SATISFY P2 Sat_Plus
+UPDATING FAILURE C7 WITH FAILURE Update Sum_Plus p1 d5 Fail
+FAILED SEQUENCE P1 D5 Sum_Plus
+OPTION 2 CHOICE P1 D5 Sum_Choice
+ENTERING SEQUENCE P1 D1 Sum_Minus
+NOT REUSABLE FAILURE C7 Ignore Sum_Minus p1 d1 (Sum c7) Fail
+BEGIN STAMP SUM P1 D6 Sum
+REUSING SUCCESS 1 Reuse Sum p1 d6 Success 1
+SUCCESS STAMP SUM P1 D6 Sum
+CONT SEQUENCE P1 D1 Sum_Minus
+ENTERING SATISFY P2 Sat_Minus
+STORING SUCCESS 2 Sat_Minus p2 Success 2
+SUCCESS SATISFY P2 Sat_Minus
+CONT SEQUENCE P1 D1 Sum_Minus
+BEGIN STAMP FACTOR P3 D1 Factor
+ENTERING SATISFY P3 Sat_Number
+STORING SUCCESS 3 Sat_Number p3 Success
+SUCCESS SATISFY P3 Sat_Number
+STORING SUCCESS 3 Factor p3 d1 Success
+SUCCESS STAMP FACTOR P3 D1 Factor
+UPDATING FAILURE C7 WITH SUCCESS 3 Update Sum_Minus p1 d1 Success 3
+SUCCESS SEQUENCE 3 P1 D1 Sum_Minus
+OPTION 3 CHOICE P1 D5 Sum_Choice
+BEGIN STAMP FACTOR P1 D1 Factor
+REUSING SUCCESS 1 Reuse Factor p1 d1 Success 1
+SUCCESS STAMP FACTOR P1 D1 Factor
+UPDATING SUCCESS 1 WITH SUCCESS 1 3 Update Sum_Choice p1 d5 Success 1 3
+SUCCESS CHOICE 1 3 P1 D5 Sum_Choice
+UPDATING SUCCESS 1 WITH SUCCESS 1 3 Update Sum p1 d5 Success 1 3
+SUCCESS STAMP SUM P1 D5 Sum
+CONT SEQUENCE P1 D4 Sum_Plus
+ENTERING SATISFY P2 Sat_Plus p2
+REUSING FAILURE Reuse Sat_Plus p2 Fail
+FAILED SATISFY P2 Sat_Plus p2
+ENTERING SATISFY P4 Sat_Plus p4
+STORING FAILURE Sat_Plus p4 Fail
+FAILED SATISFY P4 Sat_Plus p4
+UPDATING FAILURE WITH FAILURE Update Sum_Plus p1 d4 Fail
+FAILED SEQUENCE P1 D4 Sum_Plus
+OPTION 2 CHOICE P1 D4 Sum_Choice
+ENTERING SEQUENCE P1 D1 Sum_Minus
+REUSING SUCCESS 3 Reuse Sum_Minus p1 d1 Success 3 Is this right?
+SUCCESS SEQUENCE 3 P1 D1 Sum_Minus
+OPTION 3 CHOICE P1 D4 Sum_Choice
+BEGIN STAMP FACTOR P1 D1 Factor
+REUSING SUCCESS 1 Reuse Factor p1 d1 Success 1
+SUCCESS STAMP FACTOR P1 D1 Factor
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3 Update Sum_Choice p1 d4 Success 1 3
+SUCCESS CHOICE 1 3 P1 D4 Sum_Choice
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3 Update Sum p1 d4 Success 1 3
+SUCCESS STAMP SUM P1 D4 Sum
+CONT SEQUENCE P1 D3 Sum_Plus
+ENTERING SATISFY P2 Sat_Plus p2
+REUSING FAILURE Reuse Sat_Plus p2 Fail
+FAILED SATISFY P2 Sat_Plus p2
+ENTERING SATISFY P4 Sat_Plus p4
+REUSING FAILURE Reuse Sat_Plus p4 Fail
+FAILED SATISFY P4 Sat_Plus p4
+UPDATING FAILURE WITH FAILURE Update Sum_Plus p1 d3 Fail
+FAILED SEQUENCE P1 D3 Sum_Plus
+OPTION 2 CHOICE P1 D3
+ENTERING SEQUENCE P1 D1
+REUSING SUCCESS 3
+SUCCESS SEQUENCE 3 P1 D1
+OPTION 3 CHOICE P1 D3
+BEGIN STAMP FACTOR P1 D1
+REUSING SUCCESS 1
+SUCCESS STAMP FACTOR P1 D1
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS CHOICE 1 3 P1 D3
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS STAMP SUM P1 D3
+CONT SEQUENCE P1 D2
+ENTERING SATISFY P2
+REUSING FAILURE
+FAILED SATISFY P2
+ENTERING SATISFY P4
+REUSING FAILURE
+FAILED SATISFY P4
+UPDATING FAILURE WITH FAILURE
+FAILED SEQUENCE P1 D2
+OPTION 2 CHOICE P1 D2
+ENTERING SEQUENCE P1 D1
+REUSING SUCCESS 3
+SUCCESS SEQUENCE 3 P1 D1
+OPTION 3 CHOICE P1 D2
+BEGIN STAMP FACTOR P1 D1
+REUSING SUCCESS 1
+SUCCESS STAMP FACTOR P1 D1
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS CHOICE 1 3 P1 D2
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS STAMP SUM P1 D2
+CONT SEQUENCE P1 D1
+ENTERING SATISFY P2
+REUSING FAILURE
+FAILED SATISFY P2
+ENTERING SATISFY P4
+REUSING FAILURE
+FAILED SATISFY P4
+UPDATING FAILURE WITH FAILURE
+FAILED SEQUENCE P1 D1
+OPTION 2 CHOICE P1 D1
+ENTERING SEQUENCE P1 D1
+REUSING SUCCESS 3
+SUCCESS SEQUENCE 3 P1 D1
+OPTION 3 CHOICE P1 D1
+BEGIN STAMP FACTOR P1 D1
+REUSING SUCCESS 1
+SUCCESS STAMP FACTOR P1 D1
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS CHOICE 1 3 P1 D1
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS STAMP SUM P1 D1
+CONT SEQUENCE P1 D1
+FAILED END OF INPUT AT POSITION 2
+FAILED END OF INPUT AT POSITION 4
+STORING FAILURE
+FAILED SEQUENCE P1 D1
+STARTING FINISH ROOT
+BREAKPOINT ONE REACHED
+ABOUT TO RETURN EMPTY GRAPH
+Input:
+1 - 2 - 3
+
+Lexer token output:
+Token NUMBER at input position 1 with value length 1
+Token OPERATOR at input position 3 with value length 1
+Token NUMBER at input position 5 with value length 1
+Token OPERATOR at input position 7 with value length 1
+Token NUMBER at input position 9 with value length 1
+
+Parser graph output:
+
+
+Root tokens:
diff --git a/minustraceamend.txt b/minustraceamend.txt
new file mode 100644
index 0000000..c67e246
--- /dev/null
+++ b/minustraceamend.txt
@@ -0,0 +1,188 @@
+ENTERING SEQUENCE P1 D1 Expr
+BEGIN STAMP SUM P1 D1 Sum
+ENTERING CHOICE P1 D1 Sum_Choice
+OPTION 1 CHOICE P1 D1 Sum_Choice
+ENTERING SEQUENCE P1 D1 Sum_Plus
+BEGIN STAMP SUM P1 D2 Sum
+ENTERING CHOICE P1 D2 Sum_Choice
+OPTION 1 CHOICE P1 D2 Sum_Choice
+ENTERING SEQUENCE P1 D2 Sum_Plus
+BEGIN STAMP SUM P1 D3 Sum
+ENTERING CHOICE P1 D3 Sum_Choice
+OPTION 1 CHOICE P1 D3 Sum_Choice
+ENTERING SEQUENCE P1 D3 Sum_Plus
+BEGIN STAMP SUM P1 D4 Sum
+ENTERING CHOICE P1 D4 Sum_Choice
+OPTION 1 CHOICE P1 D4 Sum_Choice
+ENTERING SEQUENCE P1 D4 Sum_Plus
+BEGIN STAMP SUM P1 D5 Sum
+ENTERING CHOICE P1 D5 Sum_Choice
+OPTION 1 CHOICE P1 D5 Sum_Choice
+ENTERING SEQUENCE P1 D5 Sum_Plus
+BEGIN STAMP SUM P1 D6 Sum
+ENTERING CHOICE P1 D6 Sum_Choice
+OPTION 1 CHOICE P1 D6 Sum_Choice
+ENTERING SEQUENCE P1 D6 Sum_Plus
+BEGIN STAMP SUM P1 D7 Sum
+CURTAILING AT P1 D7
+STORING FAILURE C7 Sum p1 d7 Fail c7
+FAIL STAMP SUM P1 D7 Sum
+STORING FAILURE C7 Sum_Plus p1 d6 Fail (Sum c7)
+FAILED SEQUENCE P1 D6 Sum_Plus
+OPTION 2 CHOICE P1 D6 Sum_Choice
+ENTERING SEQUENCE P1 D1 Sum_Minus
+BEGIN STAMP SUM P1 D7 Sum
+REUSING FAILURE C7 Reuse Sum p1 d7 Fail c7
+FAIL STAMP SUM P1 D7 Sum
+STORING FAILURE C7 Sum_Minus p1 d1 Fail (Sum c7)
+FAILED SEQUENCE P1 D1 Sum_Minus
+OPTION 3 CHOICE P1 D6 Sum_Choice
+BEGIN STAMP FACTOR P1 D1 Factor
+ENTERING SATISFY P1 Sat_Number
+STORING SUCCESS 1 Sat_Number p1 Success
+SUCCESS SATISFY P1 Sat_Number
+STORING SUCCESS 1 Factor p1 d1 Success
+SUCCESS STAMP FACTOR P1 D1 Factor
+STORING SUCCESS 1 Sum_Choice p1 d6 Success 1 (Sum c7)
+SUCCESS CHOICE 1 P1 D6 Sum_Choice
+UPDATING FAILURE C7 WITH SUCCESS 1 Update Sum p1 d6 Success 1 (Sum c6?)
+SUCCESS STAMP SUM P1 D6 Sum
+CONT SEQUENCE P1 D5 Sum_Plus
+ENTERING SATISFY P2 Sat_Plus
+STORING FAILURE Sat_Plus p2 Fail
+FAILED SATISFY P2 Sat_Plus
+UPDATING FAILURE C7 WITH FAILURE Update Sum_Plus p1 d5 Fail (Sum c5?)
+FAILED SEQUENCE P1 D5 Sum_Plus
+OPTION 2 CHOICE P1 D5 Sum_Choice
+ENTERING SEQUENCE P1 D1 Sum_Minus
+NOT REUSABLE FAILURE C7 Ignore Sum_Minus p1 d1 (Sum c7) Fail since c5 < c7
+BEGIN STAMP SUM P1 D6 Sum
+REUSING SUCCESS 1 Reuse Sum p1 d6 Success 1 (Sum c6?)
+SUCCESS STAMP SUM P1 D6 Sum
+CONT SEQUENCE P1 D1 Sum_Minus
+ENTERING SATISFY P2 Sat_Minus
+STORING SUCCESS 2 Sat_Minus p2 Success 2
+SUCCESS SATISFY P2 Sat_Minus
+CONT SEQUENCE P1 D1 Sum_Minus
+BEGIN STAMP FACTOR P3 D1 Factor
+ENTERING SATISFY P3 Sat_Number
+STORING SUCCESS 3 Sat_Number p3 Success
+SUCCESS SATISFY P3 Sat_Number
+STORING SUCCESS 3 Factor p3 d1 Success
+SUCCESS STAMP FACTOR P3 D1 Factor
+UPDATING FAILURE C7 WITH SUCCESS 3 Update Sum_Minus p1 d1 Success 3 (Sum c5?)
+SUCCESS SEQUENCE 3 P1 D1 Sum_Minus
+OPTION 3 CHOICE P1 D5 Sum_Choice
+BEGIN STAMP FACTOR P1 D1 Factor
+REUSING SUCCESS 1 Reuse Factor p1 d1 Success 1
+SUCCESS STAMP FACTOR P1 D1 Factor
+UPDATING SUCCESS 1 WITH SUCCESS 1 3 Update Sum_Choice p1 d5 Success 1 3 (Sum c5?)
+SUCCESS CHOICE 1 3 P1 D5 Sum_Choice
+UPDATING SUCCESS 1 WITH SUCCESS 1 3 Update Sum p1 d5 Success 1 3 (Sum c5?)
+SUCCESS STAMP SUM P1 D5 Sum
+CONT SEQUENCE P1 D4 Sum_Plus
+ENTERING SATISFY P2 Sat_Plus p2
+REUSING FAILURE Reuse Sat_Plus p2 Fail
+FAILED SATISFY P2 Sat_Plus p2
+ENTERING SATISFY P4 Sat_Plus p4
+STORING FAILURE Sat_Plus p4 Fail
+FAILED SATISFY P4 Sat_Plus p4
+UPDATING FAILURE WITH FAILURE Update Sum_Plus p1 d4 Fail (Sum d4?)
+FAILED SEQUENCE P1 D4 Sum_Plus
+OPTION 2 CHOICE P1 D4 Sum_Choice
+ENTERING SEQUENCE P1 D1 Sum_Minus
+REUSING SUCCESS 3 Reuse Sum_Minus p1 d1 Success 3 Is this right?
+SUCCESS SEQUENCE 3 P1 D1 Sum_Minus
+OPTION 3 CHOICE P1 D4 Sum_Choice
+BEGIN STAMP FACTOR P1 D1 Factor
+REUSING SUCCESS 1 Reuse Factor p1 d1 Success 1
+SUCCESS STAMP FACTOR P1 D1 Factor
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3 Update Sum_Choice p1 d4 Success 1 3
+SUCCESS CHOICE 1 3 P1 D4 Sum_Choice
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3 Update Sum p1 d4 Success 1 3
+SUCCESS STAMP SUM P1 D4 Sum
+CONT SEQUENCE P1 D3 Sum_Plus
+ENTERING SATISFY P2 Sat_Plus p2
+REUSING FAILURE Reuse Sat_Plus p2 Fail
+FAILED SATISFY P2 Sat_Plus p2
+ENTERING SATISFY P4 Sat_Plus p4
+REUSING FAILURE Reuse Sat_Plus p4 Fail
+FAILED SATISFY P4 Sat_Plus p4
+UPDATING FAILURE WITH FAILURE Update Sum_Plus p1 d3 Fail
+FAILED SEQUENCE P1 D3 Sum_Plus
+OPTION 2 CHOICE P1 D3
+ENTERING SEQUENCE P1 D1
+REUSING SUCCESS 3
+SUCCESS SEQUENCE 3 P1 D1
+OPTION 3 CHOICE P1 D3
+BEGIN STAMP FACTOR P1 D1
+REUSING SUCCESS 1
+SUCCESS STAMP FACTOR P1 D1
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS CHOICE 1 3 P1 D3
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS STAMP SUM P1 D3
+CONT SEQUENCE P1 D2
+ENTERING SATISFY P2
+REUSING FAILURE
+FAILED SATISFY P2
+ENTERING SATISFY P4
+REUSING FAILURE
+FAILED SATISFY P4
+UPDATING FAILURE WITH FAILURE
+FAILED SEQUENCE P1 D2
+OPTION 2 CHOICE P1 D2
+ENTERING SEQUENCE P1 D1
+REUSING SUCCESS 3
+SUCCESS SEQUENCE 3 P1 D1
+OPTION 3 CHOICE P1 D2
+BEGIN STAMP FACTOR P1 D1
+REUSING SUCCESS 1
+SUCCESS STAMP FACTOR P1 D1
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS CHOICE 1 3 P1 D2
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS STAMP SUM P1 D2
+CONT SEQUENCE P1 D1
+ENTERING SATISFY P2
+REUSING FAILURE
+FAILED SATISFY P2
+ENTERING SATISFY P4
+REUSING FAILURE
+FAILED SATISFY P4
+UPDATING FAILURE WITH FAILURE
+FAILED SEQUENCE P1 D1
+OPTION 2 CHOICE P1 D1
+ENTERING SEQUENCE P1 D1
+REUSING SUCCESS 3
+SUCCESS SEQUENCE 3 P1 D1
+OPTION 3 CHOICE P1 D1
+BEGIN STAMP FACTOR P1 D1
+REUSING SUCCESS 1
+SUCCESS STAMP FACTOR P1 D1
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS CHOICE 1 3 P1 D1
+UPDATING SUCCESS 1 3 WITH SUCCESS 1 3
+SUCCESS STAMP SUM P1 D1
+CONT SEQUENCE P1 D1
+FAILED END OF INPUT AT POSITION 2
+FAILED END OF INPUT AT POSITION 4
+STORING FAILURE
+FAILED SEQUENCE P1 D1
+STARTING FINISH ROOT
+BREAKPOINT ONE REACHED
+ABOUT TO RETURN EMPTY GRAPH
+Input:
+1 - 2 - 3
+
+Lexer token output:
+Token NUMBER at input position 1 with value length 1
+Token OPERATOR at input position 3 with value length 1
+Token NUMBER at input position 5 with value length 1
+Token OPERATOR at input position 7 with value length 1
+Token NUMBER at input position 9 with value length 1
+
+Parser graph output:
+
+
+Root tokens: