Communication between prolog and an external process
AssigneeInternational Business Machines Corporation
InventorGilbert J. A. Rouquie
Life of this patent
Estimating the term…
Abstract
An improved architecture for a list processing language interpreter/compiler is described to facilitate two-way communication between list processing programs and other external processes. The new architecture employs a table driven approach to translate arguments from the list processing language to arguments that other external processes expect. Additional capability for accessing list processing programs from external processes is also provided.
Claims14
Method for communicating information in a computer system between a program written in a first computer programming language and having an external reference to a subprogram and a subprogram having parameters including a computer programming language structure having at least one level, being written in a second computer programming language and resolving the external reference, the system having a memory and a processor, comprising the steps of:
- (a) building, using the processor of the computer system, in the memory of the computer system, prior to execution of the program, linkage information associating the external reference to a routine and a parameter descriptor list in the subprogram, for communicating between the program and the subprogram, the parameter descriptors in the parameter descriptor list specifying the data type of each parameter and for each level in the computer programming language structure indicating the opening of the level of the computer programming language structure, the data type of elements in the level of the structure and the closing of the level of the computer programming language structure;
- (b) converting, using the processor of the computer system, each parameter for the external reference into the data type specified in the parameter descriptors in the linkage information;
- and
- (c) communicating, using the processor of the computer system, during execution of the program, the converted parameters from step (b) from the program to the subprogram.
Apparatus for communicating information between a program written in a first computer programming language and having an external reference to a subprogram and a subprogram written in a second computer programming language resolving the external reference and having parameters including a computer programming language structure having at least one level, the apparatus having a memory and a processor, comprising:
- (a) means for building, in the memory using the processor of the computer system prior to execution of the program, linkage information associating the external reference to a routine and a parameter descriptor list in the subprogram, for communicating between the program and the subprogram, the parameter descriptors in the parameter descriptor list specifying the data type of each parameter and for each level in the computer programming language structure indicating the opening of the level of the computer programming language structure, the data type of elements in the level of the structure and the closing of the level of the computer programming language structure;
- (b) means for converting, using the processor of the computer system, each parameter for the external reference into a data type specified in the parameter descriptor list;
- and
- (c) means for communicating, using the processor of the computer system, during execution of the program the converted parameters generated by the means for converting, from the program to the subprogram.
A method for operating a computer system, having a memory and a processor, to process Prolog programs having predicates and expressions, and having an external reference to a subprogram written in a first computer programming language other than Prolog, the external reference having an input and an output parameter, the input parameter being a computer programming language structure having at least one level, the program and subprogram in the memory, comprising the steps of:
- reading, using the processor of the computer system, a predicate list in the memory in the subprogram to find an executable address, an input parameter descriptor list and an output parameter descriptor for the external reference, the input parameter descriptor list indicating the opening of each level of the structure, the data types of elements in the structure and the closing of each level of the structure;
- converting each element of the structure, using the processor of the computer system, from a Prolog data type into a converted input parameter having a data type for the first computer programming language, according to one of a set of predetermined procedures designated by each input parameter descriptor;
- storing, using the processor of the computer system, each converted input parameter in the memory accessible to the subprogram;
- calling, using the processor of the computer system, the executable address for the external reference with the converted input parameters, thereby generating the output parameter:
- converting, using the processor of the computer system, the output parameter, into a converted output parameter in a Prolog data type according to one of a set of predetermined procedures designated by the output parameter descriptor;
- and
- storing, using the processor of the computer system, the converted output parameter in the memory accessible to the Prolog program.
Dependencies are inferred from the claim text.