1-1hit |
We propose a new inferring programmers' intention system COSMO based on a classification of assignment statements. COSMO is a subsystem of our intelligent programming environment for programming education. The programming environment consists of a program understanding system designed for novice programmers and a novice program evaluation support system designed for teachers, both of which use the technique of the program slicing. Usually, the method of program slicing requires selection of slicing criteria. However, automatic selection of effective slicing criteria is difficult. Here we propose a new inferring programmers' intention system COSMO with automatic selection of effective slicing criteria. In our system, the slicing criteria are inferred using the context structure model of programs. Programs are regarded as natural language texts in the model and analyzed using a similar thinking in context structure analyses of natural language texts. The model is based on a classification of assignment statements using dependence analysis of programs. Furthermore, COSMO obtains networks with information on top-down decomposition of problems as a result of inferring programmers' intention. Therefore, COSMO is useful for understanding programs without presupposed knowledge.