You are on page 1of 64

Appendix 8.

BI S2040
Knowledge Based Systems
Module Handbook
Semester 1
Dr Christian Huyck
School of Computin Science
Module Introduction
Welcome to "Knowledge-based systems for business". This course is about symbolic AI in general and
building knowledge based systems in particular. In particular we will work with two types of expert
systems rule based systems and case based reasoning systems. Additionally we will talk about
knowledge representation and knowledge engineering. !ou could also read through the notes for
lecture " below.
Contacting the Module Leader
Office Hours - Roo !o" M2#2 Hendon
Times to be determined after handbook publication. (Check the web site below.)
Telephone 020 8!! "!2
#eb pa$es
Rationale Including Ais
Knowledge-based systems# the knowledge representation approaches that they depend on# and the
knowledge engineering techni$ues that are used to build them are presented in this module. It pro%ides
a thorough understanding of the principles# design# de%elopment and operation of these ad%ice-gi%ing
systems and particularly of expert systems# and an introduction to related artificial intelligence
Learning Outcoes
Knowledge &n completion of this module# the successful student will be able to - 'escribe the nature
of expertise.(") - 'escribe the nature# and identify the ad%antages and the disad%antages of knowledge-
based systems# and particularly expert systems# as used by commercial and public ser%ice
organisations.(*) - +xplain the working of rule-based systems# and the kinds of inferencing that are
used in such systems.(,) - 'escribe important knowledge representation formalisms.(-) - +xplain the
role and the tasks of the knowledge engineer# particularly with regard to knowledge ac$uisition# and
the de%elopment of knowledge-based systems.(.) /kills This module will call for the successful
student to demonstrate the ability to - +xtract knowledge structures from transcripts of inter%iews with
experts# and represent this knowledge using recognised formalisms.(0) - +%aluate proposed knowledge
engineering pro1ects from the point of %iew of %iability and cost effecti%eness.(2) - 'ecide appropriate
rule-based inferencing approaches in particular cases.(3) - 4ollect sufficient knowledge to build a
small K5/ in a particular knowledge domain# and represent it in a way that can be con%erted into a
machine-usable knowledge-base.(6) - 7se the expert system shell presented in this course to de%elop a
standalone K5/ application.("8) 9 7nderstand basic issues in searching. ("")
Assessent %chee
4oursework .8: +xamination .8:
Reading Materials
Core &exts
4ore Text ; <ackson# =eter. Introduction to +xpert /ystems (,rd edition). "666# Addison-Wesley#
I/5> 8-*8-"32030-3 ?ussell# /tuart @ >or%ig# =eter. Artificial Intelligence - A Aodern Approach.
/econd +dition *88,# =rentice Ball# I/5> 8-",-838,8*-*
Additional texts
; Turban# +fraim @ Aronson# <ay. 'ecision /upport /ystems and Intelligent /ystems (0th edition).
*88"# =rentice Ball# I/5> 8-",-836-0.-0 ; Awad# +lias. 5uilding +xpert /ystems - =rinciples#
=rocedures and Applications. "660# West =ublishing# I/5> 8-,"--800*0-3 +%ery attempt has been
made to ensure this information is correct at the time of publishing. Bowe%er additional information
may be pro%ided in the module handbook.
%tud' hours outside class contact
The total study hours for a 20cpt module is !80 hours. Therefore& if a module has time'tabled
acti(ities i.e. lecture%seminar%lab& of ) hours per week for a !! week semester (total of )) hours)& then
the out of class study commitment per module& per semester& students ha(e to study is !* hours.
(rief )uide to *eb-based Module Material
+ll the lecture notes& exams and lab descriptions are on
%oe rele+ant ,eb sites
These are old sites (0 /ept C88)D sorry I ha%enCt had time to update this.
AIAI Information /er%ices
A semi-commercial AI research organisation based in +dinburgh. This lists some of their current
AI on the web httpEEwww.cs.berkeley.eduEFrussellEai.html
/tuart ?ussell# who produced this site# is one of the authors mentioned in the next section. This site
hasnGt been updated since "663# but is still an impressi%e collection of 26. links to interesting AI
5ritish 4omputer /ociety /pecialist Hroup on +xpert /ystems
Bome page. 'etails of their conferences# e%ening meetings etc.
K5/ Hroup at the 7ni%ersity of Texas - "/ome ongoing K5/E&ntology pro1ects and groups"
A large number of links on knowledge representation pro1ects# and related work.
>ational ?esearch 4ouncil of 4anada - "+xpert systems and knowledge-based systems"
A collection of links.
7ni%ersity of Ieeds E >ew technologies Initiati%e - "WWW Training resources in K5/ @ /AIT"
Another collection of links.
.etails of Course,or-
The main coursework is,
The assignment for the module is simply to do the "8 labs for the course. +ach lab will be worth "8
points# and will be e%aluated at the beginning of the subse$uent lab session. Jor example lab " will be
marked at the beginning of the lab session in week *.
Marking scheme each lab is marked indpendently and is worth up to "8 points. If you arenCt in the lab
on the week it is marked# you will recei%e a 8 out of "8. =art of the e%aluation will be to show the work
dynamically to dissuade plagiarism. Jor example# when e%aluating lab "# you will be asked to make a
rule in clips.
!ou will be able to drop the two lowest scores# so the mark will be out of 38.
Re-sit students are encouraged to attend the labs so that they can get the mark based on the
main coursework. However they may opt for:
The assignment for the module is as follows
!ou are to build a Knowledge 5ased /ystem using 4lips# or 4aspian. It will contain knowledge from a
domain of your choosing# and will include rule-based reasoning (either forward chaining# backward
chaining or mixed)# or case-based reasoning. Appro%al for your chosen knowledge domain must be
obtained from the module tutor# to ensure that the domain is suitable. !our coursework# when handed
in# should include a floppy disk containing the finished system.
In past semesters we ha%e made it mandatory that you select your own domains. This was to force you
to explore the knowledge engineering issues. While we would prefer you to choose your own domain#
we ha%e pro%ided se%eral example domains belowD it is unlikely that you will recie%e a first class mark
if you use these domains# but they should gi%e you an idea of a minimal system.
Aarking scheme
". The =rogram ?uns (up to *8).
*. /ophistication and +xtent of Knowledge 5ase (up to *. marks)
,. +xtent to which the system performs a useful function (up to ". marks)
-. 'iscussion of why this particularly domain is appropriate for the type of expert system you
used. (up to "8 marks)
.. 'escription of the knowledge ac$uisition process. A sample taken from a published source of
the knowledge or an inter%iew transcript are useful. (up to "8 marks)
0. 'escription of rules or cases and data items (up to "8 marks)

2. 'escriptions of "successful" and "unsuccessful" program runs# including sample output. (up to
"8 marks)
/ome notes on the abo%e marking scheme
• "+xtent to which the system performs a useful function" - a tri%ial application will get less
marks than an application that someone (in the real world) might actually get some benefit
from. Also# marks may be deducted for lack of %alidity in the knowledgebase in other words#
if rele%ant features of the domain knowledge ha%e been ignored# or distorted# or in%ented# in
the process of turning them into components of the knowledgebase# this may result in loss of
• "The extent of the knowledgebase" - a knowledgebase containing# say 3 rules# will get rather
poor marks in this category ("8 marks). &ne containing# say# *- rules will get rather high marks
("3)# assuming the rules are useful. 5eyond a certain point# howe%er# no more marks will be
awarded# so it is not worth de%oting time to producing an enormous rule base. Also note that
one rule can do the work of se%eral other rules. This is reflected in the sophistication of the rule
• "The sophistication of the knowledgebase". =artly# this is the extent to which the features of the
package are employed to produce an effecti%e reasoning system. 5ut it is also true that a more
ingenious or original system will obtain more marks than a less ingenious or original system.
• "'escription of rule or cases and data items" - I want a chart describing the knowledge# and the
reasoning that it supports. Jor example an and-or chart for a backward chaining system# but
you may choose another form of representation if you feel it to be more appropriate. There is
no need to include a listing of the rules or the case base as youCll submit that on a floppy.
• "'escription of successful and unsuccessful runs" - this describes runs of the system you
submit. There is no need to describe problems you had while de%eloping the system. Aoreo%er#
you should describe the system so that the run can be replicated.
=ro1ect handed in to /tudent &ffice (end week "")
Where to submit
o 4lips =ro1ects
". Tic-Tac-Toe
*. =lant Identification
,. 5ag =acking
-. A/ Word ?uler Belp 'esk
.. +ngine 'iagnosis
0. 'ormitory Assignment
o 4aspian =ro1ects
". Hift /election
*. 7ni%ersity =rogram /election
,. 5ag =acking
ThereCs a sample co%er sheet on the next page - feel free to copy it and use it on your
assignment# inserting your details. !our assignment# including co%er sheet# write-up and
program on floppy disk# must be submitted to the student office where it will be dated and
receipted. !ou should keep your receipt - it is for your own protection. 'o not hand written
assessed coursework direct to your tutor. !our assignment should normally be handed in on the
campus at which the module is being taught (e.g. Bendon)D if for any reason you ha%e to hand
it in at another campus# please point this out to the student office so that it can be sent to the
correct campus. If# in an emergency# you ha%e to send in written assessed work by post you
must send it by recorded deli%ery to the appropriate student office and keep the =ost &ffice
receipt. It will be deemed to ha%e been submitted on the date of the postmark.
?eceipts for work submitted outside opening hours can be collected from the student office.
.eadline for %ubission of Course,or-
The main coursework is due throughout the semester (week * to "")# by the end of the students lab
Map of course,or- deadlines b' /rograe 0 le+el 12 #2 or 22 or 3 or 4
*here to subit"
The main coursework is described to the tutor in the lab session.
The resit coursework must be submitted to the -tudent office& you should attach a coursework
feedback form which will be dated and receipted. .ou should keep your receipt ' it is for your own
5eedbac- to students on course,or-
The main coursework will be marked in the lab session in cooperation with the student.
The resit coursework will be a%ailable at the end of the semester in the tutorGs office. =lease e-mail or
phone for an appointment.
Lecture /lan
#orkshop sessions
in week no,
ns in
Title 1eadin$s. +ll from
2ackson unless specified
! 3ntroduction to
! 3ntroduction and 4(er(iew Chapter ! and -ection ".!
and ".2
2 Chains& side
effects etc.
2 1ule 5ased -ystems +rchitecture and
6ro$rammin$ with 1ules
-ection ".!& ".2 and
) 7ecision Trees ) 8ettin$ 1ules to #ork To$ether -ection ".) and Chap. 2
0oops and
9unction Calls
:nowled$e 1epresentation and 0o$ic -ection 8.!.! and 8.!.2
" -emantic ;ets
with Clips
" -emantic ;ets -ection /.! and /.2
/ 5acktrackin$ / 1ule 5ased -ystems <xamples Chapter )
* 3ntrouction to
* Case 5ased 1easonin$ Chapter 22
8 7e(elop a C51
8 Case 5ased 1easonin$ <xamples
= :nowled$e
= :nowled$e <n$ineerin$ and
5ackward Chainin$
-ection !0.!& !0.).! and
!0 5ackward
!0 9rames and <xpertise -ection /.)
!! open !! -earch -pace >nifyin$ Themes 1ussell and ;or(i$
Chapter ).
!2 open !2 Conclusion and 1e(iew
Laborator'6%einar Materials
Welcome to B! "#$#
• I am 4hris Buyck.
• Ay office is ?"82 in Bendon
• Ay office hours are Thursday ""-"* this semester.
• Ay email address is and this is the best way to get me.
• This lecture is on my web site (
• I know loads about +xpert /ystems and Artificial Intelligence.
• 'oes anyone want to ask me any $uestions about +/s or AIL
• ICm also the lab tutor.
• I think AI is interesting# in demand economically# and fun.
B! "#$# %ourse !tructure
• The exam is worth .8: of the grade# and the coursework is worth .8. !ou ha%e to pass both to pass.
• The coursework is to implement the labs on time. ItCs in the handbook# and at*8-8Ecoursework.html .
• The course text is Introduction to +xpert /ystems by =eter <ackson
• As usual# all e%aluation will be based on the learning outcomes.
• I gi%e the lectures this semester.
&earning 'utcomes
• +xpert /ystems
o Bow ?ule 5ased /ystems work
o 4ase 5ased ?easoning
o ?ule 5ased /hells
o 'e%eloping +/s
o +xpertise
• Knowledge +ngineering
• /ymbolic Knowledge ?epresentation
o Iogic
o /emantic >ets
o Jrames
• /earch and /earch /paces
(ou Must )rogram
• The labs are programming expert systems.
• The exam will ha%e a significant portion on programming expert systems.
• If you donCt want to program# withdraw from this course.
*+pert !ystems
• +xpert /ystems are often called rule based systems. Alternately# they also refer to both rule based and case based
• ?ule based systems are made up mainly of a collection of rules.
• ?ules are if then else statements
• /o that the system works in different cases# it also has working memory (WA).
• WA is input by the user# the rules inspect it# and may modify it.
• The ?ule based system itself looks at the WA# and selects rules to apply that are legitimised by the WA.
• If (M bears li%e young) and (M gi%es milk) then (M is a mammal)
• Why is this usefulL
• Bow is it different than writing (e.g. <a%a) code.
,nowledge Representation
• Bow do you represent knowledgeL
• program %ariables integers# reals# booleans# characters# strings
• programs
• databasesL
• Iogic
o All men are Aortal# /ocrates is a Aan# therefore /ocrates is Aortal
o Jirst &rder =redicate Iogic is part of this class.
o Junctions are important in all of this
• /emantic >ets hierarchies# part-of# relationships.
• Jrames e.g. the %erb hit has an actor slot# an ob1ect slot# and an instrument slot.
• These are symbolic ways of representing knowledge. They will be on the exam.
%ase Based Reasoning
• 45? is based on a collection of cases.
• !ou figure out what to do in each case in the collection# you may do the same thing in se%eral cases.
• When a new case comes in# you compare it to the collection.
• !ou gi%e the ad%ice of a nearby case.
• An example might be a trouble shooting desk. 68: of the $ueries fall in "8 categories.
• Jigure out what category it is in (including the ""th other category)# gi%e the appropriate ad%ice# or in the other
case# phone a help person.
• This sa%es 68: of your help person time (after de%elopment).
• What would a case look likeL
• Bow do you tell which cases are near to the new caseL
,nowledge *ngineering
• Bow do you build systems like theseL
• !ou learn how to build the +/s (rule based and 45? systems).
• !ou learn how to choose which is best (if either).
• !ou get the information from the experts.
• I can write an +/ for wine selection# but I canCt tell you much about wine.
• I need to ask an expert.
• Bow can you askL Inter%iews# reading# prototype e%aluation# ask multiple experts.
• This is the process of knowledge engineering.
)rogramming *+pert !ystems
• I want to concentrate on programming expert systems.
• Iast semester there were %ery few firsts on the course works# and no firsts o%erall.
• >one the less# people did well on the implement a ?ule 5ased system# and implement a semantic net exam
• 4onse$uently# ICd like to spend more of the lectures talking about implementing systems.
• This ties in with software engineering# but I think programming is a different skill.
• Bow can you make 4lips or 4aspian do thingsL
• The labs concentrate on this programming# but we will also concentrate on programming during lectures.
n class e+ercise
A firm of wine importers relies hea%ily on its chief wine expert# who is skilled at selecting wines that are destined to be
popular# on the basis of their taste# colour# scent etc. /he is soon to retire. It is proposed to build an expert system that will
enable any of se%eral 1unior wine specialists to do her 1ob.
". Aake a rule that would be used in such a system.
*. What is an example of working memoryL
,. What is an example of deri%ed knowledgeL
-. Bow would you get the knowledge for the systemL
.. 'o you think it will workL
0. Why andEor why notL
• Hraphs are an important mathematical and computer science concept.
• A graph consists of nodes and arcs that connect them.
• Hraphs arenCt going to be on the exam# but we use a couple of types of graphs for knowledge representation.
• We use semantic nets# decision trees# and-or trees# and frames.
• !ou probably also know about a few other types of graphs like entity-relationship diagrams# flowcharts# and case
• 'raw a graphN
• The key difference between types is that the nodes and arcs ha%e different restrictions and meanings.
• Jor example# nodes in a semantic net represent concepts# the arcs are directed# the arcs are labelled# and they show
the relationship between the nodes they connect.
• The nodes in a decision tree represent a $uestion# and the the arcs represent answers.
• ICll show you a semantic net and a decision tree.
!earch and !earch !paces
• &ne thing that is important in programming# and particularly important in many AI systems is searching.
• Jor example# lab0 has you writing a system that searches through a maOe
• Bow would you search through this maOeL
• This particular problem has se%eral important characteristics.
• 5acktracking is importantD if you make a wrong choice# you can go back.
• There are a small number of discrete options. It is ob%ious how to mo%e from one state to the next.
• !ou can only mo%e directly from one state to a few other ones.
• This is a physical manifestation of searching.
• &ther problems can be translated into a state space# and that space can be searched. The search pro%ides the
". !ou will ha%e to program in this course.
*. 'o the labs# which are designed to teach you to program.
,. The ability to program will help considerably on the exam# but try to do the reading.
-. Ask $uestions in class.
.. If you keep up with the labs# youCll pass the course.
0. If you want a first# do the coursework early# read# and ask $uestions.
• The coursework is to do the labs and show them to me. ItCs worth .8: and the exam is worth .8:.
• WeCll learn about +xpert /ystems (?ule 5ased systems and 4ase 5ased ?easoning)# Knowledge ?epresentation#
and Knowledge +ngineering.
• ItCs practical# symbolic AI.
• Who wants to be a student representati%e for this moduleL
• What is AIL (ItCs not on the exam.)
• Jor next week read 4hpt. " and section .." and ..*
• The lab is to get a rule based system running
Rule Based !ystem .rchitecture

• This is the runtime architecture
• The user starts the system and interacts with it %ia the user interface.
• This is the command prompt in 4lips and the session window in Kappa =4.
• The engine is the part of the program that actually does stuff.
• It says# run the system# that is# look at working memory# see what rules fire# and apply them.
• !ouCll ha%e the same inference engine for each rule base.
• The knowledge base is the rules and the working memory.
• The rules will remain the same for different runs.
• WA changes for each run and during the run.
nference *ngine
• The Inference +ngine compares the rules to working memory.
• It picks a supported rule and fires it.
• There can be more than one supported rule# and this is resol%ed by a conflict resolution strategy.
• Jor example if the rules look like
o if (Jeature LM colour green) and (Jeature LM type fruit) then (Jeature LM subtype Watermelon)
o if (Jeature LM colour red) and (Jeature LM type fruit) then (Jeature LM subtype Apple)
• and working memory says (Jeature M" colour green)# (Jeature M* colour red)# (Jeature M" type fruit).
• What rule is appliedL
• What happensL
• A rule can be supported more than once.
• A fact can be used to support more than one rule.
• 7ndo the rule and add the working memory item (Jeature M* type fruit).
• What rule is appliedL
• >ow what happensL
,nowledge Base
• The Knowledge 5ase consists of rules and working memory (WA)
• ?ules are if then statements
• &n the if side you ha%e conditional expressions# (e.g. (Jeature LM colour green))
• !ou can ha%e %ariables in here# in this case LM is a %ariable.
• &n the then side you usually ha%e assignments.
• That is you set or modify working memory items.
• In 4lips you set %alues by (assert (fact))D so on the then side we (assert (Jeature LM" subtype watermelon))
• !ou compare by stating the fact in the if part or by using (test (func params)). +.g (test (P La ,))
• The if part is con1oined by and by default
and you can use the and or# and not functions
• Qariables cross expression e.g.
• If (fa%orite-colour LQal) then (assert (pick 4olour LQal)
Working Memory
• Types of WA items
• <ust like structured programming# items can ha%e types
• !ou can enumerate %alues
• or ha%e integer# real or really anything.
• In 4lips you can also ha%e complex templates and ob1ects.
• WeCll talk about hierarchies with semantic nets# but it is based on inheritence.
• /ubclasses are specialisations of 4lasses.
• A mammal class# might ha%e a specialisation of primates.
• The classes ha%e slots.
• This is essentially a frame.
• ?ules inspect working memory and can change it.
/ser nterface
• There can be a wide range of 7ser Interfaces.
• I used to use a line mode 7I with &=/.# where you typed in the WA items# and it printed out rules that fired and
• Kappa has a relati%ely sophisticated 7I mechanism.
• 4lips also has a line mode interface.
• An additional set of features is not for the user but for the de%eloper.
o !ou want a rule editor# a WA editor# 7I editor# and a debugger.
o 4lips has debugging facilities accessible through the command prompt. >ote that it is really useful to
de%elop a .clp (text) file and load it in fre$uently. There are also $uite a few facilities a%ailable through
the menus (e.g. watch window and fact window).
*+ample of Rule .pplication
• Jacts
". (age 4hris ,6)
*. (age 5ob ,6)
,. (age Ian ,,)
-. (age Jred)
• ?ules
". if (age LM ,6) RP (assert (is-old LM))
*. if (age LM L!) RP (assert (has-age LM))
• What rules get appliedL
• What facts are addedL
• What order are the rules applied inL
• IetCs build a ?ule 5ased /ystem for fruit and %egetable diagnosis.
• IetCs identify Apples# Watermelons# &ranges# Tomatos and Iettuce.
• Bere are some rules from earlier
o if (Jeature LM colour green) and (Jeature LM type fruit) then (Jeature LM subtype Watermelon)
o if (Jeature LM colour red) and (Jeature LM type fruit) then (Jeature LM subtype Apple)
• What will WA look likeL
• What will other rules likeL
• 4an we make fruit and %egetable rulesL
• What will it look like in 4lipsL
• What will the 7I look likeL
0ruit .nswer
• Working AemoryD
• A series of features
o Bas/kin
o Bas/eeds
o 4olour
o /$uishy
o IsJruit
o Type

o if (Jeature LM /kin Bas) and (Jeature LM /eed Bas) then (Jeature LM type Jruit)
o if (Jeature LM /kin Bas>ot) then (Jeature LM type notJruit )
o if (Jeature M /eed Bas>ot ) then (Jeature LM type notJruit )
o if (Jeature LM colour green) and (Jeature LM type fruit) then (Jeature LM subtype Watermelon)
o if (Jeature LM colour red) and (Jeature LM type fruit) and (Jeature M s$uishy isnot) then (Jeature LM
subtype Apple)
o if (Jeature LM colour orange) and (Jeature LM type fruit) then (Jeature LM subtype &range)
o if (Jeature LM colour green) and (Jeature LM type notJruit) then (Jeature LM subtype Iettuce)
o if (Jeature LM colour red) and (Jeature LM type fruit) and (Jeature M s$uishy is) then (Jeature LM subtype
o In 4lips
If (or(Jeature LM colour red) (Jeature LM colour orange)) (Jeature LM s$uishy is )
Then (assert (Jeature LM subtype Tomato))
• Write out 7I including assertions for Bas/kin# Bas/eed# /$uishy# and colour
• explicitly state (run) and (reset)
*+planatory !ystem
• &ne of the nice things about ?ule 5ased /ystems is that they can easily explain their reasoning.
• Why is this useful.
• Bow does it easily explainL
• Why is M a lettuceL
• <ust print out the rules that you used.
• (!ou might ha%e to prune dead ends# e.g. tomato)
)rogramming with Rules
• Jormally rules are as powerful as any programming language (like <a%a).
• They are Turing 4omplete (the same guy as the Turing test but a different concept.
• It is harder to do complex looping and functions with +/s (e.g. card dealing).
• That is# anything you can do with <a%a# you can do with rules.
• &ne way to get the power is to ha%e a global %ariable store#
• ha%e a mechanism for accessing and changing it#
• and ha%e a mechanism for choosing which thing to do next.
• With these things you can program anything that is programmable.
• What are %ariables in progammingL
• TheyCre like mathematical %ariables but they ha%e a direct implementation in computer hardware.
• There is computer memory associated with a %ariable (e.g. * bytes# ,* bytes# or *888 bytes).
• It usually has a type associated with (e.g. boolean# integer or string)
• The %ariable persists for a time specified by the program# then is used for some other program or perhaps reused
for your program.
• !ou can inspect the %ariable (e.g. RR# S)
• !ou can change the %ariable (R)
• 4lips uses lists for its %ariables. They call them facts.
• /o# you define a fact by for instance a ,-ary predicate like
(age-of 4hris ,6).
• The de%eloper and the reader nows that the age of 4hris is ,6# when he sees this fact.
• A rule has the format
if Boolean-*+pr then !tmt
• if and then are keywords
• +xpr and /tmt refer to expression and statement. They refer to programming language concepts# that ICm not going
to fully explain.
• A simplified %ersion is that an expression has a %alue and a statement does something.
• The if is itself a statement# though it recursi%ely uses statement.
• Another type of statement is the assignment
a R ,D
• Ioops and procedure calls are also statements# as are compound statements (with curly braces).
• An expression has a %alue# and a boolean expression has a %alue of type boolean.
• Jor example
a RR ,
is an expression that has the %alue true or false depending on the %alue stored in the %ariable a.
• !ou can also ha%e compound expressions combined using .nd 'r# or 2ot
• Jor example (a P ") And (a S "8). In 4lips
(%alue La)(test (P La "))(test (S (La "8))
which is the same as
(and(%alue La)(test (P La "))(test (S (La "8)))
• This stuff is the same for many programming languages# so it should not be new to you.
Rule *+ercise
• Write an if then rule for a stop light
• If youC%e written the rule in 1a%a format# try it in clips format.
• >ow write the rules for a dri%erCs beha%iour when the lights are# red# amber# green and red-amber (in clips format).
• What data items would you assertL
Recognise .ct %ycle
• ?ule 5ased /ystems work on a ?econgise Act 4ycle
• ?oughly# rules are recognised as firable.
• A rule is applied# which may or may not change working memory
• It may ha%e side effects (e.g. print something out or mo%e a robot arm)
• A new set of rules is recognised
• If no rules apply the system is done.
• WhyL
• This can change if the system is interacti%e.
• If it is interacti%e# WA can change because of the interface and new rules can be applied.
*asy 2otation but &ess )ower
• +xpert /ystems ha%e a really simple notation
• =eople can easily understand the if then rule structure
• ItCs easy to generate rules
• Bowe%er# it lacks power that structured programming gains from looping and function calls.
• Jormally they are the same (Turing 4omplete)# but itCs harder to do complex stuff with +/s (e.g. card dealing).
• It also gets hard to keep track of large +/ systems (o%er "888 rules).
• /tructured and && programming are easier to manage.
• ?ule 5ased /ystems consist mainly of
• an Inference +ngine# which is the same for different rule bases
• a Knowledge 5ase (rules and working memory)
• and a 7I
• The inference engine runs through a recognise and act cycle
• ?ule 5ased /ystems are less powerful than structured programming# but easier to use and understand
• ItCs easy to get explanatory powers from a ?ule 5ased /ystem by showing the rules that were applied
• Jor next week read sections .." and ..*# and 4hapter - to help with the 4lips command prompt.
%onflicting Rules
• The rule selection mechanism chooses only rules that are %alid and applies one of them.
• What happens when more than one rule can applyL
• This is what a conflict is.
• All the rules that are %alid (whose IB/ is True) are put into the conflict set.
• +/ shells function differently and most ha%e different modes for choosing which rule to apply.
%onflict Resolution !trategy
• When multiple rules can apply# you need a conflict resolution strategy
• The conflict is between different rules
• There are a range of different strategies
• /ome systems apply all rules that can apply (e.g. the =arsimonious =roduction /ystem)
• /ome use the rules with the most conditions
• &thers 1ust do it by the order of the rules
• With small systems it doesnCt really matter much# but with big systems it can really change performance.
'ne Rule 0iring Multiple 3imes
• We said that if the IB/ matches# then the rule is put into the conflict set.
• ItCs unusual for the ?B/ to change the IB/ so most rules should remain in the conflict set. ('id you follow thatL)
• They donCt.
• If a rule has been applied# it wonCt be applied again unless one of the things the IB/ depends on changes# or if
there are mutliple ways of it applying.
• The simplest way to get a rule to fire twice is that it applies on multiple pieces of data
• if (isdog Lx)RP(assert (issmelly Lx)))
with the two facts (isdog lassie) (isdog /antasIittleBelper)
• The other way is to change the %alue the IB/ depends on.
0orward %haining
• This is what we ha%e done so far.
• Hi%en facts# apply rules
• &f course there are a range of conflict resolution strategies
• ItCs deri%ing new knowledge from existing knowledge
• This is the way we normally explain Iogic
• It works well when you already know a lot about the en%ironment
• 4an you think of another way to run a systemL
/sing 4erived ,nowledge
• Iast week in the lab# we had a chain of reasoning
• +ach rule deri%ed a fact that anothe rule used
• This is deri%ed knowledge
• The larger the +/ the more deri%ed knowledge should be used
• If not you ha%e a large series of unrelated rules
Many Rules
• /tructured programming languages largely specify the order that statements will be executed.
• ?ule based systems by default do not.
• This is the power and problem with them.
• !ou can of course arrange it so that they are applied largely in the order you want.
• &ne mechanism would be to ha%e a program-counter fact# and each rule would ha%e a different %alue on the if
side# and would change the %alue on the then side to select the next rule to apply.
• This re$uires the programmer to select which rule to come next and largely erases the simplicity of a rule based
• Bowe%er# you can reach a happy medium.
• !ou largely lea%e the system to choose which rule to apply next# but in certain cases you manage it.
• The three basic control structures are branching (e.g. if then else)# looping# and function calls. !ou can do them all
with rules.
• A loop repeats something o%er and o%er again
• A rule or set of a rules can implement a loop
• Jor one rule you need to keep the IB/ true but change one of the data items it depends on.
• Jor example
• if (%alue La) (test (S La .) then (assert (%alue (T La "))
• !ou get La# see if it is less than .# and if so and assert a new fact. The next cycle this exact rule will be rerun again
until (%alue .).
• This is the basic idea for any loop.
• They can also benefit from an initialisation and conclusion rule.
• A function is a body of code that gets parameters.
• 'epending on the parameters the function may calculate a return %alue and may ha%e side effects
• A simple %ersion of this can be done by making rules that only run when a particular fact is set.
• When the function is finished# that fact is changed.
• To call the function# you need to set up the parameters and then set the fact.
• This is only a simple %ersion of function calls# because it does not allow recursi%e functions.
• Jor example (defrule start-loopfunc (start myfunc) RP (assert (%alue ")) (assert (in myfunc)))
• (defrule loopfunc (in myfunc) (%alue La) (test (S La .)) RP (assert (%alue (T La "))))
• (defrule endfunc Lf" S- (in myfunc) (%alue La) (test (R La .)) RP (retract Lf"))
0unction *+ercise
• What facts would you use to represent a studentL
• Write a rule that prints out a studentCs first and last name from the fact.
• Aodify the rule (and perhaps add rules) that implement a function to print out a studentCs names.
• Aodify the rules so that they take a parameter. The parameter is the student number and the rules will now only
printout that studentCs number.
4ecision 3rees
• A standard way to model a process is a decision tree.
• !ou start at the top# where the top node has a $uestion.
• +ach possible answer has a branch# and depending on the answer you follow the branch.
• The lea%es ha%e answers.
• BereCs a decsion tree from the 'ecember *88, exam

!ubmit *+am -no-P U
!ubmit %oursework -no-P U
)ass *+am -no-P lower(4W#+xam)
)ass %oursework -no-P lower(4W#+xam)
• ItCs easy to do this with a rule based system.
• The first rule will take one branch of the first $uestion
• The rules for the second and lower tiers will include all of the answers from abo%e.
• !our rules can be more brief if the $uestions are only asked when needed.
• Jorward chaining goes from existing facts
• 7sing deri%ed knowledge impro%es your system
• !ou can write rules where you specify the control structure.
• The basic techni$ues needed are for loops and functions.
• ?ead section .., (for chaining)# and for those who want to get a first on the exam# chapter *# section *8.,." for
decision trees
• There are some %ery simple purely reacti%e li%ing systems. TheyCre called bacteria.
• A reacti%e system takes a stimulus and does something based on it.
• +%ery other li%ing system stores knowledge and uses it.
• What is knowledgeL
• ThatCs a really hard $uestion.
• If youCre writing a program# half of the problem is figuring out how to represent the knowledge.
• 'eformed 4hecker 5oard +xample.
• There are different ways to store knowledge.
• /ome that you know about are programming %ariables# integers# booleans# reals# text.
• !ou can bind things together in ob1ects# this is similar to a frame (which weCll talk about in a few lectures.)
• !ou can ha%e basic symbols and make relationships between them which is semantic nets and weCll talk about this
next week.
• !ou can ha%e working memory
• !ou can ha%e rules
• !ou can ha%e logics
Working Memory
• Working Aemory is a Knowledge ?epresentation formalism
• ?ule-5ased systems %ary# but usually WA is a series of facts
• What facts can you ha%eL
• Jruit +xample
• 5locks +xample
• Wine +xample
• 4ar 'iagnosis +xample
• Ioan +xample
• >oughts and 4rosses +xample
• What other things are +/s appropriate forL
• 4lips also has &b1ects. It permits you to bind facts together (frames).
• &b1ects also gi%e you inheritence (semantic nets).
• In a rather informal way# WA represents knowledge.
• ?ules are also a form of K?.
• (Jor that matter programs are dynamic forms of K?.)
• ?ules enable you to deri%e more facts.
• ?ules are more dynamic than WA.
• They are of course of the form if M then !
• This is similar to a formal logic.
• There are lots of forms of logic.
• Iogics are systems that are de%eloped to try to $uantify what knowledge is.
• ThatCs why Aristotle came up with a system *.88 years ago.
• The logics we are going to talk about are relati%ely simple and in%ol%e the concept of Truth.
• Jor example Iondon is a 4ity is True# and 4hris is 5ritish is Jalse
• (Jor the pedantic# this really is a simplification of the world.)
)redicates and 1ariables
• =redicates are essential to logics.
• Iondon is a 4ity is represented by 4ity(Iondon).
• !ou can think of =redicates as Junctions.
• I can ha%e multi-%alued =redicates Taller(4hris#Ian).
• Instantiated =redicates ha%e Truth Qalues
Taller(4hris# Ian) R True
Taller(Ian# 4hris) R Jalse
• !ou can of course ha%e %ariables
• Taller(x#4hris) refers to e%eryone who is Taller than 4hris
• >ote that all of the semantics in Taller is not part of the system# I might as well say Hern(x#4hris) or Hern(x#Jerb).
Iogic doesnCt know anything about Taller unless you tell it.
• Also note that in 4lips# predicates are done by placing the function as the first element in the brackets (Taller
4hris Ian)
• &f course# you can use connecti%es like and# exclusi%e or# and not.
• +xclusi%e or %s. Inclusi%e or
• !ou can also ha%e implications# in either direction
• and e$ui%alence.
• There are signs for all of these.
• !ou can combine them# and distribute them.
• This should all be easy and is pretty much the same as a rule-based system.
• What are the differencesL
• =rogramming in Iogic is not on the exam or in the coursework
• !ou write predicates (functions)# and they get e%aluated in a particular order
• The problem with Iogic is that it actually takes a long time to deri%e all the possible facts
• +xpert /ystems ha%e a conflict resolution strategy
• The =rolog program combines the rules with the conflict resolution strategy
How -ood are ,R 0ormalisms
• Knowledge ?epresentation formalisms all are incomplete.
• They donCt represent the world perfectly.
• WeCre not exactly sure how people represent knowledge# but it is certain that each personCs knowledge is incorrect
and incomplete (small brain# big world).
• What do each of the K? formalisms help us doL
• Iogic has %ery little semantics. It doesnCt know what Taller means. I might as well say Hern(x#4hris) or
Hern(x#Jerb). (This is a classic problem known as the symbol grounding problem.)
• Iogic was designed to formalise reasoning. It intentionally remo%es semantics.
• /ymbols can be dangerous. The things that we talk about in this class are purely symbolic# therefore they ha%e no
natural semantics.
• 'ifferent K? techni$ues are going to be better for different applications.
• &ne ob%ious distinction is between declarati%e a procedural knowledge.
• 'eclarati%e knowledge is smaller but faster.
• =rocedural knowledge is bigger but slower.
• Jor example# itCs faster to store ""x""R"*" than to caluclate it# but you ha%e to store a lot of information to do the
"*x"* multiplication table.
Boolean &ogic and Monotonicity
• This kind of logic has a problem it must remain consistent.
• ?emember that any rule of the form if 0alse then anything is %alid.
• /o# if pigs fly then I am the smartest man on the planet. ThatCs a true statment
• Jor a logical K5 to remain consistent# it canCt ha%e M and not(M)
• If it does# then anything can be concluded.
• !ou can make up if clauses of the form if (M and not(M)) then !# to conclude any !.
• /tandard Iogic is monotonic. What you know can ne%er be taken away.
• It seems that humans are non-monotonic. We can hold a belief and later change that belief.
• This is one of the problems of a boolean system.
• /till# boolean systems can go a long way to approximating the real world.
3ruth 3ables
• Iogic Tables can be used to describe logical functions.
• 5elow is a list of se%eral logic tables for different operators.
• The first input argument is the top row# and the second input argument is the first column. The outputs depend on
the inputs and are found in the row and column corresponding to the input.
• The idea is that the statement has the output %alue based on the input %alues. /o# if the statement is =igs Jly and
4hris is a lecturer# the o%erall statement is false. This corresponds to column *# row " of the and table (because
=igs Jly is Jalse and 4hris is a lecturer is true).
• The And Table
3 0
3 T J
0 J J
• The &r Table
3 0
3 T T
0 T J
• The +xclusi%e &r Table
3 0
3 J T
0 T J
• The >ot Table
3 0
• The If Table
3 0
3 T T
0 J T
• This simple logics can be used for analysing the truth %alue of a sentence.
• In the 'ecember *88, exam I asked for the logical formula for f pass the e+am and pass the coursework
then will pass the course or the marking system is faulty.
• &ne logical formula for this is 5*8%7 -9 5):07
• The Truth Table
*% *-% -*% -*-%
)0 T T T T
)-0 T T T T
-)0 T T T T
-)-0 J T T T
• >ote that the sentence is ambiguous. Another logical formula for this is 55*8%7 -9 )7:0
• What is the truth table for thisL
• There are different ways to represent knowledge.
• WA in ?ule-5ased systems is one way to represent declarati%e knowledge
• ?ules are one way to represent procedural knowledge
• Iogic is similar to +/s
• Iogic has predicates.
• Instantiated predicates ha%e truth %alues
• Iogic Tables can be found here.
• ?ead 3."." and 3.".* for Iogic. ItCll be on the exam. 7ni%ersal and +xistential Uuantifiers wonCt be on the exam.
&ast Week
• 'o you ha%e any $uestions from last weekL
• Any $uestions on =redicatesL
• Any $uestions on the courseworkL
!emantic 2ets
• /emantic >ets were in%ented by Uuillian in "606.
• Uuillian was a =sychologist (at 7Aich) and was trying to define the structure of human knowledge.
• /emantic >ets are about relations between concepts.
• /emantic >ets use a graph structure so that concepts are nodes in the graph.
• The concepts are connected by arcs which tells the relationship between the concepts.

.rcs in !emantic 2ets
• >odes can ha%e any %alue
• Arcs can also ha%e any %alue
• 7sually the arc relationship goes in one direction# with the implied re%erse relationship in the other direction
(co%ered-by -P co%ers)
• Typically# the semantic net has a small fixed number of primiti%es as arcs
• This is because these are the main things that the >et can be used for
• A particularly important relationship is Inheritence which is described by the label Is-A
• Inheritence is now used by &b1ect &riented =rogramming
• The idea of Is-A is that the subcategory is a specialisation of the super-category. /o an &strich Is-A bird# and is
thus a special type of bird.
• =roperties are also inheritedD so a bird is co%ered by feathers and therefore an &strich is co%ered by feathers.
• This property inheritence can also be explicitly o%erriden.
• /o# a bird tra%els by flying# but an &strich tra%els by Walking
• &f course things can inherit from multiple super-categories. 'ogs are pets# and are mammals.
• Inheritence 4onflicts. This means that there can be conflicts.
• Instances are a special subset of inheritence. (Type %s. Token)
• They refer to a particular indi%idual# where the general node refers to a class.
• Inheritence and instance-of gi%es representational economy.
• Another popular arc is part-of.
!emantic 2et *+ample
• What birds are thereL
• >ame some inheritence o%errides.
• >ame some inherited features that are not o%erriden.
• What colours can birds beL
• What does 4lips ha%e that is related to this.
• 'raw a semantic net for mammals.
• =ut in a cat-dog.

What;s good about !emantic 2ets
• /emantic >ets start to show relationships between concepts.
• This is good because it gi%es us a lot more power.
• TheyCre an attempt to represent knowledge the way people do it.
• Why is this importantL
• They start to sol%e the symbol grounding problem. What does a symbol meanL
• It means the things it is related to.
)roblems with !emantic 2ets
• ItCs not clear what is the right semantic net.
• =erhaps the best thing is to 1ust lea%e this to an application.
• /preading Acti%ation search is really expensi%e.
• >egation is difficult.
• /ymbols are still ungrounded. 4hinese room problem
• ?eally big nets start to break down.
How do !emantic 2ets Relate to *+pert !ystems
• 4an you implement a semantic net with a ?ule 5ased /ystemL
• &f course. BowL
• Try to write an ?5/ that shows you all of the arcs of a system.
• Try to write an ?5/ that returns all properties of an instance (implement inheritence)
• Try to write an ?5/ that tells you all the colours a certain category can take.
• +/s can take ad%antage of a /emantic >et to usefully represent knowledge. (A big +/ might do this.)
• +/s are about process and /emantic >ets are about ?epresentation
• Bow do /emantic >ets relate to working memory and logicL
• Bow do /emantic >ets relate to case based reasoning.
-ood Rule Based !ystems
• What are rule based systems good forL
• Things that can be described by rules
• Things that use deri%ed knowledge
• What elseL
• Would semantic nets help a rule based systemL !ou bet.
• Bere are some ideas for rule based systems water analysis# tic-tac-toe# natural language parsing# natural language
generation# goal directed beha%ior# system configuration# and animal classification.
• What primiti%es do you need to programL
o Qariables and assignment
o branching (ifCs)
o goto (loops or function calls)
• With these primiti%es# you can program anything.
• ?ule based systems ha%e all of these things# so you can program anything with them
• Aoreo%er# you now know how to do all of these thigns.
• Bow would you write rules that print out the numbers one to ten# . timesL
• Bow would you write rules to calculate the a%erage of . user inputsL
• To a%erage an unlimited number of inputsL
• /emantic nets are about concepts (nodes) and their associations (arcs).
• Thus they are associati%e memory.
• They are a concise way of representing information# and inheritence is clearly useful as the software engineers
ha%e taken it o%er.
• ?ule based systems can implement /emantic >ets# but a lot of other types of systems can take ad%antage of them.
• 'o we represent concepts this wayL Try the "8 $uestions game.
• 'raw a semantic net for Telephones
• I need coursework proposals by next week.
• ?ead section 0." and 0.* (. pages)
&ast Week
• Iast week we talked about /emantic >ets.
• Any $uestions about them.
• ?emember nodes represent concepts# and arcs represent relations
• Is-A (Inheritence) is a particularly important relation and gi%e representational economy.
• /emantic nets are a good representational format for declarati%e knowledge.
• 4an you make a semantic net for booksL
What are Rule Based !ystems good for<
• !ou answerN
• Hood for a system that can be described by rules
• Hood for a system with some complexity (deri%ed knowledge)
• >ot good for a system that canCt be described by rules
• What kinds of tasks fall in this categoryL
o =lanning (Aolgen chemical synthesis)
o 'iagnosis (Aycin)
o Intepretation (=rospector mineral deposits)
o Aonitoring (>a%ex /pace /huttle)
o 4onfiguration (?"EM4on)
o InstructionEIntelligent Tutoring /ystems(/ophie power pack repair)
o =rediction (=lant crop damage)
o 'ebugging (4ooker Ad%isor can souped steriliOer)
o 4ontrol (Qentilator Aanagement Assistant E Aini=harm)
4iagnosing with Mycin 5=>?"7
• =urpose to assist a physician# who was not an expert in the field of antibiotics# with the diagnosis @ treatment of
blood disorders (and in particular to establish whether the patient was suffering from a serious infection like
• Input symptoms @ test results
• &utput a diagnosis# accompanied by a degree of certainty# @ recommended therapy
• Knowledge representation production rules (and simpler data structures)
• Inference engine Aixed chaining# but principally backward chaining from a top goal that diagnosis @ therapy is
needed. ?ules are found to satisfy conditions of this rule# then further rules to satisfy these. +%idence may be
sought from the user.
• A successful (and enormously influential) expert system
o did a complex task. performed well tested against medical students# non-specialist doctors and blood
infection specialists# it did better than the former two groups and e$ualled the latter group.
o but note that A!4I> was 1ust a laboratory demonstration - it was ne%er marketed# or installed in a
hospital and used for routine work.
• These notes are from <ohnCs slides. Be has a much more thorough example.
• Write down some diagnostic problems that ?5/s could be used for.
• 4an you think of some diagnostic problems ?5/s couldnCt be used forL
)rescription with %rop .dvisor 5=>@>7
• 'e%eloped by I4I (in "636) to ad%ise cereal grain farmers on appropriate fertilisers and pesticides for their farms.
• The choice of chemical# amount# and time of application depends on such factors as crop to be grown# pre%ious
cropping# soil condition# acidity of soil# and weather.
• Jarmers can access the system %ia the internet.
• Hi%en rele%ant data# the system produces %arious financial return pro1ections for different application rates of
different chemicals.
• The system uses statistical reasoning to come to these conclusions.
• If the $uestion asked is outside the systemCs expertise# it refers the caller to a human expert.
• What about statisticsL
• Bow would it know it was outside itCs expertise
• The chief ad%antages of this system ha%e been
o that employees at I4I ha%e been relie%ed of the need to pro%ide lengthy telephone ad%ice sessions#
o and the $uality of the ad%ice has become much more uniform# which has increased confidence in the
companyCs products.
• What other perscription tasks could ?5/s be used forL
• >ote that my original list of tasks didnCt include perscription. Is my list exhausti%eL What other things could ?5/s
be used forL
%onfiguration with R=AB%on 5=>?@7
• Knowledge domain 4onfiguring QAM computers# to customersC specifications.
• Input ?e$uired characteristics of the computer system.
• &utput /pecification for the computer system.
• Inference engine Jorward chaining the output specification was assembled in working memory.
• Knowledge representation =roduction rules.
• '+4 attempted to write a con%entional program to do this task# with no success# then in%ited Ac'ermott to write
an AI system to do it. Ac'ermott wrote ?"EM4&>. 5y "630# it had processed 38#888 orders# and achie%ed 6.-
63: accuracy. It was reckoned to be sa%ing '+4 V*.A a year.
• ?"EM4&> suffered from the shortcomings of simple production-rule-based systems.+xpensi%e rewriting was
needed to restore the operation of the system
• What other configuration tasks could ?5/s be used forL
'ptimum-.1 and )lanning
• &=TIA7A-AIQ is a planner used by the +uropean /pace Agency ("66-) to help in the assembly# integration# and
%erification of spacecraft.
• It generates plans# and monitors their execution.
• 7nlike a con%entional scheduling tool# it has a knowledgebase which describes the underlying causal links that
dictate that the assembly must be undertaken in a particular order.
• Therefore# if a plan fails and has to be repaired# the system can make intelligent decisions about which alternati%e
plans will work and which will not.
• It can engage in hierarchical planning - this in%ol%es producing a top-le%el plan with %ery little detail# and then
turning this into increasingly more detailed lower-le%el plans.
• It can reason about complex conditions# time# and resources (such as budget constraints).
• What other planning tasks could ?5/s be used forL
• What planning tasks are ?5/s not good forL
'ther !ystems
• Hi%e examples of problems that ?5/s might be used for in
• Intepretation (=rospector mineral deposits)
• Aonitoring (>a%ex /pace /huttle)
• InstructionEIntelligent Tutoring /ystems(/ophie power pack repair)
• =rediction (=lant crop damage)
• 'ebugging (4ooker Ad%isor can souped steriliOer)
• 4ontrol (Qentilator Aanagement Assistant E Aini=harm)
• /ome researchers (like Aar%in Ainsky) think that the best way to do AI is to de%elop better search techni$ues.
• 4onse$uently# AI has done a lot of research into searching.
• There are exhausi%e methods like depth first search
• There are also heuristic methods. ?ules are good for encoding search heuristics.
• /earch is essentially mo%ing about looking for the answer.
• That is# the system mo%es about looking for the answer.
• A robot can mo%e about# but in general most AI systems donCt.
• &ne easy way to look at this problem is a system that mo%es around in a %irtual world.
!earching 3hrough MaCes
• This is a maOe (the one used for lab 0).
• Bow could you write a system that mo%ed around the maOe starting at / and finishing at the Hoal (H).
• Jirst of all youCd ha%e to be able to represent the maOe. Bow might you do thatL
• !ou could represent each 1unction by a number or an (M !) pair.
• /o# the start would be at (, ,)# and the goal at (" "). !ou could also represent the connections %ia two M# ! pairsD
so the system can go directly from (, ,) to (* ,).
• What would a rule to mo%e likeL
• In this case# you could represent all the reasonable mo%es as a Tree.
!tack and Backing /p
• Bow would you search this treeL
• It turns out there is a good exhausti%e method in this case called depth first search.
• The idea is you go to the end (deep)# if that fails# backup and try another path.
• !ou can implement this with a stack.
• A stack is also known as a Iast In Jirst &ut (IIJ&) /tructure.
• ItCs like a stack of plates. !ou put plate A on# then plate 5# then 4. The first one you take out is 4# then 5# then A.
• 'epth first search works the same way.
• !ou start at /# choose a path# and stack the other option.
• !ou repeat this from each position.
• When you get to the end (say " ,)# the stack has (* *) on top of (- ,). !ou pop the stack and mo%e to that place.
• This way you will e%entually find an answer (if there is one) for any tree.
• >ote that by con%erting it to a tree I remo%e the possibility of going back and forth from one spot to another.
• If you think about it# searching for a path# is really 1ust planning a path.
• With the maOe# you can remember where youC%e gone (forget the backtracking).
• When youC%e got a plan from the start to the goal# 1ust print it out.
• &ne cool thing is that it works for more than 1ust physical mo%ement.
• !ou can also use it for state space search.
• Imagine searching for recipe like Aolgen and 4hemical synthesis# or making an assembly plan like &ptimum-
• This is really 1ust searching in a non-physical domain.
• With chemical synthesis# you can mo%e from one state to another by adding new chemicals# applying heat#
applying pressure# etc.
• This is 1ust searching a synthesis tree.
• ?ule 5ased /ystems can be used for a wide range of tasks.
• Type of chaining is an essential decision in designing an ?5/.
• Interaction with the user is also important.
• A good ?5/ uses deri%ed knowledge.
• ?ead chapter , (*8 pages)
&ast Week
• Iast week we co%ered backward chaining# decision trees# and and-or trees.
• 5ackward chaining is largely about goal directed beha%iour. UuestionsL
• And-&r trees are structures that can be used to describe backward chaining systems.
• Any $uestions on and-or trees.
• Any $uestions about the course work.
• The main idea of case based reasoning is $uite different than rule based systems
• The system has a large number of cases (a case base).
• When the system is presented with a new case# it finds an existing one that is similar.
• The action that is suggested is the action that was done on the retrie%ed (similar) case.
• &f course the cases ha%e to be described some way.
• It is usually done by a list of input feature %alue pairs# and an ouput action
• Bow do you calculate similarityL (WeCll do this in a bit.)
• Bow do you describe the casesL
• The real work in actually implementing a 45? system is figuring out a good way to describe the cases.
• Typically you pick a set of features and describe their possible %alues.
• This is $uite similar to defining working memory in a rule based system.
• Bowe%er the %alues you allow are important in calculating similarity.
• !ou need to select the rele%ant features.
• 'o all features need to be e$ually rele%antL
&oan %BR *+ample 0eatures
• !ou can use 45? for determining whether someone gets a bank loan.
• What is the outputL
• If they get the loan or not. !ou can add a "maybe" option too.
• What are the input featuresL
• IetCs keep it simple for now# income# expenses and assets.
• Bow do you represent these %aluesL
• What other features are thereL
• Iets ha%e three existing cases
>ame Income +xpenses Assets ?esult
4hris *.888 *8888 .8888 !es
=at *.888 *.888 .8888 >o
/andy .8888 -.888 -*.888 >o
• Ael wants to take out a loan (e%eryone asks for "8888)# and makes ,.888 per year spend *.888 and has "8888 in
assets. /hould Ael get a loan.
• !ou need to compare to the others. Bow do you compareL Which is Ael closest to.
• Ael shares one feature exactly with =at# so is that closestL
• Aeasuring similarity is really important.
• Bere you might ha%e a complex way of comparing# get total surplus multiply that by .# and add to assests.
• /o Ael is 08888# 4hris is 2.888# =at .8888 and /andy 8
• Which is Ael nearest to. Bere you could say =at(>o)# but you could also say 4hris(!es) or Aaybe because itCs
between a >o and !es
• In this case weC%e taken all the features and combined them to get one %alue. !ou canCt always do this and itCs not
always wise.
4istance as !imilarity
• Another simple way to gauge similarity is distance.
• ItCs easy to see how this would work in two dimensions.
• =lot both points# and see which is closest.
• In two dimension# distance is s$uare-root(s$uare(x8-x")Ts$uare(y8-y"))
• !ou want to pick the smallest distance (the closest)
• If you want to make one feature more important# 1ust multiply it by a constant greater than ".
• 'istance in two dimensions translates to > dimensions. /o you can do it with . dimensions if you want to.
• In general the form is s$uare-root(s$uare(x8-x")Ts$uare(y8-y")T....s$uare(n8-n"))
&oan *+ample )art "
• >ow we can compare the three-tuples using distance
• 4hris %s. Ael R s$uare-root(s$uare(*.888-,.888)Ts$uare(*8888-*.888)T s$uare(.8888-"8888)) R
• s$uare-root(s$uare(-"8888)Ts$uare(-.888)T s$uare(-8888)R
• s$uare-root("88#888#888 T *.#888#888 T "#088#888#888)R
• s$uare-root("#2*.#888#888)R-"#.,,
• I could make the others more important by di%iding assets by - making s$uare-root(.*.#888#888)R**6"*
• If you add the feature married# single# and couple# how do you compare the featuresL
%BR *+ercise
• The Aay *88- +xam (like all of the exams) had a $uestion on 45? systems.
• a) A case based expert system has been designed to select the correct shrub for a garden. The system starts with
four cases. The first case is a .x"8 meter garden# with , other shrubsD the correct shrub to add to this is a <apanese
Aaple. The second case is a "8x"8 meter garden with no other shrubsD the correct shrub to add is a Iilac. The third
case is a 6x6 meter garden with . other shrubsD the correct shrub to add is a rose bush. The fourth case is a .x.
meter garden with * other shrubsD and you should not add another shrub. Bow do you represent the casesL
• b) 7sing a straight-forward distance metric# calculate which shrub to use for a garden that is 2x2 and has no
shrubs. Hi%e your distances.
• c) The system chooses a <apanese maple for a 3x". garden with "* shrubs. A human expert says that the correct
answer is no shrub. 'iscuss different ways to modify your system to account for this# and compare the different
• &ne key area of AI is categorisation. Bow do you group things togetherL
• The similarity problem is a categorisation problem.
• The distance measurement is one way to categorise# but there are lots of other methods.
• >eural >ets# Henetic Algorithms# ?ule 5ased /ystems and of course statistics can all be used.
• What should a good similarity metric doL
Modifying Result
• &nce youC%e retrie%ed a similar case# you may want to modify it.
• This gi%es the system flexibility
• /o# I ha%e a case that I donCt know the answer to
• I compare it to cases (that I do know the answer to) in the case base
• &ne case from the case base is retrie%ed along with its solution
• The retrie%ed solution can be slightly modified to fit the $ueried case
• In the Ioan example# the amount of the loan may be changed
• <ust like any other software system# 45? systems need to be maintained.
• The addition of new cases is an ob%ious way to impro%e the system.
• Bowe%er# care is needed that the underlying cases are not changed o%er time.
• A loan from "688 is really $uite different than one from *888.
• Additionally# changing the similarity metric may also %astly change the performance of the system.
• 5ad results can be fixed by modifying the similarity metric or modifying the case base.
• What happens if the case base has a bad answer in itL There is no reason that it cannot be remo%ed.
• Another important techni$ue is to keep a series of tests around. These are separate from the case base but can be
used to test the performance of the system.
• >ame examples of domains where you can use 45?.
• The key task in de%eloping a 45? system is to find a way to represent the cases.
• The second key is to de%elop a good similarity metric.
• A good similarity metric categorises new cases correctly.
• ?emember that you need to ha%e a good feature set before you can get a good similarity metric.
• ?ead chapter ** ("2 pp.)
&ast Week
• Any $uestions about the course workL
• Any $uestions about 45?L
• With 45? we talked about cases# features# and the distance measurement for finding similar cases
• The distance measurement can also be used for categorisation
• We talked about categorisation as a broad class of problems
• Any $uestions on categorisationL
!oyabean *+ample
• To refresh your memory here is an example
• /uppose that we ha%e a sick soyabean plant# and we wish to disco%er which of a number of known specimens of
sick soyabean plants it is most like.
• 4hoose (letCs say) three characteristics of the lea%es that can be represented as numbers
". Amount of the leaf that is co%ered by the discolouration
*. Iightness of the discoloured parts of the leaf
,. Iightness of the remaining parts of the leaf
• /uppose that the first two cases to be matched are
case " co%erage - 3 lightnessA - - lightness5 - 0
case * co%erage - "8 lightnessA - 2 lightness5 - 0
• Adding a third case (*# ,# 6)
• Which is more similarL
• To find out whether case " is more similar to case * or to case ,# you simply calculate the two distances# and pick
the smaller of the two.
• >ow can you think of any other 45? examples
• What would 45? be good forL
.ppropriate 4omains
45? is suitable
• when the domain is broad but shallow.
• when experience rather than theory is the primary source of information.
• when the re$uirement is for the best a%ailable solution# rather than a guaranteed exact solution.
• when solutions are reusable# rather than uni$ue to each situation.
Helpdesk *+ample
• the 4&A=AU /AA?T system.
• The problem was that
• Thousands of customers were calling 4ompa$ directly e%ery day# re$uesting support.
• Aany of the staff were newD there was a ma1or training problem.
• There was a need for consistent @ accurate answers and responses
• There was a need for retention of corporate knowledge.
• The 4&A=AU /AA?T system# once de%eloped and installed# succeeded in sol%ing 3.-6.: of calls.
• Typical time to sol%e a problem was less than * minutes.
.dvantages of %BR
• 4ase-based reasoning
o tends to focus on the problemCs essential features.
o can sol%e problems in domains that are only partially understood.
o can pro%ide solutions when no algorithmic method is a%ailable.
o can interpret open-ended and ill-defined concepts.
!teps for building %BR systems
". &btain data for cases.
*. 'esign cases based on data.
,. 'etermine the case memory structure.
-. 'ecide the case retrie%al method.
.. 'ecide whether a case adaptation procedure is appropriate (and# if so# implement it).
0. 'e%elop the rest of the system (e.g. the user interface).
*ngineering %BR systems
• "Jixing" inconsistencies between diagnosis and symptoms. Techni$ues
o the end user does it
o knowledge-based ($ualitati%e reasoning# etc)
o a fixed procedure
• =roblem about updating the case-base with adapted cases
o /ince the new case isnCt exactly like any of the cases in the case-base# it canCt really be said to ha%e been
sol%ed by the expert 1udgement that was used to build the case-base in the first place.
o There is a real chance that the conclusion that the system came to is wrong in this case
o If wrongly concluded cases are added to the case-base# it becomes progressi%ely degraded
o Typically# the procedure is to put fresh cases into a special file# and ha%e the 'omain +xpert pass
1udgement on them before they are added to the case-base.
%assiopee *+ample
• 7sed a combination of inducti%e and 45? techni$ues.
• Written using KAT+-45?# by Ackno/oft of =aris# on behalf of an engineering firm owned by Heneral +lectric
and />+4AA.
• A diagnostic system for aircraft engines 4JA .0-, engines in 5oeing 2,2s and Airbus A,-8s.
• The cases came from a legacy database of *,888 engine maintenance reports# built up o%er 3 years.
• +xperienced engineers worked o%er the cases# eliminating items where there was no diagnosis or mis-diagnosis#
and duplicates.
• This left "0888 cases# each with up to "88 features
• 4ase selection was by a decision tree# generated from the cases.
• This directed the $uestioning of the user# to pro%ide a set of symptoms# to select cases.
• Integrated with an Illustrated =art 4atalogue
• Henerates reports of reliability and maintainability using +M4+I
• 7ses e-mail to collect maintenance reports world-wide.
• Qery fast diagnosis reduced diagnosis time by .8:
• Won "st priOe for inno%ati%e software applications at the +uropean M=/ show# Hermany# Aarch "66..
Hybrid !ystems
• 4an you combine AI techni$uesL
• 4ould you use a rule based system along with a 45? to sol%e a problemL
• &f course you can integrate knowledge representation schemes.
• Why would you build a hybrid systemL
• What about combining with other systems like >eural >ets or Henetic AlgorithmsL
• ?ule based systems# 45?s# /emantic >ets# Iogic and Jrames are all base components.
• They can be combined.
• +xercise In groups of -# discuss how you would make a 45? system to identify plantsL
• =art * discuss how you would combine a semantic net with a 45? system to identify plantsL
)rogramming %BR !ystems in %aspian
• !ou should ha%e now done one (and maybe two) lab in 4aspian.
• 'o you ha%e any $uestions about how it worksL
• !ou can use a 45? system for your coursework.
• It should be relati%ely simple to get a passing mark. (=robably as simple as getting a passing mark in 4lips.)
• To get a really good mark# youCll need to do something useful.
• 45? systems are not Turing 4omplete and are therefore can not be used to sol%e as many problems as ?ule 5ased
• !ou can impro%e it by doing case adaption
• !ou can also get points for explaining and defending your matching algorithm.
• Bow do 45? systems compare to ?5/sL
• Which are easier to de%elopL AaintainL
• 45? systems are good for broad shallow domains
&ast Week
• 45? systems are good for domains where information comes from examples and there is not much theory.
• There are other similarity measurements aside from distance.
• 45? systems are defined by cases (consisting of features)# and a distance measurement. !ou can also modify
• 45? systems# unlike rule based systems# are not Turing complete.
• /ince ?5 systems are more powerful# what are they particularly good forL
,nowledge *ngineering
• Knowledge +ngineering is about designing# building# installing and maintaining knowledge based systems.
• It is one place where AI meets /oftware +ngineering.
• /o far in this module# weC%e discussed ?ule 5ased /ystems# Iogic# case based reasoning and semantic nets.
• We will discuss some other Knowledge ?epresentation mechanisms.
• The process for +ngineering these systems is different than traditional programs largely because they are more
• Also they are more knowledge dependent and thus more domain dependent.
• With traditional software it is often not clear what the user wants or needs. It is usually e%en less clear with
knowledge based systems.
,nowledge !ources
• When de%eloping software you need to figure out what the user needs.
• With knowledge based systems you also need to figure out what the user knows because your going to encode that
knowledge in your system.
• Where can you get knowledge about a problemL
• Text books# reports# 1ournal articles# case histories.
• 'atabases (datamining)
• Bowe%er# for real systems (particularly +/s) these sources do not pro%ide deep knowledge.
• Jor that you need Buman +xperts.
nterviewing *+perts
• To get knowledge about a domain# you usually need to ask an expert.
• Bowe%er# the expert doesnCt usually ha%e that knowledge around in a way you can use it.
• 4ompiled Knowledge =roblem The experts knowledge is hidden in them.
• /ometimes it is $uite accessible# and they can gi%e you rules for the domain.
• /ometimes they know the rules# but canCt %oice them well.
• /ometimes they donCt e%en know about the knowledge they ha%e (e.g. cheese expert).
• Inter%iew Techni$ues
". 7nstructured Inter%iew
*. /tructured Inter%iew
,. =roblem /ol%ing Inter%iew
-. Think aloud inter%iew
.. >on-Inter%iew techni$ues like a $uestionairre or ha%ing the 'omain expert make a presentation.
• Always record the inter%iew (at least take notes).
• !ou want to get at their knowledge any way you can.
Representing the *+pert;s ,nowledge
• !ou need to represent this domain appropriately
• There are a host of decisions to be made.
• 4an you use a ?ule 5ased /ystem# or is another system (e.g. 45?# >>) better.
• Is a knowledge based system e%en feasibleL
• /hould you ha%e some sort of intermediate representation (e.g. andEor tree)L This can help you figure things out#
and can be used to help others understand the system.
• Traditional knowledge representation $uestions are also reasonable. /hould you use a semantic net# or something
else (e.g. frames# logic)L
• What type of ob1ects (WA) are you going to ha%eL
• If youCre using a ?ule 5ased /ystem# what kind of chaining are you going to useL
,nowledge Based !ystem *ngineering
• Iike most /oftware +ngineering# Knowledge 5ased /ystem +ngineering is usually a cyclic process.
• All of these processes should happen# and many of them will happen multiple times.
• Knowledge Ac$uisition
• Knowledge Analysis and ?epresentation
• Knowledge Qalidation
• Inference 'esign
• +xplanation and <ustification
• Testing
• Aaintenance
,nowledge and !ystem 1alidation
• =art of the ongoing process is testing.
• !ou ha%e to assure that two things are right# the knowledge and the system.
• The knowledge you get from an expert may not be right.
• !ou may translate it incorrectly or they may gi%e it to you incorrectly.
• !ou can compare with the expert (ask them# inter%iew them)# and you can compare with other epxerts.
• &f course you need to %alidate the system too. !ou need to check with experts and users.
&earning !ystems
• Another way to get the knowledge is to use an AI program that automatically learns the knowledge.
• A neural net is a system that can be used to automatically learn knowledge.
• Jeed forward nets learn functions from inputs to outputs by training on existing data.
• There are also symbolic knowledge ac$uisition systems. This is called machine learning.
• Aachine learning can be used when there are no experts# or expertise is expensi%e.
• This machine learning is almost the same thing as data mining.
• 4urrently# an expert is better in almost all things than a machine learning system.
%omputer .ssisted &earning
• While machine learning is generally not as good as human learning# combining the two can be %ery useful.
• This is intimately related to 'ecision /upport /ystems.
• A good example is some of 'oug IenatCs system.
• Be had a system to play the game tra%eller. It automatically generated rules that it felt were good. Be would then
look at the rules and further explore the ones he thought were good.
• Be and his system won the competition twice# and they banned computers from it.
• ?oughly# you can use computers to come up with lots of possible answers. !ou can then explore the ones you
think are good.
• In class exercise# should we build a system to teach 5I/ *8-8L
-oal 4irected Behaviour
• A lot of animal beha%iour is goal directed.
• In particular# a lot of human beha%iour is goal directed.
• I say I want to achie%e something# like get a coffee# and then I set about finding ways to achie%e it.
• Imagine a rule base which enabled you to achie%e the goal# but still needed extra information (facts)
• The system could ask the user (not the de%eloper) for the information it needed
• >ow instead of asking all the possible information for all beha%iours# ICd only ha%e to ask the information for one
method for achie%ing my goal.
• An easy way to look at one iteration is what rules can be applied to fulfill my goal<
• Try to apply one of them.
• If you canCt apply one (because you donCt ha%e the facts)# try to deri%e the facts.
Backward %haining
• 5ackward 4haining means chaining back from the goal# to apply rules that meet the goal.
• As with Jorward 4haining there are rules and WA.
• Bowe%er there is also a goal stack.
• /o gi%en the rules
• if (ha%e money) and (at coffee-shop) then (lose 2.p) and (ha%e coffee)
• if (ha%e water) and (ha%e ground coffee) and (ha%e cofee-machine) then (ha%e coffee)
• if (at office) and (can walk) then (at coffee-shop)
• if WA R (ha%e money) and (at coffee-shop)
• set the goal# then apply the first rule
• if WA R (ha%e money) and (at office) and (can walk)
• set the goal (ha%e coffee)
• try to apply the first rule
• add (at coffee-shop) to stack
• apply third rule# and pop the stack
• apply first rule and achie%e the ultimate goal
• In class exercise
1. /imulate a run of this system forward
2. What data items do you needL
3. /imulate a run of this system backward
4. What data items are you prompted for
Backward %haining "
• /tacks. 'o you understand stacksL
• What happens if you choose rule * firstL
• What happens if you canCt achie%e a sub-goalL
• 5acktracking go back to an early state and try a different branch
• 4lips doesnCt enable backward chaining by default. IC%e got a limited amount of Uuestion 'ri%en 5ackward
chaining working and we will do it in the lab.
• !ou can also ha%e multiple goals added to the stack from one goal rule.
• What would happen if there were nothing in WA and you wanted coffeeL
When to /se 0orward and Backward %haining
• 3he problem being solved tells you which is bestD
• Jorward is best if
o There is no ob%ious goal to set
o All of the data is already there
o There are many possible goals and a small number of patterns
o tends to be better for small systems
• 5ackward is best if
o 'ata is expensi%e
o +xplanation is important
o There is a lot of possible data and a lot of goals

o It tends to be better for medium siOed systems
• In class box-world exercise
• !ou ha%e * boxes name A and 5. A is on-top of 5.
• What does WA look likeL
• What do rules look likeL
• The goal is to ha%e 5 on-top of A.
• Bow does the goal stack change# and when are rules appliedL
• /tate space and fan out and fan in (section *.")
.nd 'r 3rees
• And &r Trees can be used for =roblem 'ecomposition
• >odes are goals
• >odes are connected by lines (ors)# or by lines tied together (ands)
• Ieaf nodes are facts that are not deri%able by the system
• A rule is the if part below (anded together) with the conclusion on top.
• 4offee +xample as a tree
• /ubgoals that both need to be sol%ed are anded together
• /ubgoals either of which can be sol%ed are ored
.nd 'r 3rees for *+pert !ystems
• 7se And &r trees for subgoals
• To achie%e M# you ha%e to do A# 5# and 4
• To achie%e A# you ha%e to do I# < or K
• of course you may ha%e to do (I and <) or K
• /o you can describe your +/ using an And-&r tree
• 4offee example
o The root is ha%e coffee
o The subgoals are# (buy it) or (make it) or (get someone else to get it)
o To (buy it) you ha%e to (ha%e money) and (be at shop)
o What does this tree look likeL
• +xpand the tree.
• !ou can use an and-or tree for other things# but generally it works well with goals
• And-or trees are a good descripiton of backward chaining systems.
• Knowledge +ngineering is the entire process of building knowledge based systems.
• It is essential to get domain expertise.
• A good place to get this expertise is from a domain expert.
• It is still software engineering# so a pro1ect life cycle is ine%itable.
• Automated learning techni$ues can be useful in ac$uiring domain knowledge.
• Jor next week# read section "8."# "8.,." and "8.,.*.
&ast Week
• Iast class we did Knowledge +ngineering
• 'omain expertise is essential
• With K5 systems there is still a pro1ect life cycle though it is somewhat altered
• Inter%iewing experts is useful
• !ou can ac$uire knowledge %ia machine learning
• Bas anyone made progress on their courseworkL
• Are there any $uestions on itL
• Jrames are collections of slots or features.
• ?ecords in =ascal and other languages are Jrames.
• In <a%a ob1ects with no methods are Jrames.
• Jrames (and these other things) agregate features together.
• They bind useful things together so the package (ob1ect) can be thought of independently.
• /entences can be described by Jrames. /o the name of the frame is the %erb# and all of the other >oun =hrases and
=repositional =hrases are slots or features.
• /andy hit =at with the ball. -P
Actor /andy
&b1ect =at
Instrument 5all
• Jrames can be used for 'efault reasoning.
• The sentence might be /andy ate. which is represented by the frame
Actor /andy
• What did /andy eatL What did he eat withL The default eat frame could answer this
&b1ect Jood
Instrument Knife and Jork
• 4ombining the two gi%es
Actor /andy
&b1ect Jood
Instrument Knife and Jork
• The default can be o%erriden when you ha%e a sentence like /andy ate dirt# you get
Actor /andy
&b1ect dirt
Instrument Knife and Jork
• This is similar to the /cript concept de%eloped by# among others# /chank.
• /cripts are about longer stories# for example the restaturant script or the birthday party script.
0rames and !emantic 2ets
• &f course you can put these Qerb Jrames (or other Jrames) into a hierarchical relation like a /emantic >et.
• ?un isa Ao%ement-onJoot isa Ao%ement
• !ou can also use a semantic net for slots.
• /o# in the eat frame# the default (food) could be an entry into a semantic net.
• !ou can combine the two.
• !ou ha%e eat-chinese-food isa eat-food.
• What would the frame for eat-chinese-food look likeL
-enerality and !ubsumption
• Inheritence is intimately related to generality and subsumption.
• The eat frame is more general than the eat-chinese frame. WhyL
• There are fewer constraints on it. +at-chinese is still an eat# but there are eats that are not eat-chinese (e.g. eat-
• +at subsumes eat-chinese.
• What are the constraints on eat-chinese that are not on eatL
• Bow do defaults effect this subsumptionL 4an you eat-chinese with a forkL
• What about things that break the essential character of an ob1ectL +.g. toy-dog and dogL Is there an example for
• An expert is an experienced practitioner in hisEher particular field.
• Aore than that# heEshe is a highly effecti%e problem-sol%er and decision-taker in that field.
• +xperts ha%e three $ualities
". They make good decisions
*. They make those decisions $uickly
,. They are able to cope with a wide range of problems.
• As a result# they are %aluable# highly-paid# and tend to be o%erworked.
• >ote also that an expert can usually explain and 1ustify their decisions.
• A human expert can update their knowledge in the light of common sense# knowledge deri%ed from other
domains# and contacts with other experts. An expert system canCt.
What 3asks are *+pert !ystems -ood 0or
4eep %ognitive !kills Eudgemenatal !kills High-level !ocial !kills
Highly %reative Ausician /enior Aanager Author or =oet
.nalytical Aathematician +conomist or =rogrammer /ocial /cientist
!trictly )rocedural Typist 'ri%er /ocial Worker
• +/s are good for domains that are analytical and 1udgemental.
• A rather simpler approach to answering the $uestion which domains are worth building into an expert systemL
• Any problem that can be and fre$uently is sol%ed by your in-house expert in a "8-,8 minute phone call can be
automated as an expert system.
• 4an you name some analytical and 1udgemental domainsL
• 4an you name some tasks that are sol%ed with a "8-,8 minute phone callL
• Why do these two heuristics workL
• The housing department in a pro%incial +nglish town is o%erworked# although the staff turno%er is $uite low.
Auch of the work the staff do in%ol%es inter%iewing clients# and there is a clear pattern of $uestioning (which
%aries to a limited degree# depending on the circumstances of the client). It is proposed to build an expert system#
which will direct the $uestioning process.
• Is this a good domain for an +/L Why or Why >otL 'iscuss in groups of -.
4erived ,nowledge
• In ?ule based systems# deri%ed knowledge is knowledge that the user neither puts directly into the system# or
recie%es from the system# but the system uses.
• =ragmatically# a WA item that is on the then side of one rule and the if side of another is deri%ed.
• Why is deri%ed knowledge importantL It shows that the system is doing more reasoning. It shows that it is a
deeper system.
• What is an example of deri%ed knowledgeL
• In noughts and crosses# knowledge that the opponent has two in a row is deri%ed from the board.
• In the second lab# if A then 5# if 5 then 4# 5 is deri%ed knowledge.
• If youCre doing a ?5/ for your coursework# youCll need deri%ed knowledge to get a first or upper second# and it
probably would help for lower second.
• What would be an example of deri%ed knowledge in your domainsL
• In class work write a rule that determines that MCs ha%e two in a row. Write a rule that uses that fact.
• Jrames are structures.
• They can easily be used for default reasoning.
• They can easily be combined with semantic nets.
• An expert is a highly effecti%e problem sol%er.
• +xpert /ystems are only good for some tasks.
• Jor next week# read 0., for Jrames (and semantic nets).
• ?e%iew sections "." and ".* for expertise.
&ast Week
• ?eading on 'ecision Trees pp ,68-,6*
• Iast week we co%ered Jrames and /cripts# and +xpertise.
• Jrames are structures and can easily be used for default reasoning. UuestionsL
• +xperts in a domain are highly effecti%e problem sol%ers in that domain.
• Any $uestions on expertise.
• Any $uestions about the course work.
!earch !paces
• Another important concept in determining how to sol%e a problem is the concept of search space (or a problem
• !ou can figure out the siOe of your problem (siOe of the search space) by figuring out how many states your
system can be in.
• /ol%ing the problem is then done by changing the state to get to a good state or e%en the best state.
• Two particularly important states are the start and final states.
• What is the siOe of the search space for tic-tac-toeL (S 6N)
• Bow do you mo%e from one state to another in tic-tac-toeL
• What is the siOe of chess space (S 0-N)L
• 4an you do exhausti%e search in tic-tac-toeL 4hessL
• If youC%e refined your problem into a search space# all you need to do is search.
• Aar%in Ainsky# one of the four fathers of AI# thinks that the key to sol%ing AI is finding a better search method.
• 4ertain search techni$ues are appropriate for certain spaces.
• &ne type of search techni$ue is called exhausti%e search. +xamples of this are depth first search and breadth first
• /ubgoaling (backward chaining) is a type of depth first search.
• When might this not be appropriateL (A state space with loops.)
• Another type of domain specific search is heuristic search. Aany rule based systems are simply this.
• &ther types of search are hill climbing# simulated annealing# minimax (for game playing)# A;# and for that matter
genetic algorithms and multi-layer perceptrons.
• A related idea is the %alue of a state. If you canCt do exhausti%e search# and each state# you might be able to search
by mo%ing from the current state to the best next state. !ou can ha%e some look-ahead.
• What would be the %alue of the state of a chess gameL
• Bow would you describe a stock portfolio with search spaces and %alues.
• With a 45? system# the siOe of the space is all possible cases.
• !ou sol%e a problem by retrie%ing a case# where you know the answer# that is close in the search space.
• ItCs important that closeness is rele%ant to the solution.
• What would happen if closeness werenCt rele%antL
• Also +/s are good for problems with medium siOe search spaces
• The shape of the search space is important in choosing the chaining mechanism for ?5/.
• The number of possible states in each step can grow or shrink. If it grows# thereCs fan out# and if it shrinks thereCs
fan in.
• If thereCs fan in# youCre going to ha%e to choose between a small number of final states# so you want forward
• If thereCs fan out# youCre going to ha%e to choose between a large number of final states# so you want backward
chaining to# in essence# start at the goal final state and work backward.
• !ou can also interlea%e chaining (do some forward and some backward chaining) to reduce the number of
!ymbolic )rogramming
• The ma1or learning outcomes for this module re%ol%e around /ymbolic =rogramming
o ?ule 5ased /ystems
o 4ase 5ased ?easoning /ystems
• In both types of systems# the primiti%es are symbols.
• WeC%e also called symbols features.
• In ?5/ systems these are the working memory items.
• In 45? systems they are the features that each case is made of.
• ?5/ and 45? systems differ in the way they use these symbols.
• ?5/ systems use rules whose if clause is based on the current state of the symbols (WA)D the then clause may
change the symbols (WA)
• A 45? system compares a new tuple of symbols (a case) with all of the old tuples (the case base) and finds the
one nearest.
• In addition to being able to use these systems# you should know when to use them# and some software engineering
concepts for their de%elopment.
!ymbolic ,nowledge Representation
• A related topic and one that co%ers the rest of the learning outcomes is representing the symbols.
• There are lots of ways of representing symbols and these align with types in programming languages.
• /o# a WA item or a 45? feature might be an enumerated type# an integer# a boolean or a real.
• It might also be an ob1ect.
• We can also use more sophisticated techni$ues like Iogic# /emantic >ets# and Jrames.
• Iogic is about boolean %alues# and simple connecti%es.
• It also takes ad%antage of the (well used) concept of functions. Jor this reason I could ha%e put logic on the prior
• /emantic >ets are about nodes representing concepts and arcs representing relations between concepts.
• I could use a semantic net in a ?5/ by using an isa operation.
• Jor example If (M is red) And (M isa bird) Then (M is cardinal)
• /imilarly# I could use a semantic distance measurement (number of arcs crossed from one node to another) as part
of the similarity metric in a 45? system
• /ymbols are relati%ely easy for computers to work with# but they ha%e some problems. They donCt accurately
represent the world. /o is (Tall 4hris) a true factL That really depends.
• !ou should know when symbols are appropriate and when they are not.
• The shape of the state space is also important for the choice of chaining methods in ?5/s
• Jorward and 5ackward 4haining
• If there is lots of fan in use Jorward 4haining
• Jan in means that lots of initial states lead to one (or a small number of) conclusion
• If you use forward chaining# rule applications will $uickly con%erge to an answer# but backward chaining will
consider a lot of unnecessary subgoals
• If there is lots of fan out use 5ackward 4haining
• Jan out means that there are lots of conclusions.
• &nly use the rules that are appropriate to the goal.
• If it is really big# use interlea%ed chaining intelligently.
• ?educe the number of rules applied by negotiating the search space in a wise way.
• Jor example# imagine a maOe where you start in a room# and each exit leads to a series of doors that gets you out
of the maOe. Jor this any path of rules will get you out# so 1ust use forward chaining.
• Bowe%er# if you need to get to a particular exit you should backward chaining. This way you can a%oid all of the
unnecessary doors.
• 5acktracking
!emantic 2ets
• /emantic >ets represent concepts and relationships between concepts
• They are a graph structure
• 4oncepts are represented by nodes# and relations by arcs
• ItCs all about associations
• When you come up with the slots in a '5 table you specify the important relationships
• These relationships would occur in the /emantic >et# but other less important ones would also occur.
• 'o you remember the "8 $uestion gameL Why did that workL Associations.
• 4an you draw a /emantic >et for the "8 $uestion game we played in classL
!emantic 2etsAnheritence
• !ou can specify lots of different relationships (arcs).
• =robably the most important is Inheritence. WhyL ?epresentational +fficacy.
• Inheritence is the Is-A or subcategorisation arc. A Aammal Is-A animal.
• Inheritence allows default reasoning# but defaults can be explicitly o%erridden
• An instance-of arc is like inheritence# but it canCt be inherited from.
• &b1ect oriented programming uses inheritence for representational efficacy (e.g. <a%a uses inheritence).
• /ee the semantic nets lecture.
• The simplest forms of logic are about true and false# and weCre only handling the simplest forms.
• /ee the logic tables.
• !ou really need to know the connecti%es. TheyCre pretty simple# and I suspect you already know them implicitly if
not explicitly.
• The next step in logic is predicates. These are functions that donCt ha%e any side effects. Again# I expect you
already know these things implicitly if not explicitly.
• !ou can also use %ariables. Instead of using constants# you can use %ariables to refer to sets. +.g. dog(x) refers to
all dogsD itCs like a clips (dog Lx) IB/.
• !ou also need to know how to make +nglish sentences into logic formulas.
• >ow# you all already know this stuff# so why am I e%aluating on it.
• Jirstly# to make sure you do know it.
• /econdly# because it forms the basis of a lot of computer science. (=rolog# functional programming# sets#
theoretical computer science# digital circuit design# e%en /UI)
• /ee the logic lecture.
• /earch /paces. /ection * (chapters ,-0) in >or%ig and ?ussell are on /earching and /paces. 4hapter , is
particularly appropriate (,8 pages.)
• /ome ways to organise the learning outcomes are
• /ymbolic =rogramming %s. symbolic K?
&ast Week
• Iast Week we re%iewed semantic nets and logic. These are both ma1or components of the exam.
• We also talked about unifying themes symbolic programming# symbolic knowledge representation and search
• These are not on the exam# but enable you to relate the ma1or components.
• Are there any $uestionsL
&earning 'utcomes
0rom week one
• +xpert /ystems
o Bow ?ule 5ased /ystems work
o 4ase 5ased ?easoning
o ?ule 5ased /hells
o 'e%eloping +/s
o +xpertise
• Knowledge +ngineering
• /ymbolic Knowledge ?epresentation
o Iogic
o /emantic >ets
o Jrames
• /earch and /earch /paces
*+pert !ystems
• The basic components of ?ule 5ased /ystems are working memory and rules.
• Iess important components are the 7ser Interface# $uestion answering# and de%elopmental facilities like
• 4haining and conflict resolution are important
• +xam Uuestions
• +xplain a series of rules
• 7se an appropriate representation format (e.g. decision trees# and-or-trees) to describe a certain rule set.
• 'e%elop an +/
• What conflict resolution strategy is appropriate in a certain case.
• Bow do rule based systems relate to 45? systemsL
• What are the problems with +/sL Bow can they be sol%edL
• Bow do +/s relateEinfluenceEuse Knowledge ?epresentation formatsL
!oftware *ngineering and *+pert !ystems
• +/s (both ?ule 5ased and 45? systems) need to be de%eloped 1ust like any other software.
• Iike other systems you need to ac$uire the knowledge# design the system# implement it# test it# and maintain it.
• A lot of this is about using the expert appropriately also known as knowledge engineering.
• A key point here is inter%iewing
• +xam Uuestions
• Bow do you de%elop an +/L
• What properties of a problem make it appropriate for an +/L
• What are the key decisions in de%eloping an +/L
• Bow do +/s relate to other types of systemsL
• >ote that +/s could be spoken of either collecti%ely# or as ?ule 5ased /ystems or as 45? systems
• /omeone is an expert in a particular domain.
• +xperts are great problem sol%ers in their domain.
• +xperts ha%e lots of knowledge about their domain.
• /ome domains are inappropriate for +xpert /ystems (e.g. . minute phone con%ersation).
• +xam $uestions
• What makes someone an expertL
• Are you an expert at anythingL
• Bow do different experts in the same domain fit inL
• 4an you make an +/ if you ha%e an expertL
• Bow do you get expertise from an expertL
,nowledge Representation
• A good knowledge representation format is essential for any large (AI) system.
• The next two slides are on semantic nets# logic# and frames.
• and-or trees
• decision trees
• +xam $uestions
• 'esign a decision tree to choose how to cross the street.
• Aake up an and-or tree with "* nodes.
• Bow do decision trees relate to ?ule 5ased /ystems
• And-or trees are readily used to explain the flow of control of a rule based system using a particular type of
chaining. What is that type of chainingL
• What are the fundamental problems of a particular K? mechanismL
• What are the strengths of a particular K? mechanismL
!emantic 2ets
• /emantic nets are nodesEconcepts that are connected by arcs.
• Arcs usually refer to a certain type of relationship
• Inheritence is a particularly important type of arc
• +xam $uestions
• Interpret a semantic net
• 'raw a semantic net for the following problem
• 'raw a semantic net
• What are the important properties of a semantic netL
• Bow could you implement a semantic net in a rule based systemL
• Bow do semantic nets represent knowledgeL
0rames and &ogic
• Jrames (and /cripts) are a mechanism for structuring data
• A good example is the %erb frame.
• +xam Uuestions
• /how me a %erb frame for I like =at
• /how me a frame for an BTAI documentL
• What is the key difference between frames and semantic netsL Bow are they related.
• Iogic has true# and false %alues# connecti%es (implication# and# or# not)# and predicates(functions).
• +xam Uuestions
• 'raw a logical formula for the following statement
• What is the truth %alue of the following statement# or what is the truth table for the following statementL
• Bow is logic similar to rule based systemsL
• Write a function that implements And.
%ase Based Reasoning
• 4ases are represented by a series of features
• The answer is found by comparing a new case to a case in the case base.
• /imilarity is a key to sol%ing the problem.
• The distance measure is a good way of finding similarity# but there are others.
• +xam Uuestions
• Apply a distance measurement to A (gi%en se%eral cases)
• What is the nearest case to A (gi%en se%eral cases)L
• 'e%elop a small 45? systemL
• What similarity metric is good for a certain problemL WhyL
• Bow can I update my case baseL
• Bow are 45? systems likeEunlike rule based systemsL
• What are 45? systems good forL
• Bow can you de%elop a 45? systemL
• Bow do 45? systems take ad%antage of expertsL
!earch !paces
• =roblems can usually be decomposed into a series of states.
• !ou start at the start state and mo%e from state to state to get to the final state.
• The siOe and shape of the space is important.
• +xam Uuestions
• What is the start state in a game of tic-tac-toe
• Bow many states are there in a 45? system that has . features# each with "8 possible %aluesL
• =eform a depth-first search in a tic-tac-toe game with only a *x* board.
• Jirst class marks will be able to answer $uestions combining all of these things.
• /ome nice points to consider are search spaces# symbolic reasoning# and the nature of knowledge. These issues
can help the outcomes cohere.
• Jor 1ust passing# main points
". ?ule 5ased /ystems
*. /emantic >ets
,. 45?
-. Iogic
.. +xpertise
• Ainor points
o /earch /paces
o Jrames
o and-or trees
o decision trees
o software engineering
$xaple %olution 5orat
A&&$M/& A!7 &HR$$ 89$%&IO!%
$ach :uestion carries 2; ar-s
8uestion #
a) Here is a sentence" <If Pat and Terry both want the ball, Terry will get it.” *rite a logic forula and truth table for this sentence.
Logic forula 4 ar-s
8 cell table 3 ar-s
Correct table 3 ar-s
=#1 ar-s>
?/@&A -B )
/ is /at ,ants the ball2 & is &err' ,ants the ball and ) is &err' gets the ball.
/& /-& -/& -/-&
) & & & &
-) 5 & & &
b) Conflict resolution ust usuall' be done for rule-based s'stes. .escribe ,hat conflict resolution is2 and describe t,o
conflict resolution strategies.
Conflict Resolution description 3 ar-s
5irst strateg' 3 ar-s
%econd strateg' 3 ar-s
=C ar-s>
ans,er" conflict resolution is used during the recognise phase of the recognise-act c'cle in a rule based s'ste. .uring
recognition2 ore than one rule a' ha+e its if-part true. $ach rule that has its if part true is put into the conflict set. Conflict
resolution is used to decide ,hich of the rules in the conflict set to appl'. One strateg' is specificit' ,hich applies the rule that
has the ost clauses in the if portion.. A second strateg' is order2 ,here the rule that is defined first is selected.
cA Rule-based s'stes are siilar to logic2 but rule-based s'stes do no al,a's gi+e the correct logical ans,er. .efine a rule
set and initial facts that gi+e the correct logical ans,er ,hen one of 'our conflict resolution strategies is used and an
incorrect ans,er ,hen the other conflict resolution strateg' is used.
1ules 2 marks
Contradictory marks
=D ar-s>
-trate$y ! is specificity.
-trate$y 2 is order of definition.
The rules are
3f (not (tall 2ohn)) then (assert (short 2ohn))
3f (and(basketball player ?x) (a$e ?x 20)) @A (assert (tall ?x))
3f (short ?x) @A (assert (not tall ?x))
The facts are (basketball player 2ohn) (a$e 2ohn 20)
-pecificity makes the second rule fire because it has two clauses addin$ (tall 2ohn) to the facts. ;o
other rules then fire.
4rder makes the first rule fire addin$ (short 2ohn)B the second rule then fires addin$ (tall 2ohn)B the
third rule then fires addin$ (not tall 2ohn). 2ohn is both tall and not tall which is contradictory.
8uestion 2
aA A s'ste for childrenEs to' selection is to be built. &he final goal of the s'ste is for the user to put in soe details about
the child2 to's that the child alread' li-es2 and cost. &he s'ste ,ill select a to' that the child ,ill li-e. &he first part of the
s'ste categorises children into one of se+eral groups. 7ou should build a decision tree for grouping the children. &he first
choice is based on age and there are D groups ?1-3 onths2 3-D onths2 D-#2 onths2 #-2 'ears2 2-3 'ears2 and 3-; 'earsA.
5or the children bet,een 1 and #2 onths2 that is all that is needed. &he older children are also categorised b' their gender.
8uestion on root 2 ar-s
All D branches on age 3 ar-s
)ender on older onl' 3 ar-s
Reasonable lea+es 2 ar-s
=#1 ar-s>
bA 5or each group ?fro part aA a case-based reasoning s'ste ,ill be built. *hat features are iportantF *hat is an
appropriate siilarit' etricF )i+e 3 saple to's. %ho, ,hich of the second or third to's is closer to the first based on
'our etric.
Colour2 siGe2 cost2 and other good features ; ar-s
&he distance easureent should be reasonable 2 ar-s
%iilarit' calculation 3 ar-s
=#1 ar-s>
answer, itCs based on toys that children ha(e liked before. -o& reasonable features are needed for
toys that children will like a$ain. Dere are a few 3 can think of and these can $o across a$e and
$ender di(isions, colour& siEe& type (car& soft& musical instrument& etc.)& character associated with
(e.$. ;oddy& 5arney& or no one)& electronic and cost. 4f course other features are rele(ant&.
Toy ! Toy Car& red& small& car& none& manual& 2F
Toy 2 5all& white& medium& sport& none& manual& "F
Toy ) bear& brown& small& soft& noddy& electronic& "F
The distance metric needs a way of calculatin$ distance between enumerated (alues. 0ets use 8
colours (white& yellow& oran$e& red& brown& $reen& blue& purple and black)& ) siEes& type has " (alues
(soft& music& other& car& sport)& ) (alues for character (both or neither ha(e same character @ 0& both
ha(e a character@!& one has a character and the other doesnCt 2)& 2 (alues for electronic and cost is
standard so
!'2 @ sGrt( H ! H! H 0 H 0 H)I)) @ sGrt(!")
!') @ sGrt(!H 0 H ) H 2 H ! H )I)) @ sGrt(!/)
the ball is closer
cA Once the s'ste has chosen a to'2 the user a' reHect it because2 for exaple2 the child alread' has that to'. *hat can be
done in this situationF
!ext closest 3 ar-s
3mpro(in$ system with this 2 ar-s
=; ar-s>
answer, The simplest thin$ is to Just find the next closest thin$. This can also be used as an
opportunity to impro(e the system. 3f the reason is because the child already has the toy& the user
could be asked if they like it& which would be e(idence that the system is $ood& or if they donCt which
is e(idence that they donCt like it.
8uestion 3
aA Here are 3 sentences in+ol+ing transfer of possession"
Chris gave the ball to Sandy.
Sandy lost the ball.
Pat gave to Sandy.
.escribe the facts ?e.g. *M itesA that represent these sentences.
*rite three rules that represent these sentences. &he' should onl' run ,hen the appropriate conditions are et ?e.g. for the first
sentence Chris ust ha+e the ballA2 and should add the appropriate ne, facts.
5acts 4 ar-s
<ach rule 2 ar-s for a total of D ar-s
?note sipler +ersion of pat ga+e sand' ,ill acceptableA
?note retracts are not neededA
prere:s 2 ar-s
=#2 ar-s>
answer, facts, ($i(e Chris -andy ball)&(lose -andy ball) ($i(e 6at -andy)
rules if ?f! K' (has ?+ctor ?6oss) ($i(e ?+ctor ?1ecipient ?6oss) @A
(assert (has ?1ecipient ?6oss)
(retract ?f!)
if ?f! K' (has ?+ctor ?6oss) (lose ?+ctor ?6oss) @A (retract ?f!)
you could also (assert (nolon$erhas ?+ctor ?6oss)
if (hasmoney ?8i(er) ($i(e ?8i(er ?1ecipient) @A (assert (hasmoney ?1ecipient))
b) *rite 4 fraes that can be used for processing sentences about transfer of possession. 3 fraes are the instances of the
abo+e sentence2 and the fourth is the frae that the' are deri+ed fro.
3 slots 3 ar-s
default 2 ar-s
inheritance 3 ar-s
=8 ar-s>
ans,er" &ransfer 5rae
)i+er" person
Recipient " person
gi+e5rae isa &ransfer5rae
)i+er" Chris
Recipient " %and'
Ite" ball
lost isa &ransfer5rae
)i+er" %and'
Ite" one'
gi+e5rae isa &ransfer5rae
)i+er" /at
Recipient " %and'
Ite" default one'
cA *rite a rule that ipleents one' as the default thing that is transferred.
/rere:A 2 ar-s
Correct 3 ar-s
=; ar-s>
if (hasmoney ?actor) (transfer ?actor ?recipient) @A (assert (hasmoney ?recipient))
(as in part a)
8uestion 4
aA .ra, a %eantic !et for bic'cles. Include at least 8 nodes2 and the ost appropriate relations.
8 nodes 3 ar-s
inheritance 2 ar-s
/art-of 3 ar-s
Reasonable 2 ar-s
=#1 ar-s>
bA If 'ou ,anted to ha+e the best possible seantic net,or- to help 'ou repair bic'cles2 ,ho ,ould 'ou as-F Ho, ,ould 'ou
go about as-ing theF *hat t'pe of :uestions ,ould 'ou as-F
*ho6experts 3 ar-s
Ho, inter+ie,s 3 ar-s
/roble sol+ing 3 ar-s
/rotot'ping 3 ar-s
Range of :uestions fro siple to coplex 3 ar-s.
=#; ar-s>
answer, The best person to ask would be an expert in bicycle repair. .ou could e(en ask
multiple experts. 3nter(iews would be a $ood way of askin$ the expert& but you could do e(en better
by showin$ them prototype semantic nets. 9urthermore& you could ha(e them use the nets to fix
bicycles and explain what they are doin$. -o& the type of Guestion would ran$e from initial Guestions
about important parts& relations and example bicycles& to later Guestions about the Guality of the
existin$ net& how it could be used to sol(e a problem& and whether there are problems with it.
8uestion ;
Dere is some text 3 took from http, 3t is the
first part of a document entitled Critically +nalyEin$ 3nformation -ources
.ou can be$in e(aluatin$ a physical information source (a book or an article for instance) e(en before you ha(e
the physical item in hand. +ppraise a source by first examinin$ the biblio$raphic citation. The biblio$raphic
citation is the written description of a book& Journal article& essay& or some other published material that appears
in a catalo$ or index. 5iblio$raphic citations characteristically ha(e three main components, author& title& and
publication information. These components can help you determine the usefulness of this source for your paper.
(3n the same way& you can appraise a #eb site by examinin$ the home pa$e carefully.)
A. Author
!. #hat are the authorLs credentials''institutional affiliation (where he or she works)& educational
back$round& past writin$s& or experience? 3s the book or article written on a topic in the authorLs area of
expertise? .ou can use the (arious Who's Who publications for the >.-. and other countries and for
specific subJects and the bio$raphical information located in the publication itself to help determine the
authorLs affiliation and credentials.
2. Das your instructor mentioned this author? Da(e you seen the authorLs name cited in other sources or
biblio$raphies? 1espected authors are cited freGuently by other scholars. 9or this reason& always note
those names that appear in many different sources.
). 3s the author associated with a reputable institution or or$aniEation? #hat are the basic (alues or $oals
of the or$aniEation or institution?
(. .ate of /ublication
!. #hen was the source published? This date is often located on the face of the title pa$e below the name
of the publisher. 3f it is not there& look for the copyri$ht date on the re(erse of the title pa$e. 4n #eb
pa$es& the date of the last re(ision is usually at the bottom of the home pa$e& sometimes e(ery pa$e.
2. 3s the source current or out'of'date for your topic? Topic areas of continuin$ and rapid de(elopment&
such as the sciences& demand more current information. 4n the other hand& topics in the humanities
often reGuire material that was written many years a$o. +t the other extreme& some news sources on
the #eb now note the hour and minute that articles are posted on their site.
C. $dition or Re+ision
3s this a first edition of this publication or not? 9urther editions indicate a source has been re(ised and
updated to reflect chan$es in knowled$e& include omissions& and harmoniEe with its intended readerLs
needs. +lso& many printin$s or editions may indicate that the work has become a standard source in the
area and is reliable. 3f you are usin$ a #eb source& do the pa$es indicate re(ision dates?
.. /ublisher
;ote the publisher. 3f the source is published by a uni(ersity press& it is likely to be scholarly. +lthou$h
the fact that the publisher is reputable does not necessarily $uarantee Guality& it does show that the
publisher may ha(e hi$h re$ard for the source bein$ published.
$. &itle of Iournal
3s this a scholarly or a popular Journal? This distinction is important because it indicates different le(els
of complexity in con(eyin$ ideas. 3f you need help in determinin$ the type of Journal& see Distinguishing
Scholarly from on!Scholarly Periodicals . 4r you may wish to check your Journal title in the latest
edition of "at#'s $aga#ines for %ibraries (>ris 1ef and 4lin 1ef M /=! .:2!) for a brief e(aluati(e
aA If 'ou ,ant to build a s'ste that does this autoaticall'2 'ou ust deterine the iportant features of an inforation
source. According to the text2 ,hat are the iportant featuresF )i+e at least #1 features.
&he author2 date2 edition2 publisher2 title of Hournal ; ar-s
Other reasonable ones fro the text including2 authors organisation2 bac-ground2 and citations2 ho, 'ou heard about hi2
nuber of editions ; ar-s
=#1 ar-s>
ans,er" &he ob+ious iportant features are the subsection titles" the author2 date2 edition2 publisher2 and title of Hournal. &here a
range of other features though ost are concentrated in the author section. 5i+e that I pic-ed out ,ere2 authors organisation2
bac-ground2 and citations2 ho, 'ou heard about hi2 and nuber of editions.
bA *hat is the best t'pe of s'ste for autoaticall' deterining a good source a rule-based s'ste or a case-based s'steF
*h'F *hat ,ould be the probles ,ith the t'pe of s'ste 'ou selectedF
!ote that either approach can ,or-
Coitting to an ans,er # ar-
theor' or none 3 ar-s
%iGe of proble 4 ar-s
=8 ar-s>
ans,er" I thin- the best t'pe of s'ste ,ould be a rule-based s'ste. &his sees to be stating or at least beginning a theor' and
that iplies a rule-based approach.
&here ,ould be probles ipleenting an $% ?either rule or case basedA because the doain is +er' large. &here are certainl'
illions of sources2 and different people ha+e different needs.
cA *rite three useful rules that can help deterine the :ualit' of a source2 and sho, the text that +alidates these rules.
Rules 3 ar-s
1eference to text 3 ar-s
8ood rules # ar-s
=J ar-s>
ans,er " 1espected authors are cited freGuently by other scholars
if (ref ?ref ?author) (citations ?author ?x) (test (A ?x "0)) @A (assert (Guality ?ref hi$h))
3s the author associated with a reputable institution or or$aniEation
3f (ref ?ref ?author) (location ?author ?place) (Guality ?place ?hi$h) @A (assert (Guality ?ref add))
+lso& many printin$s or editions may indicate that the work has become a standard source in the area and is
3f (ref ?ref ?author ?edition) (test (A ?edition ")) @A (assert (Guality ?ref add))
9seful Inforation
The -chool has a student website http,'*%cs dedicated to enrolled Computin$
-cience students& which pro(ides information to support you on your pro$ramme of study. 3ncludin$
information on the -choolCs +cademic staff and,
• -ubJect +cademic +d(ice 1oom schedule
• 1eport on the analysis of Nodule and 6ro$ramme 9eedback 9orms
• <xam%Coursework 1eports
• <xam -cript Oiewin$ 9orm
• 0earnin$ 1esources, Computin$ -cience
• 1e(ision Time'table 3nformation
• -ubJect and Nodule Dandbooks
And other useful inforation such as
• 0ink to #ebCT
• 2'*, .our information Dea(en at Niddlesex >ni(ersity
• 0ibrary Catalo$ue
5eedbac- to %tudents on their ,or-6progress
-tudents can obtain feedback on their work%pro$ress (ia
• -eminar Tutors
• <xam 1eports which can be obtained from http,'*%cs
Attendance Re:uireent
The default minimum student attendance reGuirement is *"P for all Computin$ -cience modules.
3f you are studyin$ the module in 8C mode Q the default minimum student attendance to weekly !."
tutorials is also *"P.
%chool /olic' on passing all Coponents of Module
-tudents must pass both assessed components of a module indi(idually& coursework and
examination& in order to pass the module o(erall. 9ailure in one of the components will result in
failure of the module.
Acadeic .ishonest'
Takin$ unfair ad(anta$e in assessment is considered a serious offence by the uni(ersity which will
take action a$ainst any student who contra(enes the re$ulation throu$h ne$li$ence& foolishness or
deliberate intent.
+cademic dishonesty is a corrosi(e force in the academic life of the uni(ersityB it Jeopardises the
Guality of education and de(alues the de$rees and awards of the >ni(ersity.
The full re$ulations on academic dishonesty are $i(en in the >ni(ersity 8uide and 1e$ulations&
-ection 9 3nfrin$ement of assessment re$ulations ' +cademic dishonesty.
=lagiarism is one specific form of cheating. It is typically disco%ered in coursework or laboratory
assignments that are re$uired to be completed by reliance on your own indi%idual effort.
It is interesting to note that one dictionary defines a plagiarist as a kind of thief Wone who steals the
thoughts or writings of others and gi%es them out as XhisEherY ownZ. When such [theftG is additionally
used to gain academic credit to which you are not entitled a further le%el of dishonesty is clearly
present that makes the original act on your part e%en worse. The 7ni%ersity ?egulation /ection J
clearly sets out the 7ni%ersityGs understanding of plagiarism and the regulations by which you as a
student of the 7ni%ersity are bound.
The key 7ni%ersity regulation is J*., which states that
WThe presentation by the student as their own work of a body of material (written# %isual or oral) which
is wholly or partially the work of another personGs published or unpublished work as the candidateGs
own by unacknowledged $uotationZ constitutes academic misconduct for which there is a penalty.
In addition# the 7ni%ersity ?egulations sets out the process for in%estigating allegations of plagiarism
and describes the penalties. If you are found guilty# the repercussions are %ery serious indeed.
!ou should take steps# therefore# to understand what plagiarism is# how it can be identified and how
you can a%oid committing itD perhaps most importantly# you should reflect and come to understand
why it is to your enormous ad%antage ne%er to plagiarise because it is in effect cheating yourself (and
indeed your fellow students).
Jull details on the Infringement of assessment regulationsEacademic misconduct# can be found in the
7ni%ersity Huide and ?egulations - /ection J
The full re$ulations on appeals are $i(en in the >ni(ersity 8uide and 1e$ulations. -ection 8 ' +ppeal
re$ulations and procedures
$xaples of all &'pical6/re+ious $xaination /apers
6lease $o to the >ni(ersity 2'* website Q http,'* Q +cademic Q <xam 6aper
7atabase http,$ibin%mdx%exam%searchscreenexam.asp Q for copies of pre(ious
examination papers in all subJect areas across the >ni(ersity
2'* is the new website for e(ery Niddlesex student. Turn to it for ad(ice and up'to'date information
any time of the day or ni$ht.
<xplore 2'* on,'*