انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Representing facts

Share |
الكلية كلية تكنولوجيا المعلومات     القسم قسم البرامجيات     المرحلة 3
أستاذ المادة عباس محسن عبد الحسين البكري       11/1/2011 10:54:40 AM
Representing facts
If we want computers to act intelligent, we must help them. We must tell them all the common-sense
knowledge we have that they don t. This can be hard because this knowledge can be so obvious to us that
we don t realize that a computer doesn t know it too, but we must try.
Now there are many different kinds of knowledge. Without getting deep into philosophy (or specifically
epistemology, the theory of knowledge), there are two main kinds: facts and reasoning procedures. Facts
are things true about the world, and reasoning procedures (or inferences) are ways to follow reasoning
chains between facts. Since facts are easier to represent than procedures, we ll consider them first, and
postpone procedures to Chapter 4.
Predicates and predicate expressions
To talk about facts we need a "language". Artificial intelligence uses many languages and sub-languages.
But in this introductory book we don t want to confuse you. We ll use only one, simple (first-order)
predicate logic (sometimes called predicate calculus and sometimes just logic). And we ll use a
particular notation compatible with the computer programming language Prolog | REFERENCE 1|. .FS |
REFERENCE 1| In this book we use a subset of the "standard Prolog" in Clocksin and Mellish,
Programming in Prolog, second edition, Springer-Verlag, 1984. For a complete description of what we
use, see Appendix D. .FE Prolog isn t predicate logic itself; computer languages try to do things, whereas
logic just says that certain things are true and false. But Prolog does appear close to the way logic is
usually written. That is, its grammar or syntax or form is that of logic, but its semantics or meaning is
different.
And what is that grammar? Formally, a predicate expression (or atomic formula, but that sounds like a
nuclear weapons secret) is a name--a predicate--followed by zero or more arguments enclosed in
parentheses and separated by commas (see Figure 2-1) | REFERENCE 2|. .FS | REFERENCE 2| Several
terms closely related to "predicate expression" are used in the logic and artificial-intelligence literature. A
literal is like a predicate expression only it can have a negation symbol in front of it (negations will be
explained in Section 3.6). A structure or compound term is like a predicate expression only it isn t
necessarily only true or false. A logical formula is a structure or a set of structures put together with
"and"s, "or"s, and "not"s. .FE Predicate names and arguments can be composed of any mixture of letters
and numbers, except that predicate names must start with a lower-case letter. (Upper-case letters first in a
word have a special meaning in Prolog, as we ll explain shortly.) The underscore symbol "_" also counts
as a letter, and we will often use it to make names more readable. So these are all predicate expressions:
p(x)
q(y,3)
r(alpha,-2584,beta)
city(monterey,california)
tuvwxy(abc345)
noarguments
pi(3.1416)
long_predicate_name(long_argument_name,3)
We can put predicate expressions like these into computers. They can represent facts true about the
world. But what exactly do these expressions mean (their semantics)? Actually, anything you want--it s
up to you to assign reasonable and consistent interpretations to the symbols and the way they re put
together, though there are some conventions. The better job you do, the more reasonable the conclusions
you ll reach from all these facts.
Predicates indicating types
Predicates can mean many things. But they do fall into categories.
One thing they can mean is something like data-type information in a language like Pascal or Ada.
Except that in artificial intelligence there are generally a lot more types than there are in most
programming, because there must be a type for every category in the world that we want the computer to
know about.
For instance, suppose we want the computer to know about some U.S. Navy ships | REFERENCE 3|. We
.FS | REFERENCE 3| The occasional use of military examples in this book is deliberate: to serve as a
reminder that much artificial intelligence work in the United States has been, and remains, supported by
the military. We make no endorsements. .FE could tell it
ship(enterprise).
to say that the Enterprise is a ship (remember we must use lower case). Or in other words, the Enterprise
is an example of the "ship" type. We will put periods at the end of facts because Prolog uses the period to
signal the end of a line. We could also tell the computer
ship(kennedy).
ship(vinson).
to give it the names of two more ships--two more things of the "ship" type. Here ship is a type predicate.
If we knew code numbers for planes we could tell the computer about them too, using the code numbers
as names:
plane(p54862).

المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
الرجوع الى لوحة التحكم