| Programs’ equivalence Assessment technology has been widely applied in current software field,such as auto-assessment for students’program exercise,on line test, code plagiarism and so on.So far, research for program exercises’aut omatic judged by system both at program structure and semantic level is comp aratively rare. Based on program attribute syntactic tree method is popularly us ed,but merely tangle changeful program exersice by one fixed method is weak and the result is not satisfied.The thesis introduced the theory of program attribute,delved into program assessment techniques based on abstract syntactic tree and program dependence graph,and analyse each of their advantage and disadvantage,conclude their characteristics.Based on above work,we proposed a new system which is able to auto-matic to choose assessment method according to the program’s attribute,it has been verified and gain a better result compared to manual judge.Firstly, we have conducted better research toward assessment method based on AST. By mastering the rules of Antlr,we build the grammar of generating t he AST,at the meantime we normanize the control statement and some otherex pressions in C language,resulting normalized AST.Then we walking the AST,an d do some optimization job to the code sequence,such as simplified code,memo ry change,deleteing leafs and so on.Then we use Needleman-Wunschand Smith-Waterman algorithm to match the cose sequence and comte to the result of tw o program’s similarity.Secondly,we introduce a method based on program dependence graph to assess students’ program job.By fully understanding the principle of PDG,we have analyzed Program flow char for important control statements in C language.Combined with programs’ traits,we attach great importance on analyzing how PDG could solve the problem of redundant code and disorded statements.Then we give the realization method of assess method based on PDGThirdly,we give the system’s flow char of deign,then by using two sorce code example to illustrate each methods’advantage and disadvantage,with above done work we proposed a new model which was able to auto choose assessment method to judge program job,data analysis show that this model is better.Finally,we conclude the whole thesis and looking forward to next research direction. |