390 likes | 400 Views
This project aims to develop a mathematical apparatus for programming web agents in a logical and mathematically strict manner. It focuses on the use of logic programming techniques, specifically Prolog, to automate the retrieval, recognition, extraction, and analysis of information on the internet. The project also addresses the challenge of ensuring soundness and completeness of inference in dynamic outer world conditions.
E N D
Development and Application of Logical Actors Mathematical Apparatus for Logic Programming of Web Agents Alexei A. Morozov PhD, Senior ResearcherInstitute of Radio Engineering and Electronics Russian Academy of Sciencesmorozov@mail.cplire.ru
What is the fundamental problem to be solved in our project? We are interested in mathematical strictness of logic programs that operate in dynamic outer world. Web agents are only a particular case of such programs. Other cases are the following: visual user interface, virtual reality, control systems, etc.
What is Web agent? Web agents are programs that automate retrieval, recognition, extraction, and analysis of information on the Internet oriented at the needs of an individual user (or a group of users). Agents differ from the widely used Internet retrieval systems in the following: • They can autonomously operate during long periods of time (days, weeks, or more) performing the task set by the user. • As any other program, once created, an agent can be used many times whereas a query to a universal retrieval system invokes a single operation of information retrieval.
Advantages of the logic approach to the programming of Web agents • Prolog has a very high level of abstraction. • The ideology of Prolog is based on the concept of tree search (backtracking). • The syntax of logic languages is simpler and more expressive than that of imperative ones because:a.Pointers are not explicitly used.b.Recursion and backtracking are used instead of cycling and branching.c.Any complex data item has a clear text representation. • Logic programs are a convenient object for automatic construction, analysis, and transformation. • Logic languages are attractive for processing texts written in natural languages.
The main advantage of the logic programming of Web agents The main advantage of logic programming is that it gives means and criteria for estimation of mathematical strictness of Web agent operation. There are model-theoretic semantics, as well as the “soundness” and “completeness” notions.
The dynamic environment problem The use of standard Prolog is mathematically incorrect, because the standard control strategy of Prolog doesn’t ensure soundness and completeness of inference in conditions of changing source data. Soundness: Completeness:
We have proposed the repeated proving principle that is an alternative to nonmonotonic approach Nonmonotonic logic is a means formalizing the unsound (in classical sense) logical inference. Our task is to provide the classical soundness of logic program in dynamic outer world.
The idea of repeated proving Logicalactors Commonvariables Search space
Implementation of the repeated proving principle • Sequential control strategies supporting repeated proving. • Implicit parallelization of logic programs. • Syntactic means of explicit definition of concurrent processes.
The “Actor Prolog˝ project Theoretical results: • A logical interpretation of object-oriented programming. • Repeat proving of logical actors providing soundness in dynamic environment. • A new concurrent computing model. Logic programming technology issues: • Visual programming based on SADT (Structured Analysis and Design Technique). • Component-oriented programming. Implementation issues: • All the Actor Prolog agents are persistent. • Predefined classes support FTP andHTTP now. • You are welcome to participate in beta testing of Actor Prolog(http://www.cplire.ru/Lab144).
Logic Object-Oriented Modelof Asynchronous Concurrent ComputationsRFBR project no. 00-01-005602000-2002
Why Logical? The computing model is based on the logic programming principles: • The model supports model-theoretic semantics: any concurrent program is an implementation of an algorithm and a logical formula at the same time. • There are mathematically strict criteria of correctness of the Web agent: soundness and completeness. • The possibility of logical inference with incomplete input data is essentially used in the model (speculative computations).
Why Asynchronous Concurrent Computations? The delays of processes are not used for synchronizing processes in our computing model. Speculative computing and subsequent modification of logic inference are used instead of delays.
Why Object-Oriented? Process is a class instance in the concurrent version of Actor Prolog, whose clauses are executed concurrently relative to clauses of other processes.
Basic Components of the Model • Process state • Proven • Failed • Unused • Messages • Flow • Direct Residents
Process States A proven process. This state is characterized by the consistency of all actors of the process (the proof of all actors was successful). A failed process. This state is characterized by the fact that actors of the process are inconsistent. An unused process. The unused process can be considered as some offline component of a computing device. The processes automatically pass into this state and automatically recover from it when certain special flow messages are obtained.
Flow messages A process can pass information to other processes by changing the value of their common variable. Common variables that connect processes are called ports.
Ports of Processes • Plain ports. • Protecting ports. A protected value of a common variable can only be replaced by another protected value. • Suspending ports. Suspending ports serve for automatic passing of processes in the unused state and for their automatic recovering from this state.
Direct messages A process can perform an asynchronous predicate call in the other process. The so-called informational and switching direct messages are distinguished.
The informational and switching direct messages differ by the following: 1.As a result of processing of a switching direct message, the process can become either proven or failed, while after processing of the informational direct message, the process is always proven. If the execution of an informational direct message fails, this message is simply ignored and the process restores its former state. 2.In contrast to switching direct messages, processing of informational direct messages is suspended until the recipient process becomes proven. The suspended messages are accumulated in the buffer.
Residents The resident is a certain active entity observing the state of assigned (target) process and sending the collected information to its owner. After each change in the state of the target process, the resident repeats the construction and sending of the list of values of the function.
The following correspond to each resident of the program: The owner of the resident. The owner of the resident is the process that has created it. The atomic formula. This formula denotes the call of a certain function (nondeterministic in the general case) which must be executed in the target process. The functions in Actor Prolog are implemented with the help of standard technique of program flattening. The target process of a resident. A common variable. Using it, the resident sends the collected information to its owner.
The difference between flow and direct messages consists in the following: 1.Direct messages are passed directly from one process to another (in the form of the predicate call), while the flow messages are passed from one to many processes (by changing the values of common variables). 2.Direct messages are not lost in the course of communication, while the flow messages can cancel one another if a new (updated) value of a common variable arrives before the processing of the previous value has started.
Definition 1.We say that the logic program has attained its successful final state if: All the processes of the program are proven or unused. Activation of residents is not required. The processing of no messages by processes and residents is required. Definition 2.The result computed by the program are the values of common variables connecting the processes of a program that has reached a successful final state.
Model-theoretic semantics of concurrent programs We have defined a scheme of transformations of an arbitrary concurrent logic program P into the sequential program P' for which the existence of the classical model-theoretic semantics is guaranteed. The declarative semantics of the program P' is taken as the semantics of the source program P.
Theorem 1.A concurrent logic program is sound in respect to its model-theoretic semantics.
Theorem2.The concurrent program is complete in respect of its model-theoretic semantics if 1. There are no non-logical built-in predicates in the text of the program. 2. Direct messages are not used. Information between processes is transmitted only via the flow messages. 3. The program does not get caught in an endless loop in the course of execution of goal statements and functions of residents. 4. The functions called by residents always return a finite number of values. 5. Predicates computing data which are then sent by means of flow messages are deterministic. 6. Information is transmitted between processes along one-direction channels only. The unidirectional data transmission in the Actor Prolog can be modeled by means of the protecting keyword. 7. There is a partial ordering of processes exchanging information. That is, there is no recursive transmission of data between the processes and residents in the program. 8. All values computed by processes and residents which must be passed to other processes and residents are ground (i.e., they do not contain unbound variables).
The main results of the RFBR00-01-00560 project (2000-2002) • We have developed a new concurrent computing model for logic programming. This model differs from others in the following: the model provides soundness and (in some special cases) completeness of concurrent logic programs being executed in dynamic outside world, such that input data of the logic program could be modified after the start of the program. • The conditions of classical soundness and completeness of logic programs being executed in dynamic outside world have been investigated. • We have developed methods and syntactic means for logical description and analysis of the Web. • We have designed and implemented an experimental system for logical search and recognition in the Internet on the basis of developed mathematical apparatus. In particular, we have developed methods of visual component-oriented logic programming of persistentWeb agents. • We have created several Web agents collecting information in the Internet. The experiments with these agents have demonstrated expediency and effectiveness of developed methods of logic programming the Web agents.
You are welcome to participate in beta testing of Actor Prolog http://www.cplire.ru/Lab144/space/prolog.html
References • Morozov A.A. Actor Prolog: an Object-Oriented Language with the Classical Declarative Semantics // Proc. of IDL'99 workshop. – Paris, France, September 27-28, 1999. • Morozov A.A., Obukhov Yu.V. On the Problem of Logical Recognition in the Dynamic Internet Environment // Pattern Recognition and Image Analysis. – 2001. – Vol.11. – No.2. – pp.454-457. • Morozov A.A., Obukhov Yu.V. An Approach to Logic Programming of Intelligent Agents for Searching and Recognizing Information on the Internet // Pattern Recognition and Image Analysis. – 2001. – Vol.11. – No.3. – pp.570-582. • Morozov A.A. On Semantic Link Between Logic, Object-Oriented, Functional, and Constraint Programming // Proc. of MultiCPL'02 workshop. – Ithaca, USA, September 8, 2002. – pp.43-57. • Morozov A.A., Obukhov Yu.V. Development of the Methods and Tools for Mathematically Correct Logic Programming of Internet Agents // Pattern Recognition and Image Analysis. – 2003. – Vol.13. – No.2. – pp.225-227.
References • Morozov A.A. Logic Object-Oriented Model of Asynchronous Concurrent Computations// Pattern Recognition and Image Analysis. – 2003. – Vol.13. – No.4. – pp.640-649. See also: Morozov A.A. Getting Started in Actor Prolog. – IRE RAS: 2002. – http://www.cplire.ru/Lab144/start/index.html
Discussion Alexei A. Morozov Institute of Radio Engineering and Electronics RAS Mokhovaya 11, Moscow 125009, Russia morozov@mail.cplire.ru
Comparison with the Nonmonotonic Approach New data arrive in the form of terms (data items) rather than in the form of logical statements. If the input data have been changed, it is only necessary to prove once again certain subgoals. We stay in the framework of classical monotonic logic. We have saved all its descriptive and deductive abilities.