TweetFollow Us on Twitter

Expert Systems
Volume Number:2
Issue Number:3
Column Tag:Lisp Listener

Expert Systems

By John Roy

This month, Mactutors' Lisp Listener has a special exclusive. In the first few installments of the Lisp Listener (nine months ago!) the question of how serious one can be when it comes to AI on the Mac was raised. This month we can be confident in saying that Mac can and is being used for developing real AI applications. Last summer the International Joint Conference on Artificial Intelligence (IJCAI) was the place for the unveiling of a relatively large number of AI related products for the Mac. These included ExperLisp version 1.04, ExperOps5, MacProlog, Macscheme and as you will see in what follows the first serious end user expert system development application. John Roy has written for us a good description of what Nexpert is, what it does, and how it does it.

PROGRAMMING IN NEXPERT

by John Roy

What are Expert Systems?

In one sentence, expert systems are programs that imitate human reasoning. They recognize logical patterns that are similar to those recognized by humans, and then reason with them to produce expert-like performance. The term "expert system" should not be confused with "rule-based system" nor "production system". These latter two terms refer to implementation schemes, which are often used to build expert systems.

The process of capturing expert reasoning is called knowledge engineering. Previously, the knowledge engineer had to analyze a domain of expertise and socraticly refine an expert system based upon that expertise until it performed as well as the human. Eventually, these knowledge engineering pioneers found that declarative (rather than procedural) programming paradigms are more appropriate when writing an expert system.

LISP is used as the foundation of many expert systems because of its pattern matching, language extension, and data typing capabilities. These capabilities allow AI programmers to design declarative structures (which hold the expert's knowledge) and inference engines (which imitate the expert's logic). NEXPERT's AI Kernel was designed in LISP on a Symbolics "LISP Machine" before being ported to the Macintosh.

What is NEXPERT?

NEXPERT is a full blown rule-base development environment for serious knowledge engineering. It is the first rule-base development tool designed specifically for writing expert systems on the Macintosh. It uses if...then...do... rules to represent the domain expert's knowledge. It has many sophisticated aids for rule-base development such as: automatic, graphical knowledge traces (better than those in KEE); automatic forward and backward chaining from the same rules (as in ART); an automatic dialogue system (as in PROLOG); an automatic explanation facility (How, Why, and Apropos); access to external data bases (those in SYLK form); and execution of external, compiled programs (such as those developed in C).

It does not have a frame system, nor automatic belief maintenance. Not incorporating a belief maintenance system was a good idea, since no general theories are available, and each expert system must tailor uncertainty handling to the specific application. However, no frame system access means (1) no object oriented data structures, (2) no message passing, (3) no inheritance of attributes, and (4) instantiation of flavors. Frame systems concern design, maintenance, and manipulation of extremely large data bases. For applications where the data base management system already exists, or for which the data base is small (less than 1000 data values), or for which there is a simple taxonomy, the external SYLK file access and external program execution can easily be used to interface and manipulate the applicable data bases.

Enough introduction, let's get down to business.

Basic NEXPERT Programming.

The Rule Editor, shown in Figure 1, is where you view the rules and choose what operation to perform. By clicking on the dog-ear, the pages can be flipped forward and backward. The rules are alphabetically indexed by Hypothesis (which is how the buttons on the right allow rapid movement through the list). It is a bit difficult to understand the rule-base as a whole from only viewing one rule at a time, but the Network discussed later gives the rule-base developer a global view. There are similar windows (called Notebooks) for the Data List and the Hypothesis List. Selection of a rule-base operation is made by clicking on one of the icons at the bottom of the Rule Editor. From the left they are; (1) create a new rule, (2) modify the current rule, (3) create a new rule by copying the current rule, (4) delete the current rule, and (4) save the knowledge base.

I've found that creating a new rule by copying a similar one, is the best way to go, particularly since all of the rule conditions are ANDed together, and the only way to achieve an OR is to create another rule with the ORed condition modified. This is the same with OPS5, though OPS5 has a MEMBERSHIP operator and NEXPERT does not.

Once an operation has been selected what I call the rule template interface appears. This is the main development interface. One enters and modifies all of the rules from this rule template interface. All you need to do is fill in the conditions, the hypothesis, and the actions via the pop-up menus shown below. Note that currently only eight (8) conditions and actions can be used in a single rule (i.e. # of conditions + # of actions < 9). If the rule had more than eight, then two rules must be written such that they link together and fire in order. One of the nicest, and oddly important, capabilities available are COPY DATA and COPY HYPOTHESIS. These prevent the rule-base developer from re-typing, and more importantly, misspelling data and hypotheses. Note that NEXPERT is case sensitive, and does not allow spaces within the names given to data.

I've pasted this window together so that all of the pop-up menus are visible at once. The basic rule template (underneath the three pop-up menus) consists of the IF slots, the THEN slot, the AND DO slots, and the CONTEXT slots. By clicking on a slot the appropriate menu will pop-up. Don't worry about the context slots right now, they are an advanced programming feature that allow the rule-base developer to suggest knowledge island transitions, (fully explained in a future article, and needed only for extensive rule-bases). The menu at the left shows all of the tests available to form rule conditions (see Table 1). The menu at the right shows all of the actions that can be performed (see Table 2). The menu in the middle (slightly covered by the other previously mentioned menus) is for entering arguments and equations. The COPY DATA and COPY HYPOTHESIS are available from this menu.

Table 1 - Condition Tests

CANCEL do nothing

CLEAR clear test slot

YES and NO test boolean

>, <, , ¾, =, compare numeric equation to constant

NAME declare global synonym

IS and IS compare multi-valued datum to constant

RESET set datum to "unknown"

EQUAL and

UNEQUAL compare two multi-valued data

Table 1 - Action Operations

CANCEL do nothing

CLEAR clear operation slot

DO perform numeric equation and assign to datum

LET assign multi-valued datum a constant

RESET set datum to "unknown"

SHOW either type out a text file to the Apropos Window

or pop-up a paint picture to fill the screen

LOADKB append another knowledge base to current one

EXECUTE perform external function

RETRIEVE load data from an external SYLK file

Once the rule has been entered the OK button will only darken if the rule is structured properly. Clicking on the CHECK button will highlight the offending slot. If the rule is properly structured, but a datum is misused (eg. using a previously defined boolean in an equation), a message will appear (after the OK button-click) explaining the problem. This is very nice most of the time but can be a pain if you decide that you would like to change the data type of a datum.

NEXPERT has two basic values that any datum may have: NOTKNOWN and UNKNOWN. NEXPERT uses UNKNOWN as the "reset" value. Whenever a datum's value is needed and it is currently UNKNOWN, then NEXPERT will switch to backward chaining to attempt to establish a value from the data already available. If this is unsuccessful then the user is queried, via the Question Window, for a value. NOTKNOWN on the other hand, is used to mean that the user has been questioned and does not know the answer. NOTKNOWN allows default reasoning to be done and prevents NEXPERT from continuing to ask for a value that the user does not know.

Knowcessing

"Knowcess" is the term for the rule-based inferencing process. This is where NEXPERT's AI Kernel shows what it is made of. The process can be initiated by suggesting an hypothesis or volunteering a datum. One may also use a combination of the two. If any data is volunteered, then the system will drive forward, attempting to establish as many hypotheses as possible. You can control this forward chaining via NEXPERT's Strategies (see next NEXPERT article for when, why, and how this should be done). If one only suggests an hypothesis, NEXPERT will begin by looking backward in an attempt to find sufficient information that will prove this hypothesis. This information can lead the system to other hypotheses that need to be established, which can lead to others, which lead to others, etc.

Once the system reaches a rule that has some UNKNOWN datum in it, the user will be prompted for a value (see the example in Figure 3 below). At this point the user can access the multi-level Explanation Facility (via the WHY? and HOW? Buttons ), which is automatically built from the static forward and backward chains already in the rule-base. Note that the system knows that the example datum BOSS-CALLED is a boolean and that the user may answer NOTKNOWN. The last button, Apropos, is for tailoring the system to the application even more. When any Apropos Button is clicked on, NEXPERT will bring up the file (text or pictures) that the rule-base developer has made for this datum. This is very useful for instructing the user about the meaning and use of a specific datum.

There are other windows that allow the rule-base developer to watch the progress of the Knowcess. The Transcript Window keeps a complete record of the session, but it slows down the processing by a factor of eight. There is the option to turn the Transcript Window off, which I always use at run-time. The Hypothesis Window displays the hypothesis currently under consideration. And the Conclusions Window reports whether the hypothesis was rejected, established, or underdetermined. But the best way I have found to debug a rule-base is to get a global view.

As I said before, the way to get a global view is from the Network. This is an automatic, dynamic, graphical knowledge trace. Figure 4 shows NEXPERT in the middle of the KNOWCESS process. The dynamics of the system can be followed by noting (a) in this example, the datum TIME points to the hypotheses DAYTIME, NOON, and WORK, (b) that DAYTIME and NOON have already been established, (c) that the system is considering the hypothesis WORK, and (d) that it is currently prompting for the value of the datum BOSS-CALLED (see arrow and bulls-eye in the lower left corner).

Using the operation icons on the left, the rule-base developer can "navigate through the knowledge islands." The functions called by these icons allow investigation of only those areas of the knowledge graphic that are currently of interest. From the top, the operation icons are: (1) single or multiple knowledge island display, (2) display data that point to this hypothesis, (3) display hypotheses that this datum points to, (4) erase this link, (5) focus attention on this datum or hypothesis, and (6) apropos this datum or hypothesis. These operations only affect the display, not the actual knowledge graph of the rule-base. From this one window all of the rules can be viewed, all of the links between rules can be checked, and the dynamics of the Knowcess process can be monitored; making it an excellent aid in the debugging of a rule-base.

Overall, the programming environment of NEXPERT is very clean and efficient. In the next article on NEXPERT I'll be addressing the more complex issues of the AI Kernel, Controlling the Agenda, Customizing the User Interface, Speeding-Up Execution, Outside Database Access, and of course a Full Bug Report.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

iTubeDownloader 6.5.13 - Easily download...
iTubeDownloader is a powerful-yet-simple YouTube downloader for the masses. Because it contains a proprietary browser, you can browse YouTube like you normally would. When you see something you want... Read more
FileZilla 3.47.0 - Fast and reliable FTP...
FileZilla (ported from Windows) is a fast and reliable FTP client and server with lots of useful features and an intuitive interface. Version 3.47.0: Fixed regression loading advanced site... Read more
Transmit 5.6.3 - Excellent FTP/SFTP clie...
Transmit is an excellent FTP (file transfer protocol), SFTP, S3 (Amazon.com file hosting) and iDisk/WebDAV client that allows you to upload, download, and delete files over the internet. With the... Read more
Doomsday 2.2.2 - Play classic Doom on mo...
id Software's Doom pioneered the modern first-person shooter genre. Released in 1993, it was a quantum leap in game engine technology with fluid and - at the time - incredibly realistic 3D graphics.... Read more
Ableton Live 10.1.9 - Record music using...
Ableton Live lets you create and record music on your Mac. Use digital instruments, pre-recorded sounds, and sampled loops to arrange, produce, and perform your music like never before. Ableton Live... Read more
Maintenance 2.6.5 - System maintenance u...
Maintenance is a system maintenance and cleaning utility. It allows you to run miscellaneous tasks of system maintenance: Check the the structure of the disk Repair permissions Run periodic scripts... Read more
Adobe Photoshop 21.1.0 - Professional im...
You can download Photoshop for Mac as a part of Creative Cloud for only $20.99/month (or $9.99/month if you have purchased an earlier software version). Adobe Photoshop remains the gold standard in... Read more
Adobe Lightroom Classic 9.2 - Import, de...
You can download Lightroom for Mac as a part of Creative Cloud for only $9.99/month with Photoshop, included as part of the photography package. The latest version of Lightroom gives you all of the... Read more
Adobe InCopy 15.0.1 - Create streamlined...
InCopy is available as part of Adobe Creative Cloud for $52.99/month (or $4.99/month for InCopy app only). Adobe InCopy, ideal for large team projects involving both written copy and design work,... Read more
Adobe Illustrator 24.0.3 - Professional...
You can download Adobe Illustrator for Mac as a part of Creative Cloud for only $20.99/month (or $9.99/month if you have also purchased an earlier software version). Adobe Illustrator for Mac is the... Read more

Latest Forum Discussions

See All

Mobile Games Starter Kit
Over here at 148Apps, we regularly dive deep into the latest and greatest mobile games hitting the App Store, but that’s not always what people are looking for when searching for a new mobile game. Some folks just want to dip their toes into... | Read more »
Unresolved is a hard-hitting narrative a...
Ghofran Akil's Unresolved in an upcoming text-based adventure game that sees you playing as a mother attempting to find her disappeared husband during the Lebanese Civil War. [Read more] | Read more »
Marvel Strike Force introduces new brawl...
FoxNext's squad-based RPG Marvel Strike Force is set to receive some fresh characters from the X-Men and Iron Man series. They'll arrive as part of the game's latest update, which follows a sizable spending boycott on the title due to complaints... | Read more »
Speed Dating for Ghosts is a narrative a...
Speed Dating for Ghosts originally released on Steam back 2018, since then it has received honourable mentions for narrative during the Independent Games Festival. Now it's made its way over to iOS devices where it's available as a premium title... | Read more »
Fast-paced multiplayer title Tennis Star...
Tennis Stars: Ultimate Clash is the latest free-to-play tennis title to hit iOS and Android. It's said to be a fairly casual experience, offering easy-to-learn controls and fast-paced, mobile-friendly matches. [Read more] | Read more »
Super Mecha Champions' latest updat...
Super Mecha Champions' latest update sees the addition of a brand new character called R.E.D. Alongside that, there's news about the current season and a series of Emojis that have been added to the game. [Read more] | Read more »
Apple Arcade: Ranked - Top 50 [Updated 2...
In case you missed it, I am on a quest to rank every Apple Arcade game there is. [Read more] | Read more »
Apple Arcade: Ranked - 51+ [Updated 2.19...
This is part 2 of our Apple Arcade Ranking list. To see part 1, go here. To skip to part 3, click here. 51. Mini Motorways Description: [Read more] | Read more »
Isle Escape: The House is an upcoming pu...
Isle Escape: The House is an upcoming puzzle game from Simeon Angelov that's intended to serve as an introduction to a saga they're planning on releasing in an episodic fashion. The first chapter is set to release for both iOS and Android on 29th... | Read more »
Company of Heroes, the classic RTS, is n...
Feral Interactive has finally released their highly anticipated iOS version of the strategy classic Company of Heroes. It's available now for iPad as a premium title and has had various tweaks to ensure that it's optimised for touch controls. [... | Read more »

Price Scanner via MacPrices.net

Verizon offers free iPhone 7 to customers ope...
Verizon is offering a free 32GB iPhone 7 for new or existing customers who open a new line of service, no trade-in required. Cost of the phone is credited to your account monthly over 24 months. The... Read more
Sale! 10.5″ 256GB WiFi iPad Air for $549, $10...
Amazon has new 10.5″ 256GB WiFi iPad Airs, in Space Gray, on sale today for $549 shipped. Their price is $100 off Apple’s MSRP for this model, and it’s the cheapest price available from any Apple... Read more
Back on sale! Apple’s new Mac Pro for $5499,...
B&H Photo has the base 2019 Mac Pro (3.5GHz 8-Core Xeon, 32GB RAM, 256GB SSD) in stock today and on sale for $5499 including free overnight delivery to many addresses in the US. Their price is $... Read more
B&H offers $100 discount on base 13″ 1.4G...
B&H Photo has new 2019 13″ 1.4GHz MacBook Pros on sale for $100 off Apple’s MSRP today with prices starting at $1199. Overnight shipping is free to many addresses in the US. These are the same... Read more
Apple continues to offer Certified Refurbishe...
Apple has Certified Refurbished iPhone XS models available for up to $350 off MSRP, with prices starting at $699. Each iPhone is unlocked and comes with Apple’s standard one-year warranty and a new... Read more
Apple AirPods are on sale for $30 off today
Amazon has new 2019 Apple AirPods (non-Pro models) on sale today for $30 off MSRP, starting at $129. Shipping is free: – AirPods with Wireless Charging Case: $169 $30 off MSRP – AirPods with Charging... Read more
27″ 3.7GHz 6-Core 5K iMac on sale for $2099,...
B&H Photo has the 2019 27″ 3.7GHz 6-Core 5K iMac in stock today and on sale for $200 off Apple’s MSRP. Overnight shipping is free to many locations in the US: – 27″ 3.7GHz 6-Core 5K iMac: $2099 $... Read more
Save up to $250 on a 12.9″ iPad Pros with the...
Apple has Certified Refurbished 12.9″ iPad Pros available on their online store for up to $250 off the cost of new models. Prices start at $849. Each iPad comes with a standard Apple one-year... Read more
Save up to $220 on 11″ iPad Pros with these r...
Apple has Certified Refurbished 11″ iPad Pros available on their online store for up to $220 off the cost of new models. Prices start at $679. Each iPad comes with a standard Apple one-year warranty... Read more
8-Core 27″ iMac Pro available for $4249, Cert...
Apple has Certified Refurbished 27″ 3.2GHz 8-Core iMac Pros available for $4249 including free shipping. Their price is $750 off the cost of new models. A standard Apple one-year warranty is included... Read more

Jobs Board

Medical Assistant - *Apple* Valley Clinic -...
…professional, quality care to patients in the ambulatory setting at the M Health Fairview Apple Valley Clinic, located in Apple Valley, MN. Join the **M Health Read more
Windows/ *Apple* Technical Support Engineer...
Windows/ Apple Technical Support Engineer McLean , VA , US Apply + Be you + Be Booz Allen + Be empowered + Learn More Job Description Location: McLean, VA, US Job Read more
Medical Assistant - *Apple* Valley Clinic -...
…professional, quality care to patients in the ambulatory setting at the M Health Fairview Apple Valley Clinic, located in Apple Valley, MN. Join the **M Health Read more
Geek Squad *Apple* Consultation Professiona...
**762475BR** **Job Title:** Geek Squad Apple Consultation Professional **Job Category:** Store Associates **Store NUmber or Department:** 001423-San Jose-Store **Job Read more
Medical Assistant - *Apple* Valley Clinic -...
…professional, quality care to patients in the ambulatory setting at the M Health Fairview Apple Valley Clinic, located in Apple Valley, MN. Join the **M Health Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.