Intelligent code completion? Is there any AI for writing code through training?

I ask this question because I know that there are many well-readable types of CS that can give a clear answer.

I am wondering if such an AI exists (or is being researched / developed) that it writes programs, generating and compiling code at its own level, and then progresses, studying the previous iterations. I'm talking about getting us programmers out of date. I imagine something that teaches what works and what doesn't in programming languages ​​through trial and error.

I know this sounds like a pie in the sky, so I ask you to find out what was done, if anything.

Of course, even a human programmer needs inputs and specifications, so there must be carefully defined parameters in such an experiment. As if the AI ​​was about to explore the various functions of time, this aspect should be clearly defined.

But with the help of sophisticated AI training, I would be interested to know what it can generate.

I know that there are many human qualities that computers cannot reproduce, like our judgments, tastes and prejudices. But my imagination likes the idea of ​​a program that spills out a website after a day of thinking and allows me to understand what it was facing, and even so, I often expected it to be rubbish; but maybe once a day I can give him feedback and help him learn.

Another way of thinking would be to give a high-level description, such as a “menu on a site” or “image tools,” and it generates code with sufficient depth, which would be useful as a code completion module for me, then the code is in detail. But I believe that this could be represented as a scheme of intelligent static hierarchical code.

How about this?

+6
computer-science artificial-intelligence machine-learning genetic-algorithm
source share
2 answers

Such tools exist. They are the subject of the Genetic Programming discipline. How you evaluate their success depends on the scope of their application.

They were extremely successful (an order of magnitude more effective than people) for developing optimal programs for industrial process control, automated medical diagnostics, or integrated circuit design. These processes are well limited, with a clear and indispensable measure of success and a lot of “knowledge about the universe,” that is, a large set of rules about what is a valid, working, program and what is not.

They were absolutely useless in trying to create basic programs that require interaction with the user, because the main element of the system that teaches needs is an explicit " fitness function ", or an assessment of the quality of the current solution that it came up with.

Another domain that can be seen when working with “software training” is Inductive Logic Programming , although it is more used to provide automatic demonstration or language / taxonomy learning.

+12
source share

Disclaimer: I am not a native speaker of English or an expert in this field, I am amateur - expect inaccuracies and / or errors in subsequent ones. So, in the spirit of stackoverflow, don't be afraid to fix and improve my prose and / or my content. Also note that this is not a complete overview of automatic programming techniques ( code generation (CG) from Modeled Architectures (MDA) deserves at least a fleeting mention).

I want to add more to what Varkhan answered (which is essentially correct).

Genetic programming (GP) approach to automatic programming conflates, with its fitness functions , two different problems ("self-compilation" conceptually without problems):

  • self-improvement / adaptation - a synthesized program and, if necessary, the synthesizer itself; and
  • synthesis of programs .

wrt self-improvement / adaptation belongs to Jürgen Schmidhuber Goedel machines : self-referential universal problem solvers, improvements. (As a note: his work on artificial curiosity is interesting .) Autonomous systems are also important for this discussion.

wrt synthesis of programs , I think, it is possible to classify 3 main branches: stochastic (probabilistic - like the aforementioned GP), inductive and deductive.

The GP is essentially stochastic because it creates a space of probable programs with heuristics such as crossover, random mutation, gene duplication, gene removal, etc. (than he tests the program with the help of the fitness function and allow the fittest to survive and reproduce).

Inductive software synthesis is commonly known as Inductive Programming (IP), of which Inductive Logic Programming (ILP) is a subfield. That is, in general, this method is not limited to a logical synthesis program or synthesizers written in a logical programming language (both of them are limited to "..automatic demonstration or language / taxonomy learning").

IP is often deterministic (but there are exceptions): it starts with an incomplete one (for example, an input / output pair) and use this to limit the search space to probable programs that meet this specification, and then test it (the generation and testing method) or directly synthesize the program, detecting repetition in a given example, which are then generalized (data-based or analytical approach). The process as a whole is essentially a statistical induction / conclusion - that is, given what to include in an incomplete specification, to a random sample.

Preparatory and analyzed data / analytical methods . The approaches can be quite fast, so both are promising (even if little synthesized programs are still publicly demonstrated), but generation and testing (for example, GP) are awkwardly parallel , and then noticeable improvements (scaling to realistic program sizes). But note that Incremental Inductive Programming (IIP) §, which is essentially consistent, has demonstrated an order of magnitude more efficient non-incremental approaches.

§ These links are directly related to the PDF files: sorry, I can not find the abstract.

Demonstration Programming (PbD) and Example Programming (PbE) are end-user development programs that are known to actually use inductive program synthesis.

Deductive synthesis of programs start with the (supposed) full (formal) specification (logical conditions). One of the methods uses automatic theoretical proxies : for synthesizing a program, it builds a proof of the existence of an object that meets the specification; therefore, through the Curry-Howard-de Bruijn isomorphism (correspondence of subprograms as correspondence of programs and correspondence of formula form), he extracts the program from the proof. Other options include the use of constraint constraints and the deductive composition of routine libraries .

In my opinion, inductive and deductive synthesis in practice attack the same problem with two different angles, because what constitutes the full specification is controversial (in addition, the full specification today may become incomplete tomorrow - the world is not static).

When (if) these methods (self-improvement / adaptation and synthesis of programs) mature, they promise to increase the amount of automation provided by declarative programming (that such a setting should be considered "programming") is sometimes discussed ): we will focus more on Domain Engineering and Requirement Analysis and development than with the development and development of software, manual debugging, manual tuning of system performance, etc. (possibly with less random complexity compared to what was introduced using the current manual, rather than self-improvement / adaptation of the technique). It will also help to increase the level of flexibility that will be demonstrated by modern methods.

+7
source share

All Articles