### COSC 574: Automated Reasoning

Project 2
Spring 2016

Due: W 3/23 @ 11:59 PM
10 points

1. Using Prolog, write predicates that are true if they can unify a list holding the minimum and maximum values in a list of numbers. Do not use built-in predicates (e.g., max/2) in your implementation.

2. Encode the following tree as a list asserted as a fact. Write the predicates preorder/2 and postorder/2 that are true if they can unify a list holding the pre-order and post-order traversals of the tree, respectively.

For example:

```?- tree(T), preorder(T, L).
T = [o, [r, [e, [g], [o]], [e, [g], [t]]], [o, [n, [w], [h]], [a, [y], [...]]]],
L = [o, r, e, g, o, e, g, t, o|...].
```

3. Encode the following graph using facts. Write predicates that are true if they use depth-first search to unify a list holding a path between a start node and an end node.

For example:

```?- dfs(a, g, Path).
Path = [a, b, c, d, e, g] ;
Path = [a, b, c, f, e, g] ;
Path = [a, b, d, e, g] ;
Path = [a, c, d, e, g] ;
Path = [a, c, f, e, g] ;
false.
```
4. Pick your favorite step from the process that transforms wffs to clausal form and implement it using Prolog. Make sure it recursively handles nested patterns.

5. Use Prolog to prove that Colonel West is a criminal. For example:
```?- criminal(west).
true.

?- criminal(X).
X = west.
```

#### Instructions for Electronic Submission

In the header comments of the primary file, provide the following information:
```%
% Name