BQS 3 – “AI in the 21st Century”

advertisement
Wu Dian
October 6, 2010
Professor Craig Graci
Csc416
BQS 3 – “AI in the 21st Century”
This assignment is answering a series of questions after reading chapter 3
of Ben Coppin’s Artificial Intelligence Illuminated. In this chapter, the
book mainly introduces the representations. The questions are really
helpful to understand the important thoughts about Artificial Intelligence.
GRADE = (X+N+LF+A+R) = (54 + 14 + 5 + 5 + 22) = 100
1. With respect to AI, what is a representation? (1) 
A representation is the way how to represent the real world internally, so that the
computer can solve problem correctly.
2. Why are representations significant with respect to AI? (1)
Representations are significant to AI because the representation makes the
computations efficient, and provide a means by which the computer can actually
solve the AI problem, especially when applying Artificial Intelligence to search
problems.
3. In a semantic network, what do the nodes represent? What do the arcs represent?
(2)
In a semantic network, the nodes represent objects and the arcs represent
relationships between those objects.
4. Consider the following property list approach to representing semantic nets in
LISP. If C1 is related to C2 by R, then the pair R/C2 is placed on the property
list of C1. Write a sequence of LISP instructions to create the semantic network
depicted in Figure 3.1 using this representation. (Write “is a” as “isa”.) (5)
( setf ( get ‘Bob ‘isa ) ‘Builder)
( setf ( get ‘Bob ‘Owns ) ‘Fido)
( setf ( get ‘Bob ‘Eats ) ‘Cheese)
( setf ( get ‘Fido ‘isa ) ‘Dog)
( setf ( get ‘Fido ‘Chases ) ‘Fang)
( setf ( get ‘Fang ‘isa ) ‘Cat)
( setf ( get ‘Fang ‘Chases ) ‘Mice)
( setf ( get ‘Mice ‘Eats ) ‘Cheese)
5. In the context of data modeling, what is inheritance? (1)
Inheritance is specifying properties of a superclass and defining a subclass, which
inherits the properties of the superclass.
6. What is a frame system? In answering this question, be sure to mention slots and
frame relations. (2)
A frame system is a gather of frames (or nodes), which are connected together by
relations. Each frame describes either an instance (an instance frame) or a class (a
class frame). Each frame has one or more slots, which are assigned slot values.
This is the way in which the frame system network is built up. Rather than simply
having links between frames, each relationship is expressed by a value being
placed in a slot.
7. In the context of frames, indicate the more formal names given to the “isa”
relation and the “partof” relation. How are all other relations classified? (3)
More formal name of the “isa” relation is “is an instance of class xx” or “is a
member of the class …”
More formal name of the “partof” relation is “some properties of”
Other relations are known as association. They are based on these two objects’
specific relations.
8. Give three examples of “frame system programming languages” – programming
languages which can be viewed as a particular interpretation of the frame system
knowledge representation. Simply name the languages. (1)
Java, C ++, C
9. In Java, how do you create a “frame” that is an instance frame? How do you
create a “frame” that is a class frame? (2)
To create an instance frame in Java, you should use the name of the class followed
by the name of the new object.
To create a class frame in Java, you should define a new class, extending another
class.
Examples:
Instance frame: Worker Worker_1 =new Worker();
Class frame: public class Teacher extends Worker
{ … };
10. What is the difference between an ordinary procedure and a demon? (2)
An ordinary procedure is called when needed, while a demon is run automatically
whenever a particular value changes or when a particular event occurs. There are
two kinds of demons, one is the WHEN-READ procedure, and another is the
WHEN-CHANGED procedure (also known as the WHEN-WRITTEN procedure).
11. What is the difference between procedural semantics and declarative semantics?
(1)
Procedural semantics is a set of instructions to be carried out in a certain order,
while the declarative semantics is a set of clauses, independent of the way Prolog
executes goals
12. In “abstract” frame systems, the “isa” relation is sometimes used a bit too
casually for some people and purposes. In particular, it is used both to relate
objects to classes and classes to other classes. In Java, clarity is achieved
through the mechanisms of construction which result in the sometimes overused
“isa” being replaced by well-defined “instance-of” and “subclass-of” relations –
which, respectively, relate objects to classes and classes to other classes. How
does one model “instance-of” in Java? How does one model “subclass-of” in
Java? (2)
The model for “instance-of” is used to instantiate a new object, like: Worker
Worker_1 =new Worker ();
The “subclass-of” model is to create a new class by using the extend keyword,
like public class Teacher extends Worker {…};
13. In the section on object-oriented programming your author mentions that it is
possible to achieve the same results using single inheritance as it is with multiple
inheritances. Show that this is so in Java by sketching code to define a class
called A which inherits from classes B and C. (Note: do not use the “interface”
mechanism). (3)
I think we can do like this:
class A extends B {
C c1 = new C();
public String A_1 = c1.C_1;
public int A_2 = c1.C_2;
public char A_3 = c1.C_3;
public void A_function1() {
C1.C_function1();
……
}
public void A_function2() {
C1.C_function2();
……
}
}
14. Does Java have a built-in demon mechanism? (1)
Yes, Java has built-in demon mechanisms. For example, it can recover the dumped
storage space automatically.
Download