# Exercise 6

## Overview

Play with tableau style prover for FOL.

## Learning Objectives

- Learn about tableau provers for FOL
- Explore different styles of dealing with quantifiers.

## Getting Started

Code is here. You will be modifying the file
Tableau.hs, but you will need all the files in the directory.

Study the lecture notes and pay particular attention to the sections
on closing a tableau.

- The code in the file implements two tableau style provers. Both provers build
a data structure that represents a tableau. The first a Tree and the second a list of paths.
- Neither inspects the data structure to see if all the paths are closed.
- Your job is to modify (or write your own) tableau style prover that checks the to see
if all the paths are closed.
- To do this you will need to check to see if two (Rel nm args) Formula are conjugates.
I have written some code to do this. See the functions conjugates and someConj.
conjugates x y =
case unifyForm x (notP y) of
Just s -> Just(s,subst s x,subst s y)
Nothing -> case unifyForm (notP x) y of
Just s -> Just(s,subst s x,subst s y)
Nothing -> Nothing
someConj x [] = Nothing
someConj x (y:ys) =
case conjugates x y of
Just triple -> Just triple
Nothing -> someConj x ys

Both return an Maybe(Subsitution,Formula,Formula). The first checks if two
formula can be made the same under some unifier, if so it returns the
unifier and the two terms with the unifier applied. The second tests if
a Formula is the conjugate of any one of multiple formula in a list.
- I have not provided the code to do this. This is your job.
- I am also asking you to provide a solution to the problem that
some universal quantified formulas may have to be used more than once.
Propose a solution and implement it.

## What to do

- Download the first or logic directory.
- Modify the file Tableau.hs so that it provides a prover that tests if every
path is closed.
- Provide 3 examples of formula it can solve.
- Suggest a strategy and implement a prover that uses that strategy to allow
a universally quantifed formula to be instantiated more than once.
- Show that it works on several examples.
- Turn in just your file to D2L.

Back to the class web-page.