Is there research about teaching AI to “analyze the problem and design a solution”?

Update on 2019-05-19:

My question is about teaching AI to solve the problem, not letting AI teach a human developer to solve a problem.

Original post:

I'm a software developer but very new to AI.

Today my friend and I talked (to be more exact, chatted) about the development of AI. One topic was about implementing the capability of "given a problem, analyzing the problem and designing a solution".

Since we are both software developers, we used a simple example problem in our discussion to see how AI might possibly find a solution:

Print the following three lines on the console:

*
***
*****


My friend and I thought we may use some formal method to describe WHAT we want but NOT how we implement it. It's the AI's job to figure out the solution.

Then we came to the question I'm asking here: Since my friend and I are both outsiders of AI research, we don't know if there is any existing research (we believe such research must have existed somewhere) that teaches AI to analyze the problem (which is formally defined) and design a solution using the given tools.

For us human beings, our analysis of the problem and designing might look like the following:

• Let me choose a programming language. For example, C.
• Let me see what tools I have in the chosen programming language. Oh, here they are:
• putchar(ch) which prints a single character on the console.
• printf(str) which prints a string on the console.
• for-loop; if-else; support of subroutines; etc.
• I see the result has three lines of characters: line 1, 2, and 3.
• I see the numbers of '*' in the three lines are an arithmetic progression and there is a connection of line number and character number: given the line number i, the character number is 2*i-1, where i is 1, 2, and 3. This is repetition and I can use a for-loop.
• Each line is the repetition of '*' so I may implement a function to do this.
void print_line(int N) {
for (int i = 0; i < N; i++) {
putchar('*');
}
putchar('\n');
}

int main(int argc, char * argv[]) {
for (int i = 1; i <=3; i++) {
print_line(2 * i - 1);
}
return 0;
}


Alternatively, I may design a naive solution of using printf() three times and hard-code each string:

printf("*\n");
printf("***\n");
printf("*****\n");


We think an AI that can do this may follow a similar analyzing and designing approach as a human developer does. In general, we think:

• This AI should have a toolbox using which it can solve some problems (possibly not all problems). In my example above, this toolbox may be a programming language and its corresponding library.
• This AI should have the knowledge about some concepts (such as console and string in the example above) and their relationships.
• This AI should have the knowledge that connects the toolbox and the concepts, so the AI knows how a tool can manipulate the properties of a concept.
• Most importantly, this AI should have the capability of figuring out one or more paths that connect the input to the desired output, using the toolbox. This process, we think, needs the capability of "analysis" and "design".

Excuse us if the description is still vague. My friend and I are both new to AI so, in fact, we don't even know if "analysis" and "design" are the proper words to use. We will be glad to clarify if needed.

BTW, we did some quick search about such AI:

• Bayou by Rice University doesn't look like understanding the problem, either.
• DeepCoder uses Deep Learning and I doubt whether it understands the problem, either.
• The AI-Programmer uses genetic algorithms to generate the desired string in BrainFuck. But this AI doesn't look like understanding the problem. It looks like a trial-and-error with feedback.
• Software development is a quite complex task, which involves a lot of abstract concepts. I doubt there's any AI system that is capable of solving any non-trivial programming task satisfactorily. Programming is likely an AI-complete problem. – nbro May 19 at 13:31
• @nbro Thanks for the information! I'll take a look at the "AI-complete problem". Meanwhile, I just learned about the research field "Program synthesis" which seems to be related to my question. I'll take a look, too. – yaobin May 19 at 13:42
• @nbro Yes, I agree with you that it is quite complex and probably there isn't any AI that can do it so far. This is why when my friend and I were discussing this, we thought we human developers can define the problem formally, instead of using natural language. So the AI doesn't have to process natural language to understand the problem. However, figuring out a solution from even a formally specified problem still seems so difficult for a machine. – yaobin May 19 at 13:44