Skip to content

API Endpoints

We provide a set of RESTful APIs to interact with each module of the Intelligent Tutoring System (ITS), so that ITS can be easily integrated and customized with any teaching system/platform. This page includes the API documentation for the Intelligent Tutoring System (ITS) for Programming and Algorithms Education.
To access demo API endpoints or apply for a local deployment at your institution, please contact us for support.

Parser API

The ITS parser generate parsed result of input source code in ITS intermediate representation.

Request Format:
- language: A string representing the programming language of the source code. The API supports "c", "python", or "java".
- source_code: A string containing the source code that needs to be processed.

Example Request Body:

1
2
3
4
{
  "language": "python",
  "source_code": "def is_odd(x):\n\tif x % 2 == 0:\n\t\treturn False\n\telse:\n\t\treturn True"
}

Response:
Intermediate representation of the input source code in JSON format.

Example Successful Response:
The below JSON response is an example of the intermediate representation of the input source code in JSON format.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
{
  "importStatements": [],
  "fncs": {
    "is_odd": {
      "name": "is_odd",
      "rettype": "*",
      "initloc": 1,
      "endloc": 0,
      "params": [
        {
          "val0": "x",
          "val1": "*",
          "valueArray": [
            "x",
            "*"
          ],
          "valueList": [
            "x",
            "*"
          ]
        }
      ],
      "locexprs": {
        "1": [
          {
            "val0": "$ret",
            "val1": {
              "name": "ite",
              "args": [
                {
                  "name": "Eq",
                  "args": [
                    {
                      "name": "Mod",
                      "args": [
                        {
                          "name": "x",
                          "primed": false,
                          "line": 2,
                          "tokentype": "Variable"
                        },
                        {
                          "value": "2",
                          "line": 2,
                          "tokentype": "Constant"
                        }
                      ],
                      "line": 2,
                      "tokentype": "Operation"
                    },
                    {
                      "value": "0",
                      "line": 2,
                      "tokentype": "Constant"
                    }
                  ],
                  "line": 2,
                  "tokentype": "Operation"
                },
                {
                  "value": "False",
                  "line": 3,
                  "tokentype": "Constant"
                },
                {
                  "value": "True",
                  "line": 5,
                  "tokentype": "Constant"
                }
              ],
              "line": 2,
              "tokentype": "Operation"
            },
            "valueArray": [
              "$ret",
              {
                "name": "ite",
                "args": [
                  {
                    "name": "Eq",
                    "args": [
                      {
                        "name": "Mod",
                        "args": [
                          {
                            "name": "x",
                            "primed": false,
                            "line": 2,
                            "tokentype": "Variable"
                          },
                          {
                            "value": "2",
                            "line": 2,
                            "tokentype": "Constant"
                          }
                        ],
                        "line": 2,
                        "tokentype": "Operation"
                      },
                      {
                        "value": "0",
                        "line": 2,
                        "tokentype": "Constant"
                      }
                    ],
                    "line": 2,
                    "tokentype": "Operation"
                  },
                  {
                    "value": "False",
                    "line": 3,
                    "tokentype": "Constant"
                  },
                  {
                    "value": "True",
                    "line": 5,
                    "tokentype": "Constant"
                  }
                ],
                "line": 2
              }
            ],
            "valueList": [
              "$ret",
              {
                "name": "ite",
                "args": [
                  {
                    "name": "Eq",
                    "args": [
                      {
                        "name": "Mod",
                        "args": [
                          {
                            "name": "x",
                            "primed": false,
                            "line": 2,
                            "tokentype": "Variable"
                          },
                          {
                            "value": "2",
                            "line": 2,
                            "tokentype": "Constant"
                          }
                        ],
                        "line": 2,
                        "tokentype": "Operation"
                      },
                      {
                        "value": "0",
                        "line": 2,
                        "tokentype": "Constant"
                      }
                    ],
                    "line": 2,
                    "tokentype": "Operation"
                  },
                  {
                    "value": "False",
                    "line": 3,
                    "tokentype": "Constant"
                  },
                  {
                    "value": "True",
                    "line": 5,
                    "tokentype": "Constant"
                  }
                ],
                "line": 2
              }
            ]
          }
        ]
      },
      "loctrans": {
        "1": {}
      },
      "locdescs": {
        "1": "around the beginning of function 'is_odd'"
      },
      "types": {}
    }
  }
}

Structural Alignment API

Request Format:
- reference_solution: A list of string containing the response of the Parser API for the reference solutions.
- student_solution: A string containing the response of the Parser API for the student solution.

Example Request Body:

