SamyaDaleh / CL-Toolbox

A Parsing-as-Deduction system that parses with different parsing algorithms and some related tools for educational purposes.
7 stars 4 forks source link

ArrayOutOfBoundsException in Predicate 120 #252

Closed SamyaDaleh closed 4 years ago

SamyaDaleh commented 4 years ago

Call with algorithm: srcg-earley Grammar after conversion for task: G = <N, T, V, P, S> N = {N0^[1]^1, S'} T = {t0, t1} V = {X1, X2} P = {S'(ε) -> ε, S'(X1) -> N0^[1]^1(X1), N0^[1]^1(t0) -> ε, N0^[1]^1(t0 t1) -> ε, N0^[1]^1(t0 X1 t1) -> N0^[1]^1(X1), N0^[1]^1(t0 X2 t1) -> N0^[1]^1(X2), N0^[1]^1(t0 X1 X2 t1) -> N0^[1]^1(X1) N0^[1]^1(X2)} S = S'

Random Input generated: t0 t0 t0 t0 t1 t1

java.lang.ArrayIndexOutOfBoundsException: 1

at com.github.samyadaleh.cltoolbox.common.lcfrs.Predicate.getSymAt(Predicate.java:120)
at com.github.samyadaleh.cltoolbox.chartparsing.lcfrs.earley.SrcgEarleyComplete.calculateConsequences(SrcgEarleyComplete.java:58)
at com.github.samyadaleh.cltoolbox.chartparsing.dynamicdeductionrule.AbstractDynamicDecutionRuleTwoAntecedences.getConsequences(AbstractDynamicDecutionRuleTwoAntecedences.java:14)
at com.github.samyadaleh.cltoolbox.chartparsing.Deduction.applyRule(Deduction.java:333)
SamyaDaleh commented 4 years ago

cl.log

SamyaDaleh commented 4 years ago

fixed