Prolog+CG GUI
by
Adil KABBAJ
This document provides an overview of Prolog+CG GUI. Figure 1 shows the main frame after the activation of Prolog+CG GUI (from Amine Suite for instance). An untitled file is provided. You can edit a new program or you can open existent ones (and close the untitled file). Figure 1.b shows three programs in edition and shows also the actions provided by Console menu. To ask questions, the user should create a new console (or open a console that exists already). The user can activate the action Console/New to get a new Console (Figure 1) or he/she can Console/Open an existent console. As can be noted from Figure 1, Prolog+CG editor is stylized/colored editor: different colors are associated to different lexical categories of Prolog+CG.
(a) Stylized/Colored Prolog+CG Editor
(b) Console Menu
(c) Console Frame
Figure 1: Prolog+CG GUI
As shown in Figure 2, menu Console offers the possibility to create, open, save/saveAs/close a console.
Figure 2: Console Menu from Console Frame
User can change the font of the text in the Console (Figure 3).
Figure 3: Font Menu for the Console Frame
Once a console is created, the user can ask questions that require only primitive goals (Figure 4.a). For defined goals, he/she should consult first files that are open in Prolog+CG GUI. Several files can be consulted at any time. In the case of Figure 4 , the user will consult only the untitled file, using the action Console/Consult (Figure 4.b).
(a) Request that requires no prior consultation (b) Consult (the untitled) file
Figure 4: Consult and Answer Request
Once the file is consulted, requests can be expressed about these consulted file(s) (Figure 5).
Figure 5: request about goals defined in the consulted file(s)
Of course, the main reason behind the development of Prolog+CG is not to offer a Java interpreter of Prolog, but to offer an extended version of Prolog that supports Conceptual Graphs (CG) and Ontology. If some files, among the opened files to be consulted, contain CGs or require an Ontology, then the user should load first (with the action Consult/Ontology/Load from the Console Frame) the required ontology (Figure 6) and then (re)consult the files needed for his/her application. Consultation (i.e. parsing) of these files will be done taking into account the current ontology (that was loaded before the consultation).
Figure 6: Load an Ontology
Figure 7 shows the menu for the consultation of programs that are open in the Prolog+CG GUI. Figure 7.b shows the dialog frame that appears when consult (or reconsult) is activated. The list of opened files is provided with a multi-selection option; the user can select several files. Suppose that the three opened files are selected, Prolog+CG will rewrite the instruction in the console (Figure 7.c).
(a) Consult/Program Menu
(b) Consult Dialog Frame
(c) Effect of the consultation
Figure 7: Consultation of Programs
Now, the user can ask questions about the consulted files. Figure 8 shows an example that concerns natural language processing (nlp). The request (nlp) initiates the nlp application and starts with the execution of read primitive and the appearance of read frame.
Figure 8: Consultation and "Prolog+CG in action"
Let us consider now the debuger of Prolog+CG. From the Console Frame, the user can activate the debuger, by selection of Debuger/Debug option (Figure 9.a). Figure 9.b shows the debuger frame: the inference tree is visualized and the user can ask for an in_step, next_step, stop_debug or stop_resolution action. Backtracking is visualized also (by remove of subtrees and a continuation with new subtrees).
Figure 9: Debuger of Prolog+CG
Figure 10 provides some snapshots of the debuger in action ! It shows for instance the backtrack to the case of declarative sentence, since imperative_sentence goal can't be satisfied. Figure 10 shows also the possibility to get, by a right double-click, the instantiation of a goal (a node in the inference tree) in a separate frame.
Figure 10: The Debuger in action !