行为模型的精化是软件工程中的基于模型驱动开发的关键问题.基于针对环境的形式化行为模型和形式化方法中的精化理论,提出了一种基于遗传规划的行为模型的自动精化方法.该方法将精化看作可执行的基本操作的组合过程.首先通过分析抽象行为的后置条件公式,执行基于逻辑归约的精化方法,从而生成循环结构和其他简单新行为的描述.然后利用基于遗传规划的精化方法对新行为继续精化,直到产生的程序最终由基本操作构成.由于传统的遗传规划方法对选择结构难以演化,提出了组合终止条件的概念.通过测试组合终止条件,选择结构也能较好的产生.最后以排序问题为例,给出实际的演化过程,结果说明该方法具有较强的可行性.事实上该方法适用于任何由若干基本操作组合以完成复杂操作的问题求解过程.
The refinement of behavioral models is a crucial issue in model driven software development. In this paper, according to the formal behavioral models for environment description and the refinement theory in formal methodology, an automatic method for the refinement of behavior models based on genetic programming is proposed. The method regards the refinement as the assembling process of some basic executable operations. In the beginning, by means of analyzing the post condition formula of the abstract behavior, the refinement based on the logic reduction is carried out, and thus the loop structures and other simple formulae are produced. The simple formulae are used to construct new abstract behaviors, and they are refined sequentially by the refinement based on genetic programming until the generated program is comprised of the basic operations finally. Since choice structures are difficult to evolve by traditional genetic programming, the authors introduce the conception of combination termination criterion. By testing this criterion, the choice structures are created as well. Finally, sorting is taken as an example to demonstrate the evolutionary process, and the result shows that the proposed method is fairly feasible. As a matter of fact, the method can be used in the problem solving areas in which the solution is composed of some basic operations.