Pattern Matching and Goal Directed Computation