The small boy in the red hat has a cracker.
The boy is wearing a hat.
A boy in a hat implies the boy is wearing the hat.
exists e1 s1 s2 x1 x2 x3.(n_hat(x2) & a_red(s2) & Theme(s2,x2) & n_boy(x1) & a_small(s1) & Theme(s1,x1) & Theme(e1,x3) & Actor(e1,x1) & v_have(e1) & n_cracker(x3) & in(x1,x2))
exists e1 x1 x2.(n_boy(x1) & Theme(e1,x2) & Actor(e1,x1) & v_wear(e1) & n_hat(x2))