Logic Expression Simplifier: Algebraic Expression Simplification in Common LISP - Prof. Ab, Assignments of Computer Science

A programming assignment for a software paradigms course at the george washington university's department of computer science. Students are required to develop a logic expression simplifier (les) using given simplification rules and then implement it using the jatha common lisp library in java. Examples and instructions for part i, which involves writing a scheme function for the simplification rules, and part ii, which involves implementing les using jatha.

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-fdw-1
koofers-user-fdw-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
A. Bellaachia
The George Washington University
School of Engineering and Applied Science
Department of Computer Science
CSci 169 – Software Paradigms – Fall 2006
Programming Assignment # 3: Logic Expression Simplifier
Due Date: Wednesday, November 29, 2006
Instructor: A. Bellaachia
Send the electronic version of your assignment to: [email protected]
Part I:
Consider the problem of simplifying an algebraic expression, such as the symbolic
differentiation. In this project, we would like to develop a
Logic Expression Simplifier
(LES)
using the following simplification rules:
- Simplification using mathematical identities of false (0) and True (1) when added or
multiplied with another expression:
o C or False = C
o C or True = True
o C and False = False
o C and True = C
C can be either a constant or an unknown variable.
Write a scheme function that implements the above rules.
Notes:
o And” and “Or” are reserved keywords
o Space is a delimiter.
o You assume that the expression is syntactically correct.
o You need to read a logical expression in infix format and apply your LES
o You can assume that the input expression is fully parenthesized
Examples:
- Input: False and True
- Output: False
- Input: (C and True) or (Y or False)
- Output: C or Y (It is ok if your input may look like (C) or (Y))
- Input: (C and False) or (Y or True)
- Output: True (It is ok if your input may look like (C) or (Y))
pf2

Partial preview of the text

Download Logic Expression Simplifier: Algebraic Expression Simplification in Common LISP - Prof. Ab and more Assignments Computer Science in PDF only on Docsity!

A. Bellaachia

The George Washington University School of Engineering and Applied Science Department of Computer Science CSci 169 – Software Paradigms – Fall 2006 Programming Assignment # 3: Logic Expression Simplifier Due Date: Wednesday, November 29, 2006 Instructor: A. Bellaachia

Send the electronic version of your assignment to: [email protected]

Part I: Consider the problem of simplifying an algebraic expression, such as the symbolic differentiation. In this project, we would like to develop a Logic Expression Simplifier ( LES ) using the following simplification rules:

  • Simplification using mathematical identities of false (0) and True (1) when added or multiplied with another expression: o C or False = C o C or True = True o C and False = False o C and True = C

C can be either a constant or an unknown variable.

Write a scheme function that implements the above rules.

Notes:

o “And” and “Or” are reserved keywords

o Space is a delimiter. o You assume that the expression is syntactically correct. o You need to read a logical expression in infix format and apply your LES o You can assume that the input expression is fully parenthesized

Examples:

  • Input: False and True
  • Output: False
  • Input: (C and True) or (Y or False)
  • Output: C or Y (It is ok if your input may look like (C) or (Y))
  • Input: (C and False) or (Y or True)
  • Output: True (It is ok if your input may look like (C) or (Y))

A. Bellaachia

Part II:

Jatha is a Common LISP library implemented in Java. It implements a large subset of Common LISP functions. It enables programmatic access to LISP from Java, either using an eval() method or using Java methods. You can find more information about Jatha in: http://jatha.sourceforge.net/

In this second part of the project, you need to implement LES using Jatha.

Part III: Compare the performance of the implementations in Part I and Part II.