type nat = Z | S nat

function plus (x y:nat) : nat =
  match x with
  | Z -> y
  | S z -> S (plus z y)
  end
  
predicate f nat

axiom a1 : f (S Z)

axiom a2 : forall x [f x]. f x -> f (plus x x)

axiom a3 : forall x [f x]. f (plus (plus x x) (plus x (S Z))) -> f x

goal g3 : f (S (S (S Z)))