1
2
3
4
{
  "reference_solution": "{\"importStatements\":[],\"fncs\":{\"computeDeriv\":{\"name\":\"computeDeriv\",\"rettype\":\"*\",\"initloc\":1,\"endloc\":0,\"params\":[{\"val0\":\"poly\",\"val1\":\"*\",\"valueArray\":[\"poly\",\"*\"],\"valueList\":[\"poly\",\"*\"]}],\"locexprs\":{\"1\":[{\"val0\":\"result\",\"val1\":{\"name\":\"ListInit\",\"args\":[],\"line\":2,\"tokentype\":\"Operation\"},\"valueArray\":[\"result\",{\"name\":\"ListInit\",\"args\":[],\"line\":2}],\"valueList\":[\"result\",{\"name\":\"ListInit\",\"args\":[],\"line\":2}]},{\"val0\":\"iter#0\",\"val1\":{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"iter#0\",{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}],\"valueList\":[\"iter#0\",{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}]},{\"val0\":\"ind#0\",\"val1\":{\"value\":\"0\",\"line\":3,\"tokentype\":\"Constant\"},\"valueArray\":[\"ind#0\",{\"value\":\"0\",\"line\":3}],\"valueList\":[\"ind#0\",{\"value\":\"0\",\"line\":3}]}],\"2\":[{\"val0\":\"$cond\",\"val1\":{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"$cond\",{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}],\"valueList\":[\"$cond\",{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}]}],\"3\":[{\"val0\":\"$ret\",\"val1\":{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"result\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6,\"tokentype\":\"Operation\"},\"valueArray\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"result\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6}],\"valueList\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"result\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6}]}],\"4\":[{\"val0\":\"e\",\"val1\":{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"e\",{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3}],\"valueList\":[\"e\",{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3}]},{\"val0\":\"ind#0\",\"val1\":{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"ind#0\",{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3}],\"valueList\":[\"ind#0\",{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3}]},{\"val0\":\"result\",\"val1\":{\"name\":\"append\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"},\"valueArray\":[\"result\",{\"name\":\"append\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4}],\"valueList\":[\"result\",{\"name\":\"append\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4}]}]},\"loctrans\":{\"1\":{\"true\":2},\"2\":{\"false\":3,\"true\":4},\"3\":{},\"4\":{\"true\":2}},\"locdescs\":{\"1\":\"around the beginning of function 'computeDeriv'\",\"2\":\"the condition of the 'for' loop at line 3\",\"3\":\"*after* the 'for' loop starting at line 3\",\"4\":\"inside the body of the 'for' loop beginning at line 4\"},\"types\":{\"result\":\"*\",\"e\":\"*\",\"ind#0\":\"int\",\"iter#0\":\"int\"}}}}",
  "student_solution": "{\"importStatements\":[],\"fncs\":{\"computeDeriv\":{\"name\":\"computeDeriv\",\"rettype\":\"*\",\"initloc\":1,\"endloc\":0,\"params\":[{\"val0\":\"poly\",\"val1\":\"*\",\"valueArray\":[\"poly\",\"*\"],\"valueList\":[\"poly\",\"*\"]}],\"locexprs\":{\"1\":[{\"val0\":\"output\",\"val1\":{\"name\":\"ListInit\",\"args\":[],\"line\":2,\"tokentype\":\"Operation\"},\"valueArray\":[\"output\",{\"name\":\"ListInit\",\"args\":[],\"line\":2}],\"valueList\":[\"output\",{\"name\":\"ListInit\",\"args\":[],\"line\":2}]},{\"val0\":\"iter#0\",\"val1\":{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"iter#0\",{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}],\"valueList\":[\"iter#0\",{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}]},{\"val0\":\"ind#0\",\"val1\":{\"value\":\"0\",\"line\":3,\"tokentype\":\"Constant\"},\"valueArray\":[\"ind#0\",{\"value\":\"0\",\"line\":3}],\"valueList\":[\"ind#0\",{\"value\":\"0\",\"line\":3}]}],\"2\":[{\"val0\":\"$cond\",\"val1\":{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"$cond\",{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}],\"valueList\":[\"$cond\",{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}]}],\"3\":[{\"val0\":\"$ret\",\"val1\":{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"output\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6,\"tokentype\":\"Operation\"},\"valueArray\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"output\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6}],\"valueList\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"output\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6}]}],\"4\":[{\"val0\":\"e\",\"val1\":{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"e\",{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3}],\"valueList\":[\"e\",{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3}]},{\"val0\":\"ind#0\",\"val1\":{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"ind#0\",{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3}],\"valueList\":[\"ind#0\",{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3}]},{\"val0\":\"output\",\"val1\":{\"name\":\"append\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"},\"valueArray\":[\"output\",{\"name\":\"append\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4}],\"valueList\":[\"output\",{\"name\":\"append\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4}]}]},\"loctrans\":{\"1\":{\"true\":2},\"2\":{\"false\":3,\"true\":4},\"3\":{},\"4\":{\"true\":2}},\"locdescs\":{\"1\":\"around the beginning of function 'computeDeriv'\",\"2\":\"the condition of the 'for' loop at line 3\",\"3\":\"*after* the 'for' loop starting at line 3\",\"4\":\"inside the body of the 'for' loop beginning at line 4\"},\"types\":{\"output\":\"*\",\"e\":\"*\",\"ind#0\":\"int\",\"iter#0\":\"int\"}}}}"
}

Response:
The structural alignment result of the reference and student solutions in JSON format. This structure alignment result is used to identify the matching basic blocks for each function inside the reference and student solutions.
Along with the variable alignment result, they are used to pinpoint the equivalent program specifications at function level for each function inside the reference and student solutions.

Example Successful Response:
The below JSON response is an example of structural alignment result of the computeDeriv function in the reference and student solutions in JSON format.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "mapping": {
    "computeDeriv": {
      "1": 1,
      "2": 2,
      "3": 3,
      "4": 4
    }
  }
}

Variable Alignment API

Request Format:
- reference_solution: A list of string containing the response of the Parser API for the reference solutions.
- student_solution: A string containing the response of the Parser API for the student solution.
- structural_alignment: string (structural alignment result)

Example Request Body:

