250 likes | 377 Views
WebLS A Custom Prolog Rule Engine for Providing Web-Based Tech Support. Arvindra Sehmi - SBC Warburg Mary Kroening - Amzi! Inc. ( JICSLP’96 Workshop, Bonn, 5-6 September 1996 ). Topics of Presentation. Overview of WebLS Future WebLS Developments. Topics of Presentation. Overview of WebLS
E N D
WebLSA Custom Prolog Rule Engine for Providing Web-Based Tech Support Arvindra Sehmi - SBC Warburg Mary Kroening - Amzi! Inc. ( JICSLP’96 Workshop, Bonn, 5-6 September 1996 )
Topics of Presentation • Overview of WebLS • Future WebLS Developments
Topics of Presentation • Overview of WebLS • General • Architecture Details • Future WebLS Developments
General 1 • Server-centric set of tools for deploying forms-based Q&A-type Expert Systems on The Web • Uses embedded “Amzi! Logic Server” Prolog component for Inference Engine and Logic-Base (KB) • Interfaces with Web servers using CGI & WinCGI via support functions written in ‘C’.
Architecture 1 • CGI interface to Web Server (C & Prolog) • Logic-base of facts and rules (Prolog) • Inference engine (HCI is Web aware!) Web Client Web Server Logic Base & WM HTTP CGI CGI I/F Logic Server (Inference Engine) Initial Form Generic Components Appliction Specific Generic Third Party
Architecture 2 - CGI Interface 1 AMZICGI.EXE • Dynamic WM of facts and session corresp-ondence maintained using hidden fields Logic Base & WM consult rules etc. HTTP Get I/P Logic Server IE and C/C++ hooks (AMZICGI.XPL) assert facts HTML O/P Logic Server RT (A_MW3D.DLL)
Architecture 2 - CGI Interface 2 • The C Code • Loads and executes Inference Engine for each submission of an HTML form (more on this later...) • Contains Prolog/C predicates for reading CGI input and writing CGI HTML output • Unix/WinNT - uses stdin/stdoutWin95 - uses INI files • Organises and asserts CGI variables (with standardised naming) in cgi, system, form fact categories • Handles multivalued facts by mapping values to a Prolog list • Automatic maintainance of WM state across CGI invocations (even multiple simultaneous sessions)
Architecture 2 - CGI Interface 3 • The Prolog Code • Assists in the initialisation activities of the C code • Is able to send HTML text, HTML files or redirect web server to another URL • Outputs HTML form elements for asking questions(menu, yes/no, fill-in-the-blank) • Provides error catching and reportingfacility that returns error messages on web pages it generates • Provides logging (used for trace and debugging output) • Includes useful debugging tools to aid development of the CGI Interface and the WebLS inference engine
Architecture 2 - CGI Interface 4 HTTP Get I/P AMZICGI.EXE • Separating CGI I/F from the Server component could simplify IE and open up other possibilties (see PilloW/CIAO & LogiMOO) HTML O/P AMZISVR.EXE Logic Base & WM consult rules etc. Logic Server IE (AMZISVR.XPL) assert facts Logic Server RT (A_MW3D.DLL)
Architecture 3 - Logic-Base 1 • Static part - Rules and Specifications • Dynamic part - Working Memory of Facts
Architecture 3 - Logic-Base 2 - Static 1 • Operator declarations:- op(790, fx, if). % prefix operator:- op(780, xfx, then). % infix operator • If-Then rulesif (languageTool = 'Borland C++' or languageTool = 'Borland C') and symptoms include % Note: this handles multivalued fields 'Errors linking with the Logic Server libraries' and applicationMode = '16-bit' and releaseDate <= '19960302'then problem = borlandStatic16.
Architecture 3 - Logic-Base 2 - Static 2 • Specifications for... • Method of retrieving attribute (fact) values • Answers (explanations) for problems (goals) • Facilitate... • HTML forms to be used as the basic HCI unit • Dynamic form construction on a field-by-field basis • The ability to take advantage of HTML’s syntax for links to other resources (img, href, embed, applet, etc.)
Architecture 3 - Logic-Base 2 - Static 3 • Attribute value specification attr(environmentNameVer, [ multivalued, % Note: this option results in a multivalued field prompt = $What environment are you running under?$, ask = menu(['Windows 3.x', 'Windows 95', 'Windows NT', 'DOS', 'Linux']) ]).Other ask types available are:ask = yesno % yes/no radio button groupask = field {length = N} % text field (of length N)
Architecture 3 - Logic-Base 2 - Static 4 • Related Attribute value specification(used for grouping facts to minimise HCI “noise”) attr(environmentNameVer, [ multivalued, prompt = $What environment are you running under?$, ask = menu(['Windows 3.x', 'Windows 95', 'Windows NT', 'DOS', 'Linux']),related = [memSize, processorType] ]).WebLS will also ask for memSize and processorType when asking for environmentNameVer
Architecture 3 - Logic-Base 2 - Static 5 • Problem answer specification answer(dcgVariableGoal, [ text = [$This can be caused by attempting to compile a DCG $, $statement with a variable as a goal, e.g. $, $sentence-->noun, X, verb.$] ]). Other answer types available are:htmlFile = ‘odbcIntro.htm’url = ‘http://www.amzi.com/install#delphi_component’
Architecture 3 - Logic-Base 2 - Static 6 • Including notes in an answer answer(cLargeModelRequired, [ text = [$16-bit C/C++ apps require the large memory model. $, $Failure to use it leads to immediate GPFs.$], note = [debugEmbed, cLibraries] ]). • Problem answer note specification note(debugEmbed, [ text = [$For more info on debugging embedded Prolog modules $, $see <A HREF= "ftp://ftp.amzi.com/pub/articles/APIDEBUG.TXT"> Debugging Hints</A>.$] ]). % written after answers separted by HR
Architecture 3 - Logic-Base 3 - Dynamic • Working Memory of facts During a session the facts gathered from the user are dynamically asserted as name-value pairs fact(errorMessage, 'Local stack full'). fact(programVersion, ‘3.3 Mar96’). fact(environmentNameVer, ‘Windows 95’).
Architecture 4 - Inference Engine 1 • Problem resolution session starts by displaying an initial HTML form • If the problem can be determined from collected facts, the answer is returned to the user and WebLS exits • If not, a hypothesis is selected from the first rule whose known facts match • All remaining facts needed to prove this hypothesis are asked, plus any related facts
Architecture 4 - Inference Engine 2 • All currently known facts are saved in hidden fields and WebLS exits • The process of selecting a hypothesis and asking the user for facts repeats until an answer is found (or until no answer can be found) • The results of the problem resolution session are recorded in a file for later analysis
Topics of Presentation • Overview of WebLS • Future WebLS Developments
Future WebLS Developments • Client-side version • Using Netscape’s LiveConnect (Java/JavaScript/C++) runtime interface for plug-in development • Good for shipping CDROM apps or with products for sale • Good for Intranet apps interfacing with Business Object Models • CORBA IDL • Support for mobile agents • Enhanced inference engine using new multi-threading Logic Server • Email integration • Integrate with PiLLoW/CIAO libraries, and LogicWeb
Availability • Free Free Free (with source code) • http://www.amzi.com • Also Free (with source code)… • Prolog Java Class Wrapper + Native C/C++ API • wxTinyBB blackboard system • Prolog ODBC library • Prolog Sockets library • Numerous technical notes and papers
WebLSA Custom Prolog Rule Engine for Providing Web-Based Tech Support Asante Sana Thank You