(* To evaluate code of the editor in the interpreter: select the code lines to evaluate and press CTRL+E (or CMD+E on MacOS). *) let alp= alphabet "f:2 a:0 b:0 c:0";; let aut= automaton alp "States q0 q1 q2 Final States q0 Transitions f(q1,q0) -> q0 f(q1,q1) -> q2 a -> q1 q2 -> q0";; let vars= variables "X Y Z";; let trs1= trs alp vars ["f(X,f(Y,Z)) -> f(Y,Z)";"f(a,a) -> b"];; let ts= term_list alp vars ["a";"f(a,a)";"f(f(a,a),a)";"f(a,f(a,a))";"f(f(a,a),f(a,a))"];; let reco= filter ts aut;; let aut_inverse= inverse aut;; let ts3= gen_terms aut 4;; let ts4= gen_terms aut_inverse 4;; filter ts4 aut;; let r1= regexp alp "f(a, ((f(a, c) * c) . c (a)))";; let aut_r1= regexp_to_automaton r1;; is_equal aut aut_r1;; let sr1= sregexp alp "f(a,[f(a,*|a)])";; let r2= sregexp_to_regexp sr1;; let aut_sr1= sregexp_to_automaton sr1;; is_equal aut aut_sr1;; let irr_trs1= irr alp trs1;; let (completed_automaton,is_complete,pattern_found)= timbuk_completion 10 aut trs1 [] [] false;; let nf= simplify (inter irr_trs1 completed_automaton);; (* see all Taml's functions *) help();;