1
2
3
4
5
{
  "reference_solution": "{\"importStatements\":[],\"fncs\":{\"computeDeriv\":{\"name\":\"computeDeriv\",\"rettype\":\"*\",\"initloc\":1,\"endloc\":0,\"params\":[{\"val0\":\"poly\",\"val1\":\"*\",\"valueArray\":[\"poly\",\"*\"],\"valueList\":[\"poly\",\"*\"]}],\"locexprs\":{\"1\":[{\"val0\":\"result\",\"val1\":{\"name\":\"ListInit\",\"args\":[],\"line\":2,\"tokentype\":\"Operation\"},\"valueArray\":[\"result\",{\"name\":\"ListInit\",\"args\":[],\"line\":2}],\"valueList\":[\"result\",{\"name\":\"ListInit\",\"args\":[],\"line\":2}]},{\"val0\":\"iter#0\",\"val1\":{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"iter#0\",{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}],\"valueList\":[\"iter#0\",{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}]},{\"val0\":\"ind#0\",\"val1\":{\"value\":\"0\",\"line\":3,\"tokentype\":\"Constant\"},\"valueArray\":[\"ind#0\",{\"value\":\"0\",\"line\":3}],\"valueList\":[\"ind#0\",{\"value\":\"0\",\"line\":3}]}],\"2\":[{\"val0\":\"$cond\",\"val1\":{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"$cond\",{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}],\"valueList\":[\"$cond\",{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}]}],\"3\":[{\"val0\":\"$ret\",\"val1\":{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"result\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6,\"tokentype\":\"Operation\"},\"valueArray\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"result\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6}],\"valueList\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"result\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6}]}],\"4\":[{\"val0\":\"e\",\"val1\":{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"e\",{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3}],\"valueList\":[\"e\",{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3}]},{\"val0\":\"ind#0\",\"val1\":{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"ind#0\",{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3}],\"valueList\":[\"ind#0\",{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3}]},{\"val0\":\"result\",\"val1\":{\"name\":\"append\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"},\"valueArray\":[\"result\",{\"name\":\"append\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4}],\"valueList\":[\"result\",{\"name\":\"append\",\"args\":[{\"name\":\"result\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4}]}]},\"loctrans\":{\"1\":{\"true\":2},\"2\":{\"false\":3,\"true\":4},\"3\":{},\"4\":{\"true\":2}},\"locdescs\":{\"1\":\"around the beginning of function 'computeDeriv'\",\"2\":\"the condition of the 'for' loop at line 3\",\"3\":\"*after* the 'for' loop starting at line 3\",\"4\":\"inside the body of the 'for' loop beginning at line 4\"},\"types\":{\"result\":\"*\",\"e\":\"*\",\"ind#0\":\"int\",\"iter#0\":\"int\"}}}}",
  "student_solution": "{\"importStatements\":[],\"fncs\":{\"computeDeriv\":{\"name\":\"computeDeriv\",\"rettype\":\"*\",\"initloc\":1,\"endloc\":0,\"params\":[{\"val0\":\"poly\",\"val1\":\"*\",\"valueArray\":[\"poly\",\"*\"],\"valueList\":[\"poly\",\"*\"]}],\"locexprs\":{\"1\":[{\"val0\":\"output\",\"val1\":{\"name\":\"ListInit\",\"args\":[],\"line\":2,\"tokentype\":\"Operation\"},\"valueArray\":[\"output\",{\"name\":\"ListInit\",\"args\":[],\"line\":2}],\"valueList\":[\"output\",{\"name\":\"ListInit\",\"args\":[],\"line\":2}]},{\"val0\":\"iter#0\",\"val1\":{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"iter#0\",{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}],\"valueList\":[\"iter#0\",{\"name\":\"range\",\"args\":[{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"},{\"name\":\"len\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}]},{\"val0\":\"ind#0\",\"val1\":{\"value\":\"0\",\"line\":3,\"tokentype\":\"Constant\"},\"valueArray\":[\"ind#0\",{\"value\":\"0\",\"line\":3}],\"valueList\":[\"ind#0\",{\"value\":\"0\",\"line\":3}]}],\"2\":[{\"val0\":\"$cond\",\"val1\":{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"$cond\",{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}],\"valueList\":[\"$cond\",{\"name\":\"Lt\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"len\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"}],\"line\":3}]}],\"3\":[{\"val0\":\"$ret\",\"val1\":{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"output\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6,\"tokentype\":\"Operation\"},\"valueArray\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"output\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6}],\"valueList\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":6,\"tokentype\":\"Variable\"},{\"name\":\"ListInit\",\"args\":[],\"line\":6,\"tokentype\":\"Operation\"}],\"line\":6,\"tokentype\":\"Operation\"},{\"name\":\"ListInit\",\"args\":[{\"value\":\"0.0\",\"line\":7,\"tokentype\":\"Constant\"}],\"line\":7,\"tokentype\":\"Operation\"},{\"name\":\"output\",\"primed\":false,\"line\":9,\"tokentype\":\"Variable\"}],\"line\":6}]}],\"4\":[{\"val0\":\"e\",\"val1\":{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"e\",{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3}],\"valueList\":[\"e\",{\"name\":\"GetElement\",\"args\":[{\"name\":\"iter#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"}],\"line\":3}]},{\"val0\":\"ind#0\",\"val1\":{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3,\"tokentype\":\"Operation\"},\"valueArray\":[\"ind#0\",{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3}],\"valueList\":[\"ind#0\",{\"name\":\"Add\",\"args\":[{\"name\":\"ind#0\",\"primed\":false,\"line\":3,\"tokentype\":\"Variable\"},{\"value\":\"1\",\"line\":3,\"tokentype\":\"Constant\"}],\"line\":3}]},{\"val0\":\"output\",\"val1\":{\"name\":\"append\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"},\"valueArray\":[\"output\",{\"name\":\"append\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4}],\"valueList\":[\"output\",{\"name\":\"append\",\"args\":[{\"name\":\"output\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"float\",\"args\":[{\"name\":\"Mult\",\"args\":[{\"name\":\"GetElement\",\"args\":[{\"name\":\"poly\",\"primed\":false,\"line\":4,\"tokentype\":\"Variable\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"},{\"name\":\"e\",\"primed\":true,\"line\":4,\"tokentype\":\"Variable\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4,\"tokentype\":\"Operation\"}],\"line\":4}]}]},\"loctrans\":{\"1\":{\"true\":2},\"2\":{\"false\":3,\"true\":4},\"3\":{},\"4\":{\"true\":2}},\"locdescs\":{\"1\":\"around the beginning of function 'computeDeriv'\",\"2\":\"the condition of the 'for' loop at line 3\",\"3\":\"*after* the 'for' loop starting at line 3\",\"4\":\"inside the body of the 'for' loop beginning at line 4\"},\"types\":{\"output\":\"*\",\"e\":\"*\",\"ind#0\":\"int\",\"iter#0\":\"int\"}}}}",
  "structural_alignment": "{\"mapping\":{\"computeDeriv\":{\"1\":1,\"2\":2,\"3\":3,\"4\":4}}}"
}

Response:
The variable alignment result of the reference and student solutions in JSON format. This variable alignment result is used to identify the matching variables for each function inside the reference and student solutions.
Along with the structural alignment result, they are used to pinpoint the equivalent program specifications at function level for each function inside the reference and student solutions.

Example Successful Response:
The below JSON response is an example of variable alignment result of the computeDeriv function in the reference and student solutions in JSON format.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
  "mappingByFunctionName": {
    "computeDeriv": [
      [
        [
          {
            "tokentype": "Variable",
            "name": "result",
            "primed": false,
            "line": 6
          },
          {
            "tokentype": "Variable",
            "name": "output",
            "primed": false,
            "line": 6
          }
        ],
        [
          {
            "tokentype": "Variable",
            "name": "$cond",
            "primed": false,
            "line": 0
          },
          {
            "tokentype": "Variable",
            "name": "$cond",
            "primed": false,
            "line": 0
          }
        ],
        [
          {
            "tokentype": "Variable",
            "name": "e",
            "primed": false,
            "line": 4
          },
          {
            "tokentype": "Variable",
            "name": "e",
            "primed": false,
            "line": 4
          }
        ],
        [
          {
            "tokentype": "Variable",
            "name": "$ret",
            "primed": false,
            "line": 0
          },
          {
            "tokentype": "Variable",
            "name": "$ret",
            "primed": false,
            "line": 0
          }
        ],
        [
          {
            "tokentype": "Variable",
            "name": "$out",
            "primed": false,
            "line": 0
          },
          {
            "tokentype": "Variable",
            "name": "$out",
            "primed": false,
            "line": 0
          }
        ],
        [
          {
            "tokentype": "Variable",
            "name": "poly",
            "primed": false,
            "line": 3
          },
          {
            "tokentype": "Variable",
            "name": "poly",
            "primed": false,
            "line": 3
          }
        ],
        [
          {
            "tokentype": "Variable",
            "name": "iter#0",
            "primed": false,
            "line": 3
          },
          {
            "tokentype": "Variable",
            "name": "iter#0",
            "primed": false,
            "line": 3
          }
        ],
        [
          {
            "tokentype": "Variable",
            "name": "$in",
            "primed": false,
            "line": 0
          },
          {
            "tokentype": "Variable",
            "name": "$in",
            "primed": false,
            "line": 0
          }
        ],
        [
          {
            "tokentype": "Variable",
            "name": "ind#0",
            "primed": false,
            "line": 3
          },
          {
            "tokentype": "Variable",
            "name": "ind#0",
            "primed": false,
            "line": 3
          }
        ]
      ]
    ]
  }
}

Error Localizer and Interpreter API

Request Format:
- language: A string representing the programming language of the source code. The API supports "c", "python", or "java".
- reference_solution: A list of string containing the response of the Parser API for the reference solutions.
- student_solution: A string containing the response of the Parser API for the student solution.
- function: A string represents entry function name of the programming assignment.
- inputs: A string represents IO inputs of the programs.
- args: A string represent argument inputs of the entry function.

Example Request Body:

1
2
3
4
5
6
7
8
{
  "language": "python",
  "reference_solution": "{\"importStatements\":[],\"fncs\":{\"is_odd\":{\"name\":\"is_odd\",\"rettype\":\"*\",\"initloc\":1,\"endloc\":0,\"params\":[{\"val0\":\"x\",\"val1\":\"*\",\"valueArray\":[\"x\",\"*\"],\"valueList\":[\"x\",\"*\"]}],\"locexprs\":{\"1\":[{\"val0\":\"$ret\",\"val1\":{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"Mod\",\"args\":[{\"name\":\"x\",\"primed\":false,\"line\":2,\"tokentype\":\"Variable\"},{\"value\":\"2\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"0\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"False\",\"line\":3,\"tokentype\":\"Constant\"},{\"value\":\"True\",\"line\":5,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},\"valueArray\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"Mod\",\"args\":[{\"name\":\"x\",\"primed\":false,\"line\":2,\"tokentype\":\"Variable\"},{\"value\":\"2\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"0\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"False\",\"line\":3,\"tokentype\":\"Constant\"},{\"value\":\"True\",\"line\":5,\"tokentype\":\"Constant\"}],\"line\":2}],\"valueList\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"Mod\",\"args\":[{\"name\":\"x\",\"primed\":false,\"line\":2,\"tokentype\":\"Variable\"},{\"value\":\"2\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"0\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"False\",\"line\":3,\"tokentype\":\"Constant\"},{\"value\":\"True\",\"line\":5,\"tokentype\":\"Constant\"}],\"line\":2}]}]},\"loctrans\":{\"1\":{}},\"locdescs\":{\"1\":\"around the beginning of function 'is_odd'\"},\"types\":{}}}}",
  "student_solution": "{\"importStatements\":[],\"fncs\":{\"is_odd\":{\"name\":\"is_odd\",\"rettype\":\"*\",\"initloc\":1,\"endloc\":0,\"params\":[{\"val0\":\"x\",\"val1\":\"*\",\"valueArray\":[\"x\",\"*\"],\"valueList\":[\"x\",\"*\"]}],\"locexprs\":{\"1\":[{\"val0\":\"$ret\",\"val1\":{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"Mod\",\"args\":[{\"name\":\"x\",\"primed\":false,\"line\":2,\"tokentype\":\"Variable\"},{\"value\":\"2\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"1\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"False\",\"line\":3,\"tokentype\":\"Constant\"},{\"value\":\"True\",\"line\":5,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},\"valueArray\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"Mod\",\"args\":[{\"name\":\"x\",\"primed\":false,\"line\":2,\"tokentype\":\"Variable\"},{\"value\":\"2\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"1\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"False\",\"line\":3,\"tokentype\":\"Constant\"},{\"value\":\"True\",\"line\":5,\"tokentype\":\"Constant\"}],\"line\":2}],\"valueList\":[\"$ret\",{\"name\":\"ite\",\"args\":[{\"name\":\"Eq\",\"args\":[{\"name\":\"Mod\",\"args\":[{\"name\":\"x\",\"primed\":false,\"line\":2,\"tokentype\":\"Variable\"},{\"value\":\"2\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"1\",\"line\":2,\"tokentype\":\"Constant\"}],\"line\":2,\"tokentype\":\"Operation\"},{\"value\":\"False\",\"line\":3,\"tokentype\":\"Constant\"},{\"value\":\"True\",\"line\":5,\"tokentype\":\"Constant\"}],\"line\":2}]}]},\"loctrans\":{\"1\":{}},\"locdescs\":{\"1\":\"around the beginning of function 'is_odd'\"},\"types\":{}}}}",
  "function": "is_odd",
  "inputs": "",
  "args": "[2]"
}

Response:
The response contains the identified error locations of the reference and student solutions in JSON format.

Example Successful Response:
The below JSON response is an example of identified error location of the is_odd function in the reference and student solutions in JSON format.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
  "errorLocations": {
    "is_odd": [
      [
        [
          [
            {
              "tokentype": "Variable",
              "name": "$ret",
              "primed": "false",
              "line": 0
            },
            {
              "tokentype": "Variable",
              "name": "$ret",
              "primed": "false",
              "line": 0
            }
          ],
          [
            {
              "tokentype": "Variable",
              "name": "$out",
              "primed": "false",
              "line": 0
            },
            {
              "tokentype": "Variable",
              "name": "$out",
              "primed": "false",
              "line": 0
            }
          ],
          [
            {
              "tokentype": "Variable",
              "name": "x",
              "primed": "false",
              "line": 2
            },
            {
              "tokentype": "Variable",
              "name": "x",
              "primed": "false",
              "line": 2
            }
          ],
          [
            {
              "tokentype": "Variable",
              "name": "$in",
              "primed": "false",
              "line": 0
            },
            {
              "tokentype": "Variable",
              "name": "$in",
              "primed": "false",
              "line": 0
            }
          ]
        ],
        [
          {
            "errorType": "VariableValueMismatch",
            "locationInReference": 1,
            "locationInSubmission": 1,
            "erroneousVariablesInSubmission": [
              {
                "tokentype": "Variable",
                "name": "$ret",
                "primed": "false",
                "line": 0
              }
            ]
          }
        ]
      ]
    ]
  },
  "errorInputs": []
}

Repair Engines API

Request Format:
- language: A string representing the programming language of the source code. The API supports "c", "python", or "java".
- reference_solution: A list of string containing the response of the Parser API for the reference solutions.
- student_solution: A string containing the response of the Parser API for the student solution.
- function: A string represents entry function name of the programming assignment.
- inputs: A string represents IO inputs of the programs.
- args: A string represent argument inputs of the entry function.

Example Request Body:

1
2
3
4
5
6
7
8
{
  "language": "python",
  "reference_solution": "{\n    \"importStatements\": [],\n    \"fncs\": {\n        \"main\": {\n            \"name\": \"main\",\n            \"rettype\": \"*\",\n            \"initloc\": 1,\n            \"endloc\": 0,\n            \"params\": [],\n            \"locexprs\": {\n                \"1\": [\n                    {\n                        \"val0\": \"a\",\n                        \"val1\": {\n                            \"value\": \"10\",\n                            \"line\": 2,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"a\",\n                            {\n                                \"value\": \"10\",\n                                \"line\": 2\n                            }\n                        ],\n                        \"valueList\": [\n                            \"a\",\n                            {\n                                \"value\": \"10\",\n                                \"line\": 2\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"b\",\n                        \"val1\": {\n                            \"value\": \"0\",\n                            \"line\": 3,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"b\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 3\n                            }\n                        ],\n                        \"valueList\": [\n                            \"b\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 3\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"iter#0\",\n                        \"val1\": {\n                            \"name\": \"range\",\n                            \"args\": [\n                                {\n                                    \"value\": \"0\",\n                                    \"line\": 4,\n                                    \"tokentype\": \"Constant\"\n                                },\n                                {\n                                    \"name\": \"a\",\n                                    \"primed\": true,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"iter#0\",\n                            {\n                                \"name\": \"range\",\n                                \"args\": [\n                                    {\n                                        \"value\": \"0\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    },\n                                    {\n                                        \"name\": \"a\",\n                                        \"primed\": true,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"iter#0\",\n                            {\n                                \"name\": \"range\",\n                                \"args\": [\n                                    {\n                                        \"value\": \"0\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    },\n                                    {\n                                        \"name\": \"a\",\n                                        \"primed\": true,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"ind#0\",\n                        \"val1\": {\n                            \"value\": \"0\",\n                            \"line\": 4,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"ind#0\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"ind#0\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 4\n                            }\n                        ]\n                    }\n                ],\n                \"2\": [\n                    {\n                        \"val0\": \"$cond\",\n                        \"val1\": {\n                            \"name\": \"Lt\",\n                            \"args\": [\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"name\": \"len\",\n                                    \"args\": [\n                                        {\n                                            \"name\": \"iter#0\",\n                                            \"primed\": false,\n                                            \"line\": 4,\n                                            \"tokentype\": \"Variable\"\n                                        }\n                                    ],\n                                    \"line\": 4,\n                                    \"tokentype\": \"Operation\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"$cond\",\n                            {\n                                \"name\": \"Lt\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"len\",\n                                        \"args\": [\n                                            {\n                                                \"name\": \"iter#0\",\n                                                \"primed\": false,\n                                                \"line\": 4,\n                                                \"tokentype\": \"Variable\"\n                                            }\n                                        ],\n                                        \"line\": 4,\n                                        \"tokentype\": \"Operation\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"$cond\",\n                            {\n                                \"name\": \"Lt\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"len\",\n                                        \"args\": [\n                                            {\n                                                \"name\": \"iter#0\",\n                                                \"primed\": false,\n                                                \"line\": 4,\n                                                \"tokentype\": \"Variable\"\n                                            }\n                                        ],\n                                        \"line\": 4,\n                                        \"tokentype\": \"Operation\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    }\n                ],\n                \"3\": [\n                    {\n                        \"val0\": \"$ret\",\n                        \"val1\": {\n                            \"name\": \"b\",\n                            \"primed\": false,\n                            \"line\": 6,\n                            \"tokentype\": \"Variable\"\n                        },\n                        \"valueArray\": [\n                            \"$ret\",\n                            {\n                                \"name\": \"b\",\n                                \"primed\": false,\n                                \"line\": 6\n                            }\n                        ],\n                        \"valueList\": [\n                            \"$ret\",\n                            {\n                                \"name\": \"b\",\n                                \"primed\": false,\n                                \"line\": 6\n                            }\n                        ]\n                    }\n                ],\n                \"4\": [\n                    {\n                        \"val0\": \"i\",\n                        \"val1\": {\n                            \"name\": \"GetElement\",\n                            \"args\": [\n                                {\n                                    \"name\": \"iter#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"i\",\n                            {\n                                \"name\": \"GetElement\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"iter#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"i\",\n                            {\n                                \"name\": \"GetElement\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"iter#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"ind#0\",\n                        \"val1\": {\n                            \"name\": \"Add\",\n                            \"args\": [\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"value\": \"1\",\n                                    \"line\": 4,\n                                    \"tokentype\": \"Constant\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"ind#0\",\n                            {\n                                \"name\": \"Add\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"ind#0\",\n                            {\n                                \"name\": \"Add\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"b\",\n                        \"val1\": {\n                            \"name\": \"Add\",\n                            \"args\": [\n                                {\n                                    \"name\": \"b\",\n                                    \"primed\": false,\n                                    \"line\": 5,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"value\": \"1\",\n                                    \"line\": 5,\n                                    \"tokentype\": \"Constant\"\n                                }\n                            ],\n                            \"line\": 5,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"b\",\n                            {\n                                \"name\": \"Add\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"b\",\n                                        \"primed\": false,\n                                        \"line\": 5,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 5,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 5\n                            }\n                        ],\n                        \"valueList\": [\n                            \"b\",\n                            {\n                                \"name\": \"Add\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"b\",\n                                        \"primed\": false,\n                                        \"line\": 5,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 5,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 5\n                            }\n                        ]\n                    }\n                ]\n            },\n            \"loctrans\": {\n                \"1\": {\n                    \"true\": 2\n                },\n                \"2\": {\n                    \"false\": 3,\n                    \"true\": 4\n                },\n                \"3\": {},\n                \"4\": {\n                    \"true\": 2\n                }\n            },\n            \"locdescs\": {\n                \"1\": \"around the beginning of function 'main'\",\n                \"2\": \"the condition of the 'for' loop at line 4\",\n                \"3\": \"*after* the 'for' loop starting at line 4\",\n                \"4\": \"inside the body of the 'for' loop beginning at line 5\"\n            },\n            \"types\": {\n                \"a\": \"*\",\n                \"b\": \"*\",\n                \"ind#0\": \"int\",\n                \"i\": \"*\",\n                \"iter#0\": \"int\"\n            }\n        }\n    }\n}",
  "student_solution": "{\n    \"importStatements\": [],\n    \"fncs\": {\n        \"main\": {\n            \"name\": \"main\",\n            \"rettype\": \"*\",\n            \"initloc\": 1,\n            \"endloc\": 0,\n            \"params\": [],\n            \"locexprs\": {\n                \"1\": [\n                    {\n                        \"val0\": \"a\",\n                        \"val1\": {\n                            \"value\": \"10\",\n                            \"line\": 2,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"a\",\n                            {\n                                \"value\": \"10\",\n                                \"line\": 2\n                            }\n                        ],\n                        \"valueList\": [\n                            \"a\",\n                            {\n                                \"value\": \"10\",\n                                \"line\": 2\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"b\",\n                        \"val1\": {\n                            \"value\": \"0\",\n                            \"line\": 3,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"b\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 3\n                            }\n                        ],\n                        \"valueList\": [\n                            \"b\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 3\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"iter#0\",\n                        \"val1\": {\n                            \"name\": \"range\",\n                            \"args\": [\n                                {\n                                    \"value\": \"0\",\n                                    \"line\": 4,\n                                    \"tokentype\": \"Constant\"\n                                },\n                                {\n                                    \"name\": \"a\",\n                                    \"primed\": true,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"iter#0\",\n                            {\n                                \"name\": \"range\",\n                                \"args\": [\n                                    {\n                                        \"value\": \"0\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    },\n                                    {\n                                        \"name\": \"a\",\n                                        \"primed\": true,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"iter#0\",\n                            {\n                                \"name\": \"range\",\n                                \"args\": [\n                                    {\n                                        \"value\": \"0\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    },\n                                    {\n                                        \"name\": \"a\",\n                                        \"primed\": true,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"ind#0\",\n                        \"val1\": {\n                            \"value\": \"0\",\n                            \"line\": 4,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"ind#0\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"ind#0\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 4\n                            }\n                        ]\n                    }\n                ],\n                \"2\": [\n                    {\n                        \"val0\": \"$cond\",\n                        \"val1\": {\n                            \"name\": \"Lt\",\n                            \"args\": [\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"name\": \"len\",\n                                    \"args\": [\n                                        {\n                                            \"name\": \"iter#0\",\n                                            \"primed\": false,\n                                            \"line\": 4,\n                                            \"tokentype\": \"Variable\"\n                                        }\n                                    ],\n                                    \"line\": 4,\n                                    \"tokentype\": \"Operation\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"$cond\",\n                            {\n                                \"name\": \"Lt\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"len\",\n                                        \"args\": [\n                                            {\n                                                \"name\": \"iter#0\",\n                                                \"primed\": false,\n                                                \"line\": 4,\n                                                \"tokentype\": \"Variable\"\n                                            }\n                                        ],\n                                        \"line\": 4,\n                                        \"tokentype\": \"Operation\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"$cond\",\n                            {\n                                \"name\": \"Lt\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"len\",\n                                        \"args\": [\n                                            {\n                                                \"name\": \"iter#0\",\n                                                \"primed\": false,\n                                                \"line\": 4,\n                                                \"tokentype\": \"Variable\"\n                                            }\n                                        ],\n                                        \"line\": 4,\n                                        \"tokentype\": \"Operation\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    }\n                ],\n                \"3\": [\n                    {\n                        \"val0\": \"$ret\",\n                        \"val1\": {\n                            \"name\": \"b\",\n                            \"primed\": false,\n                            \"line\": 6,\n                            \"tokentype\": \"Variable\"\n                        },\n                        \"valueArray\": [\n                            \"$ret\",\n                            {\n                                \"name\": \"b\",\n                                \"primed\": false,\n                                \"line\": 6\n                            }\n                        ],\n                        \"valueList\": [\n                            \"$ret\",\n                            {\n                                \"name\": \"b\",\n                                \"primed\": false,\n                                \"line\": 6\n                            }\n                        ]\n                    }\n                ],\n                \"4\": [\n                    {\n                        \"val0\": \"i\",\n                        \"val1\": {\n                            \"name\": \"GetElement\",\n                            \"args\": [\n                                {\n                                    \"name\": \"iter#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"i\",\n                            {\n                                \"name\": \"GetElement\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"iter#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"i\",\n                            {\n                                \"name\": \"GetElement\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"iter#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"ind#0\",\n                        \"val1\": {\n                            \"name\": \"Add\",\n                            \"args\": [\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"value\": \"1\",\n                                    \"line\": 4,\n                                    \"tokentype\": \"Constant\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"ind#0\",\n                            {\n                                \"name\": \"Add\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"ind#0\",\n                            {\n                                \"name\": \"Add\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"b\",\n                        \"val1\": {\n                            \"name\": \"Sub\",\n                            \"args\": [\n                                {\n                                    \"name\": \"b\",\n                                    \"primed\": false,\n                                    \"line\": 5,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"value\": \"1\",\n                                    \"line\": 5,\n                                    \"tokentype\": \"Constant\"\n                                }\n                            ],\n                            \"line\": 5,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"b\",\n                            {\n                                \"name\": \"Sub\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"b\",\n                                        \"primed\": false,\n                                        \"line\": 5,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 5,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 5\n                            }\n                        ],\n                        \"valueList\": [\n                            \"b\",\n                            {\n                                \"name\": \"Sub\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"b\",\n                                        \"primed\": false,\n                                        \"line\": 5,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 5,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 5\n                            }\n                        ]\n                    }\n                ]\n            },\n            \"loctrans\": {\n                \"1\": {\n                    \"true\": 2\n                },\n                \"2\": {\n                    \"false\": 3,\n                    \"true\": 4\n                },\n                \"3\": {},\n                \"4\": {\n                    \"true\": 2\n                }\n            },\n            \"locdescs\": {\n                \"1\": \"around the beginning of function 'main'\",\n                \"2\": \"the condition of the 'for' loop at line 4\",\n                \"3\": \"*after* the 'for' loop starting at line 4\",\n                \"4\": \"inside the body of the 'for' loop beginning at line 5\"\n            },\n            \"types\": {\n                \"a\": \"*\",\n                \"b\": \"*\",\n                \"ind#0\": \"int\",\n                \"i\": \"*\",\n                \"iter#0\": \"int\"\n            }\n        }\n    }\n}",
  "function": "main",
  "inputs": "[]",
  "args": ""
}

Response:
The response contains the program patch generated by the repair engine to fix the student submission in JSON format.

Example Successful Response:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[
  {
    "lineNumber": 5,
    "oldExpr": "b = (b - 1)",
    "newExpr": "b = (b + 1)",
    "repairStrings": [
      "Wrong expression. Change b = (b - 1) to b = (b + 1);"
    ]
  }
]

Feedback Generators API

Request Format:
- prob_desc: A string representing the problem description of the programming assignment.
- student_solution: A string containing the response of the Parser API for the student solution.
- repair: A string containing the response of the Repair Engines API for the student solution.

Example Request Format:

1
2
3
4
5
{
  "prob_desc": "Calculate the sum of the first 10 natural numbers.",
  "student_solution": "{\n    \"importStatements\": [],\n    \"fncs\": {\n        \"main\": {\n            \"name\": \"main\",\n            \"rettype\": \"*\",\n            \"initloc\": 1,\n            \"endloc\": 0,\n            \"params\": [],\n            \"locexprs\": {\n                \"1\": [\n                    {\n                        \"val0\": \"a\",\n                        \"val1\": {\n                            \"value\": \"10\",\n                            \"line\": 2,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"a\",\n                            {\n                                \"value\": \"10\",\n                                \"line\": 2\n                            }\n                        ],\n                        \"valueList\": [\n                            \"a\",\n                            {\n                                \"value\": \"10\",\n                                \"line\": 2\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"b\",\n                        \"val1\": {\n                            \"value\": \"0\",\n                            \"line\": 3,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"b\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 3\n                            }\n                        ],\n                        \"valueList\": [\n                            \"b\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 3\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"iter#0\",\n                        \"val1\": {\n                            \"name\": \"range\",\n                            \"args\": [\n                                {\n                                    \"value\": \"0\",\n                                    \"line\": 4,\n                                    \"tokentype\": \"Constant\"\n                                },\n                                {\n                                    \"name\": \"a\",\n                                    \"primed\": true,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"iter#0\",\n                            {\n                                \"name\": \"range\",\n                                \"args\": [\n                                    {\n                                        \"value\": \"0\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    },\n                                    {\n                                        \"name\": \"a\",\n                                        \"primed\": true,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"iter#0\",\n                            {\n                                \"name\": \"range\",\n                                \"args\": [\n                                    {\n                                        \"value\": \"0\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    },\n                                    {\n                                        \"name\": \"a\",\n                                        \"primed\": true,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"ind#0\",\n                        \"val1\": {\n                            \"value\": \"0\",\n                            \"line\": 4,\n                            \"tokentype\": \"Constant\"\n                        },\n                        \"valueArray\": [\n                            \"ind#0\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"ind#0\",\n                            {\n                                \"value\": \"0\",\n                                \"line\": 4\n                            }\n                        ]\n                    }\n                ],\n                \"2\": [\n                    {\n                        \"val0\": \"$cond\",\n                        \"val1\": {\n                            \"name\": \"Lt\",\n                            \"args\": [\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"name\": \"len\",\n                                    \"args\": [\n                                        {\n                                            \"name\": \"iter#0\",\n                                            \"primed\": false,\n                                            \"line\": 4,\n                                            \"tokentype\": \"Variable\"\n                                        }\n                                    ],\n                                    \"line\": 4,\n                                    \"tokentype\": \"Operation\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"$cond\",\n                            {\n                                \"name\": \"Lt\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"len\",\n                                        \"args\": [\n                                            {\n                                                \"name\": \"iter#0\",\n                                                \"primed\": false,\n                                                \"line\": 4,\n                                                \"tokentype\": \"Variable\"\n                                            }\n                                        ],\n                                        \"line\": 4,\n                                        \"tokentype\": \"Operation\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"$cond\",\n                            {\n                                \"name\": \"Lt\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"len\",\n                                        \"args\": [\n                                            {\n                                                \"name\": \"iter#0\",\n                                                \"primed\": false,\n                                                \"line\": 4,\n                                                \"tokentype\": \"Variable\"\n                                            }\n                                        ],\n                                        \"line\": 4,\n                                        \"tokentype\": \"Operation\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    }\n                ],\n                \"3\": [\n                    {\n                        \"val0\": \"$ret\",\n                        \"val1\": {\n                            \"name\": \"b\",\n                            \"primed\": false,\n                            \"line\": 6,\n                            \"tokentype\": \"Variable\"\n                        },\n                        \"valueArray\": [\n                            \"$ret\",\n                            {\n                                \"name\": \"b\",\n                                \"primed\": false,\n                                \"line\": 6\n                            }\n                        ],\n                        \"valueList\": [\n                            \"$ret\",\n                            {\n                                \"name\": \"b\",\n                                \"primed\": false,\n                                \"line\": 6\n                            }\n                        ]\n                    }\n                ],\n                \"4\": [\n                    {\n                        \"val0\": \"i\",\n                        \"val1\": {\n                            \"name\": \"GetElement\",\n                            \"args\": [\n                                {\n                                    \"name\": \"iter#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"i\",\n                            {\n                                \"name\": \"GetElement\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"iter#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"i\",\n                            {\n                                \"name\": \"GetElement\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"iter#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"ind#0\",\n                        \"val1\": {\n                            \"name\": \"Add\",\n                            \"args\": [\n                                {\n                                    \"name\": \"ind#0\",\n                                    \"primed\": false,\n                                    \"line\": 4,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"value\": \"1\",\n                                    \"line\": 4,\n                                    \"tokentype\": \"Constant\"\n                                }\n                            ],\n                            \"line\": 4,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"ind#0\",\n                            {\n                                \"name\": \"Add\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ],\n                        \"valueList\": [\n                            \"ind#0\",\n                            {\n                                \"name\": \"Add\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"ind#0\",\n                                        \"primed\": false,\n                                        \"line\": 4,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 4,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 4\n                            }\n                        ]\n                    },\n                    {\n                        \"val0\": \"b\",\n                        \"val1\": {\n                            \"name\": \"Sub\",\n                            \"args\": [\n                                {\n                                    \"name\": \"b\",\n                                    \"primed\": false,\n                                    \"line\": 5,\n                                    \"tokentype\": \"Variable\"\n                                },\n                                {\n                                    \"value\": \"1\",\n                                    \"line\": 5,\n                                    \"tokentype\": \"Constant\"\n                                }\n                            ],\n                            \"line\": 5,\n                            \"tokentype\": \"Operation\"\n                        },\n                        \"valueArray\": [\n                            \"b\",\n                            {\n                                \"name\": \"Sub\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"b\",\n                                        \"primed\": false,\n                                        \"line\": 5,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 5,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 5\n                            }\n                        ],\n                        \"valueList\": [\n                            \"b\",\n                            {\n                                \"name\": \"Sub\",\n                                \"args\": [\n                                    {\n                                        \"name\": \"b\",\n                                        \"primed\": false,\n                                        \"line\": 5,\n                                        \"tokentype\": \"Variable\"\n                                    },\n                                    {\n                                        \"value\": \"1\",\n                                        \"line\": 5,\n                                        \"tokentype\": \"Constant\"\n                                    }\n                                ],\n                                \"line\": 5\n                            }\n                        ]\n                    }\n                ]\n            },\n            \"loctrans\": {\n                \"1\": {\n                    \"true\": 2\n                },\n                \"2\": {\n                    \"false\": 3,\n                    \"true\": 4\n                },\n                \"3\": {},\n                \"4\": {\n                    \"true\": 2\n                }\n            },\n            \"locdescs\": {\n                \"1\": \"around the beginning of function 'main'\",\n                \"2\": \"the condition of the 'for' loop at line 4\",\n                \"3\": \"*after* the 'for' loop starting at line 4\",\n                \"4\": \"inside the body of the 'for' loop beginning at line 5\"\n            },\n            \"types\": {\n                \"a\": \"*\",\n                \"b\": \"*\",\n                \"ind#0\": \"int\",\n                \"i\": \"*\",\n                \"iter#0\": \"int\"\n            }\n        }\n    }\n}",
  "repair": "[\n  {\n    \"lineNumber\": 5,\n    \"oldExpr\": \"b = (b - 1)\",\n    \"newExpr\": \"b = (b + 1)\",\n    \"repairStrings\": [\n      \"Wrong expression. Change b = (b - 1) to b = (b + 1);\"\n    ]\n  }\n]",
}

Response: The response contains the feedback generated by the Generative AI models in the feedback generator for the student solution in JSON format.

Example Successful Response:

1
2
3
4
5
6
7
8
{
  "feedback": [
    {
      "lineNumber": 5,
      "feedback": "The student made a mistake in the inner loop condition at line 5 about the increment of the variable. To further understand the mistake, the student should recap the increment and decrement operators in C programming."
    }
  ]
}