let logically_eq_symbols entry =
let rec eq_symbols s1 s2 =
match (s1, s2) with
| (Snterm e1, Snterm e2) -> e1.ename = e2.ename
| (Snterm e1, Sself) -> e1.ename = entry.ename
| (Sself, Snterm e2) -> entry.ename = e2.ename
| (Snterml (e1, l1), Snterml (e2, l2)) ->
(e1.ename = e2.ename) && (l1 = l2)
| (Slist0 s1, Slist0 s2) | (Slist1 s1, Slist1 s2) |
(Sopt s1, Sopt s2) | (Stry s1, Stry s2) ->
eq_symbols s1 s2
| (Slist0sep (s1, sep1), Slist0sep (s2, sep2)) |
(Slist1sep (s1, sep1), Slist1sep (s2, sep2)) ->
(eq_symbols s1 s2) && (eq_symbols sep1 sep2)
| (Stree t1, Stree t2) -> eq_trees t1 t2
| (Stoken ((_, s1)), Stoken ((_, s2))) ->
eq_Stoken_ids s1 s2
| _ -> s1 = s2
and eq_trees t1 t2 =
match (t1, t2) with
| (Node n1, Node n2) ->
(eq_symbols n1.node n2.node) &&
((eq_trees n1.son n2.son) &&
(eq_trees n1.brother n2.brother))
| ((LocAct (_, _) | DeadEnd), (LocAct (_, _) | DeadEnd))
-> true
| _ -> false
in eq_symbols