计算机科学 ›› 2023, Vol. 50 ›› Issue (6A): 220400108-7.doi: 10.11896/jsjkx.220400108
沈楠, 陈钢
SHEN Nan, CHEN Gang
摘要: 矩阵是一种在计算机科学中应用广泛的数据结构,其运算正确性具有重要意义。矩阵求逆在矩阵形式化工作当中缺乏合理且实用的形式化工作。其原因在于,工程中现有的两种常见求逆方法的形式化均存在难点。第一种是基于伴随矩阵求解方法,难点在于无法形式化地表示n*n矩阵的子矩阵,导致构建余子式组成的矩阵十分困难,因此难以实现伴随矩阵求解逆矩阵形式化;第二种称作高斯约旦初等变换求解法,难点在于构造初等矩阵及其操作函数。若使用Coq归纳结构设计操作函数,即采用行优先填充二维表的思想,将舍弃列维度对二维表的描述信息,使得操作函数分支过多,需要设计复杂的归纳结构,导致后续形式化验证无法进行。文中提出了基于记录的矩阵函数构建法,使用行列两种维度同时描述矩阵,使得构造并证明初等矩阵成为可能,在此基础上实现了在Coq系统中基于高斯约旦消元法的矩阵求逆的形式化工作。以一种代价更小且时间复杂度更低的方式,实现了首个形式化验证下的软件逆矩阵函数库。
中图分类号:
[1]CHEN G,QIU Z Y,SONG X Y,et al.A Report from Head Start:Formalizing Engineering Mathematics[J].Communications of China Computer Society,2017:92-93. [2]ALMEIDA JB,FRADE M J,PINTO J S,et al.An overview of formal methods tools and techniques[C]//Rigorous Software Development.London:Springer,2011:15-44. [3]HATEL P H,MOREAU L.Formalizing the safety of Java,the Java virtual machine,and Java card[J].ACM Computing Surveys(CSUR),2001,33(4):15-44. [4]BERTOT Y,CASTERAN P.Interactive Theorem Proving and Program Development[M]//Interactive theorem proving and program development.Coq’Art:The Calculus of Inductive Constructions.Springer,2004. [5]LI L M,SHI Z P,GUAN Y,et al.Formalizing the Matrix Inversion Based on the Adjugate Matrix in HOL4[C]//8th International Conference on Intelligent Information Processing(IIP).2014:178-186. [6]MA Z W,CHEN G.Matrix Formalization Based on Coq Record[J].Computer Science,2019,46(7):139-145. [7]SHI Z P,LIU Z K,GUAN Y,et al.Formalization of FunctionMatrix Theory in HOL[J].Journal of Applied Mathematics,2014,SI(1):1-10. [8]KANG X N,SHI Z P,YE S W,et al.Formalization of MatrixTransformation Theory in HOL4[J].Computer Simulation,2014(3):1-16. [9]YANG X M,GUAN Y,SHI Z P,et al.Higher-order Logic Formalization of Function Matrix and its Calculus[J].Computer Science,2016(11):24-29. [10]BIHA S O.Finite groups representation theory with Coq[C]//8th International Conference on Mathematical Knowledge Mana-gement.Berlin:Spriger,2009:438-452. [11]HERAS J,POZA M,DÉNÈS M.Incidence Simplicial Matrices Formalized in Coq/SSReflect[M].Spriner_verlag,2011:30-44. [12]DENES M,BERTOT Y.Experiments with computable matricesin the Coq system[R].France:INRIA,2011:2-27. [13]BOLDO S,LELAY C,MELQUIOND G.Coquelicot:A User-Friendly Library of Real Analysis for Coq[J].Mathematics in Computer Science,2015,9(1):41-62. [14]MA Y Y,MA Z W,CHEN G.Formalization of Operations of Block Matrix Based on Coq[J].Ruan Jian Xue Bao/Journal of Software,2021,32(6):1882-1909. |
|