Sunday, August 06, 2006

Rapid Prototyping using Prolog

In this lecture, we did an example and made an expert system called Car Diagnosis system. Knowledge base is comprised of three main parts i.e. Questions, Rules and Replies.
In this expert system, we first designed questions then rules and then tested the system based on different questions.
This lecture helped us alot in doing our final lab.

Thursday, August 03, 2006

Listing and Operations in Prolog

Last weeks lecture was on Listing and Operations in prolog. Listing is an ordered sequence of elements that can have any length. A list has two parts; a head and a tail. Elements can be alphabates, numeric values or combination of them can also be used. Since list has a different form of declaring itself, that's why list elements are enclosed in square brackets. Head and Tail, both can have more than one element. Empty list is represented as "[]" not [0] becase 0 is a character.
After an introdction to Listing in Prolog we did quite a few examples on list like; writing, reading, testing, reversin, finding any element in list, counting total number of elements in a list, concatinating two lists etc. Examples gave us an insight in listing because we practice them and we can have better idea on how list works.

The second part of today's lecture was about Operations in Prolog. Operators are special identifiers equivalent to predicates, which can be positioned in the program code in a specified way. Operators help in increasing the readability of the program. Operators can be of three type; a postfix operator, prefix operator and infix operator. All three are used in different positions and they work in different ways.
Postfix operator comes after element.
Prefix operator comes before element.
infix operator comes within two elements.