(datatype tree (NT String tree tree) (T String String)) (function getString (i64) String) (relation Prod (String String String)) (relation End (String String)) (relation P (i64 i64 String)) (function B (i64 i64 String) tree :cost 100000) (rule ((End a s) (= s (getString pos))) ((P 1 pos a) (union (B 1 pos a) (T a s)))) (rule ((Prod a b c) ;; a -> bc (P p1 s b) (P p2 (+ s p1) c)) ((P (+ p1 p2) s a))) (rule ((Prod a b c) (= f1 (B p1 s b)) (= f2 (B p2 (+ s p1) c))) ((union (B (+ p1 p2) s a) (NT a f1 f2)))) (input Prod "./tests/cykjson_Prod.csv") (input End "./tests/cykjson_End.csv") ; small size 801 (input getString "./tests/cykjson_small_token.csv") ; medium size 7821 but runs for 2 min. ;(input getString "./tests/cykjson_medium_token.csv") (let test1 (B 801 1 "VAL")) (run 10000) (check (P 801 1 "VAL"))