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++) {

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:


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.
  • 1
    $\begingroup$ 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. $\endgroup$ – nbro May 19 '19 at 13:31
  • $\begingroup$ @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. $\endgroup$ – yaobin May 19 '19 at 13:42
  • $\begingroup$ @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. $\endgroup$ – yaobin May 19 '19 at 13:44

If i have understood the question right, the problem can't be reduced to a simple algorithm which is equal to automatic programming but it has to do with human-machine interaction and the machine should go into a dialogue with the human on a higher level. The good news is, that such interaction is researched in the literature very well under the topic “computer based training”. The idea is to program an interactive tutorial which can teach a human how to program. Part of the tutorials are quiz and examples which have to be solved by a human.1

The idea is, that the human learner sits on a computer, and the AI system is educating the learner. For doing so, the AI systems needs a model of the student about the weakness and the strengths. And this model allows the AI system to select the next, more motivating task.

Let us compare a classical AI Algorithm with an intelligent tutoring system. An AI algorithm works for it's own. There is some kind of technique realized in machine code and nobody knows apart from the programmer what the purpose is. In a dialoque system which is grounded with human interaction the AI system is forced to follow a natural pattern. Which means, a certain game-based learning system can either be pleasant or not and the decision is taken by the human student. He can say, if he had learned something after answering all the quiz questions from the AI or if he doesn't understood anything. This feedback allows to compare different computer based training systems against each other.

1 Sykes, Edward R., and Franya Franek. "A prototype for an intelligent tutoring system for students learning to program in Java (TM)." Proceedings of the IASTED International Conference on Computers and Advanced Technology in Education. 2003.

  • 1
    $\begingroup$ Thanks for the reply! But sorry that's not what I was asking. I was asking about teaching the AI to solve the problem, not letting an AI teach the human being to learn how to solve a problem. I've added some clarification to my question. $\endgroup$ – yaobin May 19 '19 at 13:27
  • 1
    $\begingroup$ @yaobin Hi. Your question is quite clear (even without the clarification). It is not the first time that Manuel gives answers of this kind, that is, where it seems that he has misunderstood the question or he doesn't focus on answering the actual question. $\endgroup$ – nbro May 19 '19 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.