Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Assignment 2

Microproject

Write a Clojure function which performs the not-elimination rule of inference described below in the main project. That is, write a Clojure function called not-elimination which takes a not expression as an argument, and returns a singleton set containing the result of not-elimination if the elimination rule applies, otherwise return the empty set.

Example usage:

Main Project

In this project you will implement part of a propositional logic inference system in Clojure. Specifically, your system will perform not, and, and if-elimination using forward chaining inference. This means that given a proposition and a knowledge base of known facts, your system will derive all propositions which follow using the rules of inference.

You will implement four rules of inference:

  • not-elimination: from (not (not X)), infer X
  • and-elimination: from (and X Y), infer X and infer Y
  • modus ponens: from (if X Y) and X, infer Y
  • modus tollens: from (if X Y) and (not Y), infer (not X)

The main entry point for your program should be a function called fwd-infer which takes two arguments: a proposition, and a set of known facts (propositions). It should return the new knowledge base – that is, the originally known facts with the proposition and any newly inferred propositions added to it.

You might wish to start with the below skeleton for the program:

Examples