CN111611004B - Program synthesis using notes based on enumeration patterns - Google Patents

Program synthesis using notes based on enumeration patterns Download PDF

Info

Publication number
CN111611004B
CN111611004B CN202010115148.5A CN202010115148A CN111611004B CN 111611004 B CN111611004 B CN 111611004B CN 202010115148 A CN202010115148 A CN 202010115148A CN 111611004 B CN111611004 B CN 111611004B
Authority
CN
China
Prior art keywords
item
items
annotated
predicate
rules
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010115148.5A
Other languages
Chinese (zh)
Other versions
CN111611004A (en
Inventor
岩间太
立石孝彰
斋藤新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Publication of CN111611004A publication Critical patent/CN111611004A/en
Application granted granted Critical
Publication of CN111611004B publication Critical patent/CN111611004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • G06N5/022Knowledge engineering; Knowledge acquisition
    • G06N5/025Extracting rules from data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/77Software metrics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation

Abstract

A system for program synthesis using enumeration pattern-based annotation, comprising: a memory device for storing program code, and at least one processor device operatively coupled to the memory device. The at least one processor device is configured to execute program code stored on the memory device to obtain a set of annotated items, the set including one or more items, each item annotated with an enumeration pattern; translating the problem text into a formal specification using natural language processing, the formal specification being described as a set of rules associated with predicates; and synthesizing one or more items of the set of rules that satisfy the formal specification based on the set of annotated items to generate the computer program.

Description

Program synthesis using notes based on enumeration patterns
Background
The present invention relates generally to artificial intelligence and machine learning, and more particularly to program synthesis using annotations based on enumeration patterns.
Attempts to synthesize a computable expression (e.g., program, function, data) from a declaratively written formal expression can be done at different levels (e.g., compiler, interpreter, domain-specific language (specific language, DSL), code fragments from a configuration file). In program synthesis, when predicates (predicates) are used differently in a computation, a logic formula may be described with different predicates even though the predicates have the same meaning. In such a framework, declarative descriptions that can be converted into programs are limited to those described in a more conscious manner as to how logical expressions are used in computation.
Disclosure of Invention
According to an embodiment of the present invention, a system for program synthesis using annotations based on an enumeration pattern is provided. The system includes a memory device for storing program code, and at least one processor device operatively coupled to the memory device. The at least one processor device is configured to execute program code stored on the memory device to obtain a set of annotated items, the set including one or more items, each item annotated with an enumeration pattern; translating the problem text using natural language processing into a formal specification (formal specification), the formal specification being described as a set of rules associated with predicates; and synthesizing one or more items of the set of rules that satisfy the formal specification based on the set of annotated items to generate the computer program.
According to another embodiment of the present invention, a computer-implemented method for program synthesis using annotations based on an enumeration pattern is provided. The method comprises the following steps: obtaining a set of annotated items, the set comprising one or more items, each item annotated with an enumeration pattern; translating the problem text into a formal specification using natural language processing, the formal specification being described as a set of rules associated with predicates; and synthesizing one or more items of the set of rules that satisfy the formal specification based on the set of annotated items to generate the computer program.
These and other features and advantages will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings.
Drawings
The following description will provide details of preferred embodiments with reference to the following drawings, in which:
FIG. 1 is a block/flow diagram of an overview of a system/method for program synthesis according to an embodiment of the invention;
FIG. 2 is a block diagram of a system for program synthesis using enumeration pattern based annotation in accordance with an embodiment of the present invention;
FIG. 3 is a block/flow diagram of a system/method for program synthesis using enumeration pattern-based annotation according to an embodiment of the invention;
FIG. 4 is a block diagram of a processing system according to an embodiment of the invention;
FIG. 5 is a block diagram of an illustrative cloud computing environment having one or more cloud computing nodes with which a local computing device used by a cloud consumer communicates in accordance with an embodiment of the present invention; and
FIG. 6 is a block diagram of a set of functional abstraction layers provided by a cloud computing environment, in accordance with an embodiment of the invention.
Detailed Description
The embodiments described herein provide systems and methods for program synthesis using annotations based on an enumeration pattern. The present invention may be a system, method and/or computer program product at any possible level of technical details. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present invention may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information for computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Reference in the specification to "one embodiment" or "an embodiment" of the present invention and other variations thereof means that a particular feature, structure, characteristic, or the like described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment.
It should be understood that the use of any of the following "/", "and/or" and "at least one", for example, in the case of "a/B", "a and/or B" and "at least one of a and B", is intended to include the selection of only the first listed option (a), or only the second listed option (B), or both options (a and B), unless otherwise defined herein. As another example, in the case of "A, B and/or C" and "at least one of A, B and C", such a phrase is intended to include selecting only the first listed option (a), or only the second listed option (B), or only the third listed option (C), or only the first and second listed options (a and B), or only the first and third listed options (a and C), or only the second and third listed options (B and C), or all three options (a and B and C), unless otherwise defined herein. As will be readily apparent to those of ordinary skill in the art and related arts, this may be extended for many of the items listed.
Referring now to the drawings, in which like numerals represent the same or similar elements, and initially to FIG. 1, a block/flow diagram is provided that illustrates an overview of a system/method 100 for program synthesis using annotations based on an enumeration pattern.
At block 110, one or more external predicates may be mapped to one or more corresponding computable terms (term). An external predicate is a predicate that is independently defined by a user. For machines that interpret external predicates, a user may provide information that connects the external predicate to a computable item. Such information may include annotations or assertions (e.g., tables or functions) that can map each external predicate to its corresponding computable term.
At block 120, a computer program is generated based on the mapping.
Further details regarding the system/method 100 of fig. 1 are described in further detail below with reference to fig. 2-6.
Referring to FIG. 2, a block diagram illustrating a computer system 200 is provided. In one embodiment, the computer system 200 includes a deduction database system (deductive database system). A deduction database system may refer to a database system capable of deduction based on rules and/or facts stored in the database. Deduction database systems may be implemented in a variety of computer-related operations including, but not limited to, data integration, information extraction, networking, program analysis, security, and cloud computing.
The system 200 may use natural language processing to convert sentences into logical expressions that include external predicates and generate programs from the logical expressions by converting the logical expressions into computable terms using existing terms. The logical expressions may be expressed in a manner that is aware of how the logical expressions are used in the program synthesis of the logical formula to term conversion system. The system 200 can determine whether a given logical formula including one or more external predicates can be converted to a computational term by combining existing terms annotated with an enumeration pattern. If the declarative description is automatically or semi-automatically generated such that predicates used in the declarative description to be converted are not necessarily in a format that facilitates program conversion, system 200 may enable a program to synthesize a wider logical expression that may use external predicates in a more flexible manner.
More specifically, the system 200 may use a logical programming language to specify facts, rules, and/or queries in the deduction database system. Illustratively, the logic programming language may be Datalog, although other logic programming languages are also contemplated. Datalog may perform program synthesis from a logical expression to a table containing tuple data, where primitive predicates (primitive predicate) in the logical expression indicate the table.
Exemplary external predicates, annotations, and logical expressions are described below:
an external predicate, succ (n, m) (predicate means that m is 1 greater than n, where m and n are integers);
note that sacc (n, m) = > n+1=m (mapping from sacc to a function that takes n and computes m), where "= >" represents a mapping;
the logical expression is Ans (k): -n=3, sacc (n, a), sacc (k, a×2) (k is solved for the solution, 3+1=a and k+1=a×2), where "×" denotes multiplication.
The above example cannot currently be handled by the Datalog system because the sacc (n, m) can only be converted into a computable item in the context of the m-from-n computation. Thus, the portion n=3, the succc (n, a) can be converted into a calculable item, but the Succk,4*2 cannot be converted into a calculable item.
In Datalog, formulas can be described using two different external predicates. For example, the external predicates may include Plus1 (n, m) and Minus1 (n, m). In this example, the annotations may be expressed as Plus1 (n, m) = > n+1=m and Minus1 (n, m) = > n-1=m, and the resulting logical expression may be expressed as Ans (k): n=3, plus1 (n, a), minus1 (a×2, k). This can be converted into a computable term (3+1) ×2-1 as a solution k to the logical expression Ans (k). Thus, according to embodiments described herein, datalog formulas with external predicates for logical expressions may be transformed.
In one embodiment, system 200 includes an automated program and/or problem-solving system that receives natural language descriptions as input and returns generated programs and/or running problem solutions. For example, the input may be text and/or speech that expresses a problem to be solved using the system 200. More specifically, the system 200 may include a front-end portion associated with natural language processing performed to convert received input into a logical formula, and a back-end portion associated with converting the logical formula into terms (e.g., programs or data). The automation program and/or the problem-solving system may be integrated in a software agent, a robot, etc. Tasks are performed using an automation program and/or a problem-solving system.
As shown, the system 200 includes a computing device 210 in communication with a processing device (e.g., server) 220 interconnected via at least one communication network ("network") 230, the computing device 210 being capable of program or data synthesis from a (declarative) formal specification (formal specification).
In the illustrative embodiment, only one computing device 210 and processing device 220 are shown for simplicity. However, according to embodiments described herein, system 200 may include multiple computing devices and/or processing devices. Thus, it should be understood that FIG. 2 provides an illustration of one embodiment only, and is not meant to be limiting of the environment in which the different embodiments may be implemented, and that many modifications to the depicted environment may be made based on design and implementation requirements.
The network 230 may include various types of communication networks such as a wide area network (wide area network, WAN), a local area network (local area network, LAN), a telecommunications network, a wireless network, a public switched network, and/or a satellite network. Network 230 may include connections, such as wire, wireless communication links, or fiber optic cables.
Computing device 210 may include a processor 212 and a data storage device 214 capable of hosting and running a software program 216 and a logic conversion program 218A, and communicates with a processing device 220 via a network 230. Computing device 210 may be, for example, a mobile device, a telephone, a personal digital assistant, a netbook, a laptop computer, a tablet computer, a desktop computer, or any type of computing device capable of running a program and accessing a network.
The processing device 220 may be a laptop computer, a netbook computer, a Personal Computer (PC), a desktop computer, or any programmable electronic device or network of any programmable electronic devices capable of hosting and running the logic conversion program 218B and the database 222. The processing device 220 may also operate in a cloud computing service model, such as software as a service (Software as a Service, saaS), platform as a service (Platform as a Service, paaS), or infrastructure as a service (Infrastructure as a Service, iaaS).
The software program 216 may represent any program or suite of programs that invokes the logic conversion program 218A, 218B or communicates with the logic conversion program 218A, 218B. The logic conversion programs 218A, 218B may be used to generate programs from logic formulas that include predicates. More specifically, the logic conversion programs 218A, 218B may convert a logic formula as a specification (e.g., a rule) into terms (programs or data) that satisfy the specification. The specification may be described more declaratively based on a set of annotated items (e.g., using the same predicates to describe relationships that have the same meaning, regardless of how the relationships are implemented in program synthesis). For example, the system 200 may implement Datalog using predicates to formalize a problem, which may increase the ability to implement a deductive database system by more flexibly handling external predicates (e.g., using predicates not only as unidirectional operations, but also as relationships). It is to be appreciated and understood that system 200 may implement other logic programming languages besides Datalog in accordance with embodiments described herein.
Further details regarding the operation of the system 200 (including the logic conversion programs 218A, 218B) will now be described with reference to fig. 3.
Referring to FIG. 3, a block/flow diagram is provided that illustrates a system/method 300 for program synthesis for external predicates using enumeration pattern-based annotation. As will be described in further detail, the system/method 300 may infer items that satisfy a given set of rules based on a set of annotated items. An exemplary enumeration pattern (e.g., binomial enumeration pattern) of predicates P (x, y) is provided as follows:
(1) P (x, y|) -, where the "|" symbol as used herein refers to "all" enumeration, and the "-" symbol refers to an empty variable sequence. That is, the items annotated with this enumeration pattern are data sets that enumerate all x and y that satisfy P (x, y) (e.g., the items are functions that return a set of all x and a set of all y that satisfy P (x, y));
(2) P (x, y < | > -), where the "<|" symbol as used herein refers to "partial" enumeration. That is, the item annotated with this enumeration pattern is to enumerate some x and y datasets that satisfy P (x, y) (e.g., the item is a function that returns some x sets and some y sets that satisfy P (x, y));
(3) P (x < |y), P (y < |x). The term annotated with this pattern is a function that enumerates some y (or some x) that satisfy P (x, y) given x (or y) (e.g., the term is a function that returns some y (or some set of x) that satisfy P (x, y) for each given x (or y);
(4) P (x|y), P (y|x). The term annotated with this pattern is a function that enumerates all y (or x) that satisfy P (x, y) given x (or y) (e.g., the term is a function that returns for each given x (or y) a set of all y (or a set of all x) that satisfy P (x, y); and
(5) P (true|x, y), P (false|x, y). The term annotated with this enumeration pattern is a function that returns true/false if x, y satisfies P (x, y).
The enumeration pattern of n-ary predicates may be similarly defined. The type may be an additional predicate parameter, as desired. For example, and type T 1 And T 2 The enumeration pattern associated with predicate P may be P (x: T) 1 |y:T 2 )。
At block 310, a collection of annotated items is generated. Each item in the set of annotated items, also referred to herein as set a, may be annotated with an enumeration pattern for each predicate. Generating a set of annotated items may include preparing the items (e.g., table data and/or function code) as building blocks, and annotating an enumeration pattern for each item using predicates that may be used in a possible formal specification. In some embodiments, the set of annotated items may be generated by an engineer.
The annotated set of terms represents a knowledge base of how each predicate can be implemented or implemented as a term. For example, the dataset (or table data) may be interpreted as an item annotated with the enumeration pattern P (x|-) of predicate P, and the function may be interpreted as an item annotated with Q (x|z) of predicate Q
At block 320, the question text is translated into a form specification. According to embodiments described herein, translation may be performed using any suitable natural language processing technique. For example, the formal specification may be described by an engineer or may be generated and received from another system.
The form specification describes a set of rules associated with predicates. For example, the formal specification may be described as a Datalog rule that includes predicates and tags (e.g., @ partial, @ given, @ all).
As used herein, @ partial means that some (but not all) elements need to be required, @ given means that the form specification requires an item (which must be a function) that satisfies P (x, y) given the value of the tag variable, and @ all means that all elements need to be required. For example, for the form specification P (x@all, y@givens): -R (y, z), Q (z, x), a function may be synthesized that returns x from y that satisfies R (y, z) and Q (z, x).
Let a rule set (e.g., a logical formula) comprising a set of extended rules (e.g., extended Datalog rules) be defined as R s . Rule set R s A target relationship (e.g., a set of extended Datalog rules) may be included. For example, rule set R s The extended Datalog rule of (2) may be of the form:
head:-body 1 ,...,body n ,
head::=HR(x 1 @tag 1 ,...,x k @tag k ,y 1 ,..,y m ),
body::=L|not-L,and
L::=R(x 1 ,...,x n )
Wherein "head" refers to the atomic sign of the Head Relation (HR), each body k (1. Ltoreq.k. Ltoreq.n) is the atomic symbol of the word (letter) L or the word negative non-L. That is, the HR may include a target tag, and "body 1 ,...,body n "refers to a series of words L or word negation non-L. Each letter L may refer to a body relationship R (x 1 ,…,x n ) And when items of an enumeration pattern using a relationship are defined in the set a, the body relationship R (x 1 ,…,x n ) May be predicates. In general, "head: -body 1 ,...,body n "when all relationships" body 1 ,...,body n "(e.g.," body 1 ,...,body n "all relationships in the relationship series referred to) are established, the relationship a is established (" the relationship referred to by head ").
At block 330, at least one item meeting the formal specification is synthesized based on the set of annotated items to generate a scoreA computer program. The at least one synthesized item may include, for example, table data or a program. More specifically, the at least one synthesized item may be included in a rule set R that may satisfy set A s Set t of items of target relation of (2) s Is a kind of medium. The synthesis may be performed by searching the knowledge base for acceptable combinations of items using information annotated to the enumeration pattern of each item. In one embodiment, synthesizing at least one item that satisfies the form specification includes assigning each predicate P in the form specification a term T annotated with an enumeration pattern using the predicate P to obtain a combination of terms, and checking that the combination of terms satisfies the logical formula by using an enumeration pattern annotated to the assigned term.
More specifically, synthesizing the at least one term may further include, at block 332, assigning an implementation type and term to each instance of the predicate with a given rule based on the interpretation process. For example, the implementation type may be rt 1 ,..,rt k Form of (c), and set of items t s May be t 1 ,...,t k In the form of (a). The allocation may generate an implementation statement (statement).
The implementation type may be [ x/y|z]Or [ b|z ]]Wherein b is true or false. The syntax "x/y" as used herein will be equal to x (e.g., x 1 ,...,x n ) The associated variable is derived from the variable associated with y (e.g., y 1 ,...,y m ) And (5) separating.
In the form of [ x/y|z]The implementation type of (c) refers to a function that takes z and returns a set that includes all x and some y. More specifically, the implementation type [ x/y|z]It may mean that the statement A| -R is implemented 1 ,..,R n |>t:[x 1 ,...,x n /y 1 ,...,y m |z]Each term t in (1) enumerates R as given z 1 ,...,R n X of (2) 1 ,...,x n All values of (2) and y 1 ,...,y m Is a function of the value of (a). The syntax "a| -B" as used herein means "under A, B, and the syntax" R "as used herein 1 ,...,R n |>t: R "means" R is implemented by the term t according to the implementation type R 1 ,...,R n ”。
In the form of [ b|z]The implementation type of (c) refers to a function that takes z and returns true or false, since b can be true or false. More specifically, the implementation type may be [ x ] 1 ,..,x n /y 1 ,..,y m |z 1 ,..,z k ]Or [ b|z ] 1 ,..,z k ]In the form of (1), wherein x 1 ,..,x n ,y 1 ,..,y m And z 1 ,..,z k Is a variable.
When item t and implementation type r t Can be assigned to a series of relationships R 1 ,..,R n And aggregateIncluding rule set R s The implementation statement "A| -R" may be written when the implementation statement of all instances of predicate P occurs in 1 ,..,R n |>t:r t ”。
Realization statement A| -R 1 ,..,R n |>t:[x 1 ,..,x n /y 1 ,..,y m |z 1 ,..,z k ]Meaning that given z 1 ,..,z k ,t(z 1 ,..,z k ) Enumerating all x 1 ,..,x n And some y 1 ,..,y m So that x is 1 ,..,x n ,y 1 ,..,y m And z 1 ,..,z k Satisfy R 1 ,..,R n
Realization statement A| -R 1 ,..,R n |>t:[b|z 1 ,..,z k ]Meaning that given z 1 ,..,z k If z 1 ,..,z k Satisfy R 1 ,..,R n ,t(z 1 ,..,z k ) Return b (true or false).
Realization statement A| -R 1 ,..,R n |>t:[x 1 ,..,x n /y 1 ,..,y m |-]Meaning that t enumerates all x 1 ,..,x n And some y 1 ,..,y m So that x is 1 ,..,x n ,y 1 ,..,y m Satisfy R 1 ,..,R n
Synthesizing the at least one item may also include, at block 334, performing a merging process associated with the text based on the interpretation process. Performing the merging process may include merging words or implementation statements of words in each rule based on the interpretation process. For example, if the target implementation types can be merged, the predicates and the implementation types can be merged at the same time based on the interpretation process. If the implementation types cannot be merged, the system/method may attempt to merge other words. If the system/method fails to incorporate any combination of words under the allocation, the system/method may discard the allocation. The merge may be performed until all possible implementation statements are obtained based on the merge.
For example, assume that an implementation statement A| -P has been obtained at block 532 1 |>t 1 :[x,y/-|-]And A| -P 2 |>t 2 :[y/-|z]Which refers to the use for P 2 The function taking z and returning y, and assuming that all data sets (x, y) satisfy P 1 . Here, for the rule HR (x, z@givens): P 1 (x,y),P 2 (y, z), text P 1 (x, y) and P 2 (y, z) can be combined to obtain the implementation statement A| -P 1 ,P 2 |>λ z .{x|<x,y>in t 1 and y=t 2 (z)}:[x/-|z]Wherein lambda is z .{x|<x,y>in t 1 and y=t 2 (z) is a function that takes z and returns the set of x to make the tuple<x,y>Is included at t 1 In (c), and y=t 2 (z) (satisfy P in the sense that the function takes z and returns x 1 、P 2 Wherein x, z satisfy P 1 (x, y) and P 2 (y,z))。
As another example, consider the formal specification P (y@all, x@given): -R (y, w), Q (w, z), S (z, y). Examples of the implementation types that may be assigned to predicates R, Q and S are as follows:
R(y,w)|>t r :[true|y,w],
Q(w,z)|>t q :[z|-/w],
S(z,x)|>t s :[z|-/x].
the system/method may attempt to combine R and Q, then Q and S, then R and S. However, the result of this merge attempt is that all merge attempts fail. Thus, the system/method may relinquish the allocation. Conversely, another example of the implementation types that may be assigned to predicates R, Q and S is as follows:
R(y,w)|>t r :[y|-/w],
Q(w,z)|>t q :[w|-/z],
S(z,x)|>t s :[z|-/x].
the system/method may attempt to combine R and Q and obtain R (y, w), Q (w, z) |>λz.{<y,w>|w=t q (z),t r (w)=y}:[y|-/z]. Here, R and Q may be combined, and the implementation type [ y| -/w]And [ w ] -/z ]Can be combined to [ y, w|-/z ]]. The system/method may then merge R, Q and S, and implement the type [ y| -/w]And [ z ] -/x]May also be combined. Thus, "R (y, w), Q (w, z), S (z, x) | can be obtained>t:[y,w,z|-/x]", where t=λx.. {<y,w,z>|w=t q (z),t r (w)=y,z=t s (x)}。
Synthesizing the at least one term may also include, at block 336, obtaining a rule set R s Realization statements of each head statement in (a).
For example, for rule HR (x 1 ,...,x k ):-L 1 ,...,L n (target tag is not related to the step here) for statement A| -L 1 ,...,L n :t|>r t The statement A| -HR (x) 1 ,...,x k )|>t|>r t . In other words, if at r t In the sense that term t satisfies L 1 ,...,L n Then at r t The term t also satisfies HR in the sense of (2). For example, for rule HR (x, z@givens): P 1 (x,y),P 2 (y, z) the following implementation statement can be obtained: a| -HR (x, z@givenn) |>λ z .{x|<x,y>in t 1 and y=t 2 (z)}|[x/-|z]。
Synthesizing the at least one item may also include, at block 338, checking the target tag of each implementation statement.
For example, for rule "HR (x 1 @all...x k @all,y 1 @partial,...,y n @partial,z 1 @given,...,z m @given):-L 1 ,...,L n "OR statement" A| HR (. First of all) is the same>t:[x 1 ...x k /y 1 ...y n |z 1 ...z m ]The term t may be output as a program or data that satisfies HR (. For the statement "A| -HR (x, z@givenn) |>λ z .{x|<x,y>in t 1 and y=t 2 (z)}|[x/-|z]", term lambda z .{x|<x,y>in t 1 and y=t 2 (z) may be output as a function of HR (x, z@given).
The process may return to block 334 to obtain other implementation statements to generate a computer program.
At block 340, a computer program is output. The computer program may be output in any suitable manner. For example, the computer program may be stored in a database, transmitted or sent over a network to one or more entities, and so forth.
The interpretation rules of the interpreter may define how the implementation statements are inferred.
Interpretation rule [ basic rule ]]Predicates (i.e., relationships used in the enumeration pattern in a) are assigned to the implementation statements. For example, if P (true|x in A 1 ,..,x k ) A| -P (x) can then be inferred 1 ,..,x k )|>[true|x 1 ,..,x k ]。
Interpretation rules [ rules: V-V]Fusing two series of relationshipsAnd->Wherein the method comprises the steps ofAnd->Has been deduced, and->And->Both are [ x ] 1 ,..,x n /y 1 ,..,y m |z 1 ,..,z k ]In the form of (a). This interpretation rule yields two possible implementation statements.
Interpretation rule [ rule: T-T]Combining two series of relationshipsAnd->Wherein the method comprises the steps ofAnd->Has been deduced, and->And->Both are [ b|z 1 ,..,z k ]In the form of (a). For example, from A| -R 1 (x,z)|>t 1 :[true|x,z]And A| -R 2 (y,z)|>t 2 :[false|y,z]We get A| -R 1 (x,z),R 2 (y,z)|>t 12 :[true&false|x,y,z]Wherein t is 12 =λx,y,z(true=t 1 (x,z)and false=t 2 (y, z)). That is, t 12 The function takes x, y, z and computes true=t 1 (x, z) and false=t 2 (y, z) and returns the resulting boolean value.
Interpretation rule [ rule: T-V]Combining two series of relationshipsAnd->Wherein the method comprises the steps ofAnd->Has been deduced, is- >Is [ x ] 1 ,..,x n /y 1 ,..,y m |z 1 ,..,z k ]Form of (2), and->Is [ b|z ] 1 ,..,z k ]In the form of (a).
Interpretation rule [ Weak rule: W-C]Meaning that we can followObtainingThus, this interpretation rule means that the order of the relationships can be changed.
Interpretation rule [ Weak rule: W-P]Meaning that we can followObtainingTherefore, this interpretation rule means that if used +.>Is declared as all enumerated, some of them may be declared enumerated.
Interpretation rule [ Weak rule: W-G]Meaning that we can followObtain->Wherein the method comprises the steps ofAndthe function t' takes x and y as inputs, and calculates t (z s ) And collectSo that->At t (z) s ) In, sum x=v x ,y=v y And return +.>Is a set of (3). This rule means that if +.>In the sense of (1), t implements R 1 ,..,R n (e.g., t enumerates satisfying R 1 ,..,R n And some y) of the sum of all x and some y) of the sum of all y can be obtained as the term t', whereIn the sense of (a) realizes R 1 ,..,R n (e.g., t' takes x and y and z s And return to satisfy R 1 ,..,R n Data set of->). Here, enumeration is used for +.>And->And enumerate all elements forAnd->Is a part of the elements of (a).
These example interpretation rules may be used to implement blocks 332 and/or 338.
Interpretation rules [ head rules: H ], which may infer implementation statements for head relationships from implementation statements for their body (e.g., series of body relationships), and may be used to implement blocks 336 and/or 338.
For example, consider the predicate "PrimeBaseRep (q, L)", which means that the natural number list L is a natural number q>Prime number base of 2 represents ("prime base representation, PBR"). The prime base of q represents a list of natural numbers [ p ] k ,e k ,...,p 1 ,e 1 ]Give out and makeAnd p is i (1.ltoreq.i.ltoreq.k) is a prime number and e i (1.ltoreq.i.ltoreq.k) is a positive integer and for (1.ltoreq.i<j≤k),p j >p i . For example, the prime basis of q=12 can be represented by [3,1,2,2 ]]Given, because of 3 1 ×2 2 =3×4=12. Assuming that two programs convertPBR (q) and primeNumberOf (L) are used to calculate the prime number of prime base representation of prime number q and prime number base representation L, respectively, convertPBR (q) and primeNumberOf (L) can be annotated with the following enumeration pattern:
convertToPBR(q)>>PrimeBaseRep(L|q),
primeNumberOf(L)>>PrimeBaseRep(q|L).
these annotated items may be included as a knowledge base comprising a dataset.
Now consider the form specification "Solution (nlst@given, mlst): -primebasetrep (y, nlst)," primebasetrep (y-1, mlst) ", which can be received as input. Here, nlst and mlst are variable names, where nlst is a list representing a prime representation, and mlst is a list representing a prime representation to be obtained by the system/method. That is, this particular formal specification corresponds to a request to synthesize a function that takes mlst given nlst, where mlst and nlst satisfy PrimeBaseRep (y, nlst) and PrimeBaseRep (y-1, mlst). The formal specification may be automatically generated from a natural description based on a knowledge base using natural language processing, such as, "for a given prime base representation L, take the prime base representation of y-1, where the prime base representation of y is L". Note that the prime-based representation of the sentence form "x is y" can be translated into predicate PrimeBaseRep (x, y) using natural language processing.
In general, the implementation type [ x/y|z ] may represent an item in an abstract manner such that, given z, the item may generate all values of x and some values of y, where x, y, and z are variable names in a formal specification. In this illustrative example, the terms of the formal specification are abstracted by the system/method to the target implementation type [ mlst/- |nlst ].
To determine an implementation type that is acceptable to the target implementation type, the system/method may obtain one or more implementation types by assigning corresponding functions to predicates of the formal specification.
For example, the function convertToPBR may be assigned to both predicate PrimeBaseRep (y, nlst) and PrimeBaseRep (y-1, mlst), and the system/method may obtain the first implementation type using an enumeration pattern of annotations of the function convertToPBR[y/-|nlst],[y-1/-|mlst]. First implementation type->Can generate y from nlst and the first implementation type +.>Can generate y-1 from mlst. However, the first implementation typeFor the target implementation type [ mlst/- |nlst]Is unacceptable. Thus, the system/method may attempt to find another allocation.
For example, if the function primeNumberOf is assigned to a first predicate primeBaseRep (y, nlst) and convertToRPB is assigned to a second predicate primeBaseRep (y-1, mlst), the system/method may use the function convertToPBR: [ y/- |nlst: ],[mlst/-|y-1]To obtain a second implementation typeSecond implementation type->A first term that can generate y from nlst and a second term that can generate mlst from y-1 can be included. Second implementation type->The indication system/method can synthesize the target implementation type [ mlst/- |nlst]The procedure of the target case is represented because y can be generated from a given nlst by using the first assigned term and mlst can be generated from y by the second assigned term and y-1 calculated. Thus, the system/method can synthesize a program with an input of "nlst" and an output of "mlst when convertToPBR (primeNumberOf (nlst) -1)".
As another example, let the set a of items representing annotations on a database of partial knowledge of how to generate a program from a logical formula be given by:
{λz,w.le_int(z,w)>>LessThan(true|x,y),
λz.makeListTo(0,z-1)>>LessThan(y|x),
λz.z+1>>LessThan(y<|x),
λz,if(z%2=0)then true else false>>Even(true|x)}.
here, λx, y, z.f (x, y, z) refers to a function (λ -algorithm) having x, y, z as input, f (x, y, z) as output, and le_int (z, w) refers to a function that returns true only when ("iff") z < w. Then, lessThan (true|x, y) and the like may represent an enumeration pattern of the primitive predicate LessThan (x: int, y: int), where LessThan (x: int, y: int) represents that the integer x is less than the integer y.
Given the target predicate P and the logical formula fs (in propositional logic) from which the target predicate P is derived, we can generally translate them into rules (e.g., datalog rules). Let R s Becomes a set of rules. We want to generate possible terms (e.g., data or programs) that satisfy the target predicate, and thus satisfy R s . Questions may be addressed using A| -R s ~>t s (generating satisfaction R under knowledge base A) s Item t of (2) s ) To represent.
For example, let R s = { Q (x@all, y@all): -LessThan (x, y), myData (x, y), P (z@partial): -LessThan (y, z), myData (x, y) }, and assume that annotated item set a contains the following three annotated items:
λz,w.le_int(z,w)>>LessThan(true|x,y),
λx.x+1>>LessThan(y<|x),
{(1,2),(5,5),(9,8)}>>MyData(x,y|-),
where le_int (z, w) is the function that iffz < w returns true. For the predicate LessThan (x: int, y: int), y=x+1 is one possible integer satisfying LessThan (x, y), which is why "<|" is used for LessThan (y < |x) instead of "|". The solution to the target term t may be obtained, for example, according to the embodiments described herein, by:
Q(x,y)={(x,y)|le_int(y,x)=true and(x,y)in{(1,2),(5,5),(9,8)},
P(z@partial)={z|y+1and(x,y)in{(1,2),(5,5),(9,8)}},
where the solution t may be obtained as { (1, 2) } for Q (x, y) and {3,6,9} for P (z).
As another example, consider the problem text "take all integers z such that for the integer pair x, y, x (double) contained in the dataset S is z and z is y. The system/method may convert the question text into a logical expression and generate a program from the logical expression. For example, when the question text is converted to a logical expression, the following logical formulas (Datalog rules) Answer (z@all): -S (x, y), double (x, z), double (z, y) may be obtained. Here, S (x, y) represents an integer pair x, y contained in the data set S, and Double (a, b) represents two times or twice a is equal to b.
Now, assume that set a of annotated items includes the following annotated items of predicate Double (a, b):
t 1 >>Double(b|a),where t 1 =λa.{2a},
t 2 >>Double(a|b),where t 2 =λb.if(b mod 2==0)then{b/2}else{}.
first term t 1 Refers to a function that takes integer a and returns a set containing only integer 2a, and a second term t 2 Refers to a function that fetches integer b and iff b/2 is an integer then returns a set that contains only integer b/2, otherwise returns an empty set.
Further, assume set A also includes the following annotated terms S (x, y) of predicate S (x, y) { <1,4>, <2,4>, <3,4>, <2,8> } > > S (x, y|-) (this means we have a dataset of S).
According to the embodiments described herein, the following implementation statements may be inferred:
A|-S(x,y),Double(x,z),Double(z,y)|>t:[x,y,z|-/-],
Where t={<v x ,v y ,v z >|<v x ,v y >in S(x,y)and v z in t 1 (v x )and v y in t 2 (v z )}.
when t is calculated, "A| -R (x, y, z) | > { <1,4,2>, <2,8,4> }: [ x, y, z|/- ] for R (x, y, z) =S (x, y), double (x, z), double (z, y)", from which "A| -Answer (z@all) | > { <2>, <4> }: [ z|/- ]. Thus, the Answer to R (x, y, z) is { <2>, <4> }, according to the rule Answer (z@all).
Processing predicates in the manner described in this example is more flexible than in other systems/methods. For example, other systems/methods may require the use of different operators (e.g., -S (x, y), for Answer (z@all), z=2x, z=y/2, multiplied by 2 and divided by 2) to obtain a solution to formalize the same sentence "double of_is.
The embodiments described herein provide a program synthesis or generation framework. In this framework, an interpretation of each predicate based on a rule (e.g., a Datalog rule) is not predefined. Instead, the interpretation of each predicate may be dynamically selected from the set A of annotated items according to the context in which the predicate appears in the logical expression of the rule. This feature allows flexibility in using user-defined external predicates (e.g., not only in a specific form such as a one-way function, but also in various possible inference directions), rather than using built-in predicates that are assigned a specific interpretation.
According to the embodiments described herein, predicates do not merely represent table data, but may be interpreted differently depending on their location of occurrence and background knowledge (e.g., set A of annotated items). This allows a specification (e.g., datalog rules) to be described more declaratively in order to describe relationships with the same meaning using the same predicates, regardless of how these relationships are implemented in program synthesis.
Referring to FIG. 4, an exemplary processing system 400 to which the present invention may be applied is shown, according to one embodiment. The processing system 400 includes at least one processor (CPU) 104 operatively coupled to other components via a system bus 402. Cache 406, read Only Memory (ROM) 408, random access Memory (Random Access Memory, RAM) 410, input/output (I/O) adapter 420, voice adapter 430, network adapter 440, user interface adapter 450, and display adapter 460 are operably coupled to system bus 402.
First storage device 422 and second storage device 424 are operatively coupled to system bus 402 by I/O adapter 420. Storage devices 422 and 424 may be any of magnetic disk storage devices (e.g., magnetic or optical disk storage devices), solid state magnetic devices, and the like. Storage devices 422 and 424 may be the same type of storage device or different types of storage devices.
A speaker 432 is operatively coupled to system bus 402 by sound adapter 430. A transceiver 442 is operatively coupled to system bus 402 by network adapter 440. A display device 462 is operatively coupled to system bus 402 by display adapter 460.
First user input device 452, second user input device 454, and third user input device 456 are operably coupled to system bus 402 via user interface adapter 450. The user input devices 452, 454, and 456 may be any of a keyboard, mouse, keypad, image capture device, motion sensing device, microphone, device combining the functionality of at least two of the foregoing devices, and the like. Of course, other types of input devices may be used while maintaining the spirit of the present invention. The user input devices 452, 454, and 456 may be the same type of user input device or different types of user input devices. User input devices 452, 454, and 456 are used to input information to system 400 and to output information from system 400.
A program synthesis (Program synthesis, PS) component 470 is operatively coupled to the system bus 402. The PS component 470 is configured to perform one or more operations described above with reference to fig. 3. The PS component 470 may be implemented as a separate dedicated hardware device or as software stored on a storage device. In embodiments in which the PS component 470 is a software implementation, although the anomaly detector is shown as a separate component of the computer system 400, the PS component 470 can be stored on, for example, the first storage device 422 and/or the second storage device 424. Alternatively, the PS component 470 can be stored on a separate storage device (not shown).
Of course, processing system 400 may also include other elements (not shown) as would occur to one of skill in the art, as well as omitting certain elements. For example, various other input devices and/or output devices may be included in the processing system 400, depending on the particular implementation of the processing system 400, as will be readily appreciated by one of ordinary skill in the art. For example, various types of wireless and/or wired input and/or output devices may be used. Furthermore, additional processors, controllers, memories, etc. may also be utilized in various configurations, as will be readily appreciated by those of ordinary skill in the art. These and other variations of the processing system 400 will be readily apparent to those of ordinary skill in the art in light of the teachings of the present invention provided herein.
It should be understood that while the present disclosure includes a detailed description of cloud computing, embodiments of the teachings described herein are not limited to a cloud computing environment. Rather, embodiments of the invention can be implemented in connection with any other type of computing environment, now known or later developed.
Cloud computing is a service delivery model for convenient, on-demand network access to a shared pool of configurable computing resources. Configurable computing resources are resources that can be quickly deployed and released with minimal administrative costs or minimal interaction with service providers, such as networks, network bandwidth, servers, processes, memory, storage, applications, virtual machines, and services. Such cloud patterns may include at least five features, at least three service models, and at least four deployment models.
The characteristics include:
on-demand self-service: a consumer of the cloud can unilaterally automatically deploy computing capabilities such as server time and network storage on demand without human interaction with the service provider.
Wide network access: computing power may be obtained over a network through standard mechanisms that facilitate the use of the cloud by heterogeneous thin client platforms or thick client platforms (e.g., mobile phones, laptops, personal digital assistants PDAs).
And (3) a resource pool: the provider's computing resources are grouped into resource pools and served to multiple consumers through a multi-tenant (multi-tenant) model, where different physical and virtual resources are dynamically allocated and reallocated as needed. Typically, the consumer is not able to control or even know the exact location of the provided resources, but can specify locations (e.g., countries, states, or data centers) at a higher level of abstraction, and therefore have location independence.
Rapid elasticity: the computing power can be deployed quickly, flexibly (sometimes automatically) to achieve a quick expansion, and can be released quickly to shrink quickly. The available computing power for deployment tends to appear infinite to consumers and can be accessed at any time and in any number of ways.
Measurable services: cloud systems automatically control and optimize resource utility by leveraging metering capabilities of some degree of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, controlled, and reported, providing transparency to both the service provider and consumer.
The service model is as follows:
software as a service (SaaS): the capability provided to the consumer is to use an application that the provider runs on the cloud infrastructure. Applications may be accessed from various client devices through a thin client interface such as a web browser (e.g., web-based email). With the exception of limited user-specific application configuration settings, consumers do not manage nor control the underlying cloud infrastructure including networks, servers, operating systems, storage, or even individual application capabilities, etc.
Platform as a service (PaaS): the capability provided to the consumer is to deploy consumer created or obtained applications on the cloud infrastructure, which are created using programming languages and tools supported by the provider. The consumer does not manage nor control the underlying cloud infrastructure, including the network, server, operating system, or storage, but has control over the applications it deploys, and possibly also over the application hosting environment configuration.
Infrastructure as a service (IaaS): the capability provided to the consumer is the processing, storage, networking, and other underlying computing resources in which the consumer can deploy and run any software, including operating systems and applications. The consumer does not manage nor control the underlying cloud infrastructure, but has control over the operating system, storage, and applications deployed thereof, and may have limited control over selected network components (e.g., host firewalls).
The deployment model is as follows:
private cloud: the cloud infrastructure alone runs for some organization. The cloud infrastructure may be managed by the organization or a third party and may exist inside or outside the organization.
Community cloud: the cloud infrastructure is shared by several organizations and supports specific communities of common interest (e.g., mission tasks, security requirements, policies, and compliance considerations). The community cloud may be managed by multiple organizations or third parties within a community and may exist inside or outside the community.
Public cloud: the cloud infrastructure provides public or large industry groups and is owned by an organization selling cloud services.
Mixing cloud: the cloud infrastructure consists of two or more clouds of deployment models (private, community, or public) that remain unique entities, but are bound together by standardized or proprietary technologies that enable data and applications to migrate (e.g., cloud bursting traffic sharing technology for load balancing between clouds).
Cloud computing environments are service-oriented, with features focused on stateless, low-coupling, modular, and semantic interoperability. At the heart of cloud computing is an infrastructure that includes a network of interconnected nodes.
Referring now to FIG. 5, an exemplary cloud computing environment 550 is depicted. As shown, cloud computing environment 550 includes one or more cloud computing nodes 510 with which local computing devices used by cloud consumers, such as, for example, personal digital assistants (personal digital assistant, PDAs) or mobile phones 554A, desktop computers 554B, laptop computers 554C, and/or automobile computer systems 554N, can communicate. Nodes 510 may communicate with each other. Cloud computing nodes 510 may be physically or virtually grouped (not shown) in one or more networks including, but not limited to, private cloud, community cloud, public cloud, or hybrid cloud, as described above, or a combination thereof. This allows cloud computing environment 550 to provide infrastructure, platforms, and/or software as a service for which cloud consumers do not need to maintain resources on local computing devices. It should be appreciated that the types of computing devices 554A-N shown in fig. 5 are intended to be illustrative only, and that cloud computing node 510 and cloud computing environment 550 may communicate with any type of computing device (e.g., using a web browser) over any type of network and/or network-addressable connection.
Referring now to FIG. 6, a set of functional abstraction layers provided by cloud computing environment 650 (FIG. 6) is shown. It should be understood at the outset that the components, layers, and functions shown in FIG. 6 are illustrative only and embodiments of the present invention are not limited in this regard. As shown, the following layers and corresponding functions are provided:
the hardware and software layer 660 includes hardware and software components. Examples of hardware components include a host 661; a server 662 based on a RISC (reduced instruction set computer) architecture; a server 663; blade server 664; a storage device 665; and a network and networking component 666. In some embodiments, the software components include web application server software 667 and database software 668.
Virtualization layer 670 provides an abstraction layer from which examples of virtual entities may be provided, virtual server 671; virtual storage 672; virtual network 673, including a virtual private network; virtual applications and operating system 674; and a virtual client 675.
In one example, management layer 680 may provide the functionality described below. Resource provisioning 681: providing dynamic acquisition of computing resources and other resources for performing tasks in a cloud computing environment; . Metering and pricing 682: cost tracking of resource usage within a cloud computing environment and billing and invoicing therefor are provided. In one example, the resource may include an application software license. Safety function: identity authentication is provided for cloud consumers and tasks, and protection is provided for data and other resources. User portal 683: providing consumers and system administrators with access to the cloud computing environment. Service level management function 84: allocation and management of cloud computing resources is provided to meet the requisite level of service. Service Level Agreement (SLA) planning and fulfillment 685: scheduling and provisioning is provided for future demands on cloud computing resources according to SLA predictions.
Workload layer 690 provides an example of functionality that may utilize a cloud computing environment. Examples of workloads and functions that may be provided from this layer include mapping and navigation 691; software development and lifecycle management 692; virtual classroom education delivery 693; data analysis process 694; transaction processing 695; and computer program synthesis 696.
Having described preferred embodiments for program synthesis using annotated external predicates based on enumeration patterns (which are intended to be illustrative and not limiting), it is noted that modifications and variations can be made by persons skilled in the art in light of the above teachings. It is therefore to be understood that changes may be made in the particular embodiments disclosed which are within the scope of the invention as outlined by the appended claims. Having thus described aspects of the invention, with the details and particularity required by the patent laws, what is claimed and desired protected by letters patent is set forth in the appended claims.

Claims (21)

1. A system for computer program synthesis using annotations based on an enumeration pattern, comprising:
a memory device for storing program code;
at least one processor device operatively coupled to the memory device and configured to execute program code stored on the memory device to:
Obtaining a set of annotated items, the set comprising one or more items, each item annotated with an enumeration pattern;
translating the problem text into a formal specification using natural language processing, the formal specification being described as a set of rules associated with predicates; and synthesizing, based on the set of annotated items, one or more items of a set of rules that satisfy the form specification to generate a computer program, the synthesizing the one or more items that satisfy the set of rules comprising:
assigning each predicate P in the form specification an item T annotated in enumeration mode using the predicate P to obtain an item combination, and assigning the item to the assigned item by using the annotation
Checking that the term combinations satisfy the logic formula;
generating a first realization statement by assigning a realization type and an item to each predicate P based on an interpretation process; and
a second implementation statement is generated by merging words or word implementation statements in each rule of the rule set based on the interpretation process.
2. The system of claim 1, wherein the at least one processor device is further configured to receive the annotated set of items as a knowledge base of how each predicate can be converted into an item.
3. The system of claim 1, wherein the set of annotated items includes table data or function code.
4. The system of claim 1, wherein the at least one processor device is further configured to synthesize the one or more items by:
assigning an item to each predicate in the form specification to obtain an item combination, wherein the item is annotated with an enumeration pattern using the predicate; and
the item combinations are checked for satisfying the logical expression by using an enumeration pattern annotated to the assigned items.
5. The system of claim 1, wherein the formal specification is described as a set of rules including predicates and corresponding target tags.
6. The system of claim 5, wherein synthesizing the one or more items further comprises:
obtaining third realization statements, each corresponding to a head relation in the set of rules; and
the target tag of the realization statement is checked.
7. The system of claim 1, wherein the set of rules comprises a set of Datalog rules.
8. A computer-implemented method for program synthesis using annotations based on an enumeration pattern, comprising:
Obtaining a set of annotated items, the set comprising one or more items, each item annotated with an enumeration pattern;
translating the problem text into a formal specification using natural language processing, the formal specification being described as a set of rules associated with predicates; and
synthesizing one or more items of a set of rules that satisfy the form specification based on the set of annotated items to generate a computer program, the synthesizing the one or more items that satisfy the set of rules comprising:
assigning each predicate P in the form specification an item T annotated in enumeration mode using the predicate P to obtain an item combination, and assigning the item to the assigned item by using the annotation
Checking that the term combinations satisfy the logic formula;
generating a first realization statement by assigning a realization type and an item to each predicate P based on an interpretation process;
a second implementation statement is generated by merging words or word implementation statements in each rule of the rule set based on the interpretation process.
9. The method of claim 8, further comprising receiving the annotated set of terms as a knowledge base of how each predicate can be converted into terms.
10. The method of claim 8, wherein the set of annotated items comprises table data or function code.
11. The method of claim 8, wherein synthesizing the one or more items further comprises:
assigning an item to each predicate in the form specification to obtain an item combination, wherein the item is annotated with an enumeration pattern using the predicate; and
the item combinations are checked for satisfying the logical expression by using an enumeration pattern annotated to the assigned items.
12. The method of claim 8, wherein the formal specification is described as a set of rules that include the predicate and respective target tags.
13. The method of claim 12, wherein synthesizing the one or more items further comprises:
obtaining third realization statements, each corresponding to a head relation in the set of rules; and
the target tag of the realization statement is checked.
14. The method of claim 8, wherein the set of rules comprises a set of Datalog rules.
15. A non-transitory computer readable storage medium having program instructions embodied therein, the program instructions executable by a computer to cause the computer to perform a method for program synthesis using enumeration pattern-based annotation, the method performed by the computer comprising:
Obtaining a set of annotated items, the set comprising one or more items, each item annotated with an enumeration pattern;
translating the problem text into a formal specification using natural language processing, the formal specification being described as a set of rules associated with predicates; and
synthesizing one or more items of a set of rules that satisfy the form specification based on the set of annotated items to generate a computer program, the synthesizing the one or more items that satisfy the set of rules comprising:
assigning each predicate P in the form specification an item T annotated in enumeration mode using the predicate P to obtain an item combination, and assigning the item to the assigned item by using the annotation
Checking that the term combinations satisfy the logic formula;
generating a first realization statement by assigning a realization type and an item to each predicate P based on an interpretation process; and
a second implementation statement is generated by merging words or word implementation statements in each rule of the rule set based on the interpretation process.
16. The non-transitory computer-readable storage medium of claim 15, wherein the method further comprises receiving the annotated set of items as a knowledge base of how each predicate can be converted into an item.
17. The non-transitory computer-readable storage medium of claim 15, wherein the set of annotated items comprises table data or functional code.
18. The non-transitory computer-readable storage medium of claim 15, wherein synthesizing the one or more items further comprises:
assigning an item to each predicate in the form specification to obtain an item combination, wherein the item is annotated with an enumeration pattern using the predicate; and
the item combinations are checked for satisfying the logical expression by using an enumeration pattern annotated to the assigned items.
19. The non-transitory computer-readable storage medium of claim 15, wherein the form specification is described as a set of rules that include the predicate and respective target tags.
20. The non-transitory computer-readable storage medium of claim 19, wherein synthesizing the one or more items further comprises:
obtaining third realization statements, each corresponding to a head relation in the set of rules; and
the target tag of the realization statement is checked.
21. A computer system comprising modules for respectively operating the steps of the method of any one of claims 8-14.
CN202010115148.5A 2019-02-25 2020-02-25 Program synthesis using notes based on enumeration patterns Active CN111611004B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US16/284,371 2019-02-25
US16/284,371 US11790263B2 (en) 2019-02-25 2019-02-25 Program synthesis using annotations based on enumeration patterns

Publications (2)

Publication Number Publication Date
CN111611004A CN111611004A (en) 2020-09-01
CN111611004B true CN111611004B (en) 2023-09-22

Family

ID=72140356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010115148.5A Active CN111611004B (en) 2019-02-25 2020-02-25 Program synthesis using notes based on enumeration patterns

Country Status (2)

Country Link
US (1) US11790263B2 (en)
CN (1) CN111611004B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113779030B (en) * 2021-09-13 2023-08-08 北京房江湖科技有限公司 Enumeration value query method, readable storage medium, and computer program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1478235A (en) * 2000-10-12 2004-02-25 �Ҵ���˾ Universal output constructor for XML queries
CN1664779A (en) * 2003-06-26 2005-09-07 微软公司 Software development infrastructure
CN101339500A (en) * 2008-05-22 2009-01-07 清华大学 Data binding application program interface creation method based on XML mode
CN105335133A (en) * 2014-06-18 2016-02-17 国际商业机器公司 Method and apparatus for generating business rule model
CN108052321A (en) * 2017-12-28 2018-05-18 杭州趣链科技有限公司 A kind of method that block chain intelligence contract is automatically generated based on configuration information
CN108885545A (en) * 2016-03-23 2018-11-23 雾角系统公司 Tool and method for real-time stream programming language

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9087513B2 (en) 2012-03-09 2015-07-21 International Business Machines Corporation Noise reduction method, program product, and apparatus
US9086943B2 (en) 2012-06-13 2015-07-21 International Business Machines Corporation Integrated development environment-based repository searching in a networked computing environment
JP6234060B2 (en) 2013-05-09 2017-11-22 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Generation method, generation apparatus, and generation program for target domain learning voice data
US9454571B2 (en) 2014-06-26 2016-09-27 Sap Se Optimization of parallelization of user-defined functions with flexible partitioning
US20160271366A1 (en) 2015-03-19 2016-09-22 Cook Medical Technologies Llc Steerable catheter
US10843080B2 (en) 2016-02-24 2020-11-24 Virginia Tech Intellectual Properties, Inc. Automated program synthesis from natural language for domain specific computing applications
US10331415B2 (en) 2016-11-08 2019-06-25 International Business Machines Corporation Formal specification generation using examples

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1478235A (en) * 2000-10-12 2004-02-25 �Ҵ���˾ Universal output constructor for XML queries
CN1664779A (en) * 2003-06-26 2005-09-07 微软公司 Software development infrastructure
CN101339500A (en) * 2008-05-22 2009-01-07 清华大学 Data binding application program interface creation method based on XML mode
CN105335133A (en) * 2014-06-18 2016-02-17 国际商业机器公司 Method and apparatus for generating business rule model
CN108885545A (en) * 2016-03-23 2018-11-23 雾角系统公司 Tool and method for real-time stream programming language
CN108052321A (en) * 2017-12-28 2018-05-18 杭州趣链科技有限公司 A kind of method that block chain intelligence contract is automatically generated based on configuration information

Also Published As

Publication number Publication date
US20200272935A1 (en) 2020-08-27
CN111611004A (en) 2020-09-01
US11790263B2 (en) 2023-10-17

Similar Documents

Publication Publication Date Title
US10430250B2 (en) Decomposing monolithic application into microservices
US10366160B2 (en) Automatic generation and display of context, missing attributes and suggestions for context dependent questions in response to a mouse hover on a displayed term
CN110321413B (en) Session framework
US20180276273A1 (en) Interactive Dialog in Natural Language Using an Ontology
US10169336B2 (en) Translating structured languages to natural language using domain-specific ontology
CN110070862B (en) Method and system for automatic guidance based on ontology in dialogue system
CN111563141B (en) Method and system for processing input questions to query a database
US11157533B2 (en) Designing conversational systems driven by a semantic network with a library of templated query operators
CN112136296B (en) Method for training session proxy, computer device and storage medium
US20200125926A1 (en) Dynamic Batch Sizing for Inferencing of Deep Neural Networks in Resource-Constrained Environments
US11455337B2 (en) Preventing biased queries by using a dictionary of cause and effect terms
CN111406255A (en) Coordination engine blueprint aspects of hybrid cloud composition
US10936810B2 (en) Token embedding based on target-context pairs
US20200302350A1 (en) Natural language processing based business domain modeling
JP2021529363A (en) Facet-based query refinement based on multiple query interpretations
US11163951B2 (en) Symbolic regression embedding dimensionality analysis
US11586677B2 (en) Resolving user expression having dependent intents
CN112541058A (en) Context-based topic identification using natural language processing
CN111611004B (en) Program synthesis using notes based on enumeration patterns
Huqqani et al. N2Cloud: Cloud based neural network simulation application
CN111406256A (en) Coordination engine blueprint aspects of hybrid cloud composition
WO2023098302A1 (en) Identifying microservices for monolith application through static code analysis
US20230094887A1 (en) Translating clusters of a monolith application to microservices
CN111406383A (en) Coordination engine blueprint aspects of hybrid cloud composition
US20220188674A1 (en) Machine learning classifiers prediction confidence and explanation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant