let apply f r a b =
let (a', alpha') = f a
and (b', beta') = f b in
match r a' b' with
| (Three.Yes(tau) as res) ->
if a == a' && b == b' then res else
Three.Yes(dep3 tau alpha' beta')
| (Three.No(tau) as res) ->
if a == a' && b == b' then res else
Three.Yes(dep3 tau alpha' beta')
| Three.X ->
Three.X