We propose a systematic method to deduce and synthesize the Dafny programs. First, specification of problem is described in strict mathematical language. Then, derivation process uses program transformation technology perform equivalent transformation. Furthermore, synthesized through obtained recursive relationship loop invariants. Finally, functional correctness automatically verified by veri...