انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية تكنولوجيا المعلومات
القسم قسم البرامجيات
المرحلة 3
أستاذ المادة عباس محسن عبد الحسين البكري
11/1/2011 11:00:40 AM
plane(p79313). Similarly, we can label people with types: commodore(r_h_shumaker). president(r_reagan). and label more abstract things like institutions: university(naval_postgraduate_school). university(stanford_university). and label concepts: day_of_week(monday). day_of_week(tuesday). day_of_week(wednesday). A thing can have more than one type. For instance: ship(enterprise). american(enterprise). And types can have subtypes: carrier(vinson). ship(carrier). These are all type predicates, and they are all have one argument. The argument is the name of some thing in the world, and the predicate name is the class or category it belongs to. So the predicate name is more general than the argument name; this is usual for predicate names in artificial intelligence. So it wouldn t be as good to say enterprise(ship). kennedy(ship). About types We ve said these predicates are like the types in computer languages, but there are some differences. The main one is that they need never be defined anywhere. If for instance we are using Pascal, we either use the built-in types (integer, real, character, array, and pointer) or define the type we want in terms of those built-in types. But for artificial intelligence, the type (predicate) names are just arbitrary codes used in lookup. This is because you can put integers and characters in a computer, but not a ship. You can t even put in a full representation of a ship, or a full representation of any other real object--real objects have too many complexities, while integers and characters are abstractions. How then, if we expect the computer to be intelligent, will it ever know what a ship is? Much the way people know. Ships are defined in a dictionary using the concept of a vehicle, the concept of water, the concept of floating, and so on. A dictionary might say a ship is "an oceangoing vessel". But it might define "vessel" as a "craft for travelling on water", and "craft" as an "individual ship"--so the definitions are circular, as all dictionary definitions are sooner or later. But we can indirectly figure out what is being talked about by the secondary words like "oceangoing" and "travelling". So words must be defined in terms of one another. So we won t expect each type predicate to be implemented (that is, understood by a computer) by a separate procedure or processing routine. The same holds for arguments. In fact, we could store all predicate names and arguments the same way in the computer, as characters. This is a bit wasteful of computer storage space--so some Prolog dialects do store numbers differently--but there s nothing wrong philosophically with it. Good naming So predicate and argument names can be arbitrary; we just have to remember what they represent. But one name can be better than another, if it is easier to remember what it means. Writing facts for an artificial-intelligence program to use is a kind of programming, and we should follow the usual rules of good programming style. In choosing names, we suggest these guidelines: 1. As much as possible, use everyday English words for names. If you need more than one word, use the underscore character between them for clarity, like in day_of_week (though sometimes you can leave out the underscores like in dayofweek when the reading is reasonably clear). 2. Choose names that describe their function precisely. For instance, use day_of_week instead of day, which could describe both monday and october_19_1985. 3. Avoid names with multiple meanings. For instance, if there is a Commander Kennedy as well as a ship named Kennedy, include the first initial of the person; or if you call the Enterprise a "ship", don t also say that a unit "shipped" somewhere. 4. Avoid numbers in names, with two exceptions: arithmetic (see Chapter 5) and closely related variables and predicates (like X and X2 in Section 5.5 and iterate and iterate2 in Section 10.8).5. Abbreviate only when absolutely necessary. Since artificial intelligence programs often use many names, abbreviations can be confusing. 6. Predicate names should be more general than their argument names, but not so general that they don t really mean anything (for then facts can t be indexed well). 7. A few predicate names are reserved or "special" to Prolog, so you can t use them for your own predicates. 8. Of course, always use the same name for the same thing.
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|