Going from tree structure to set in F#

If I have the following type declaration in F# how would I go about creating a function that can make it into a set? This is my thoughts so far

type T<’a> = 
| A of ’a
| B of ’a * T<’a>
| C of ’a * T<’a> * T<’a>

let rec toSetHelp (t,p) acc = 
   match t with 
   | A v -> if p v then v else Set.empty
   | B (v,t1) -> if p v then toSetHelp (t1,p) (Set.add v acc) else toSetHelp (t,p) acc
   | C (v,t1,t2) -> if p v then 

Can you provide some test example? I.e simple input and desirable output?