Formal description method of matrix code generation technology based on Coq

A formal description and matrix code technology, applied in the field of formal description, can solve problems such as functional programs that are not suitable for expressing matrices, matrix codes cannot be generated, and translation is not enough

Pending Publication Date: 2022-03-08
NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Although there are already some formal methods for matrices in the field of theorem proving, some of these formalization techniques are cumbersome, and some are not suitable for expressing functional programs about matrices.
The primitives and rules provided by DPIA itself are not enough to support the translation of some functional programs of the matrix, so it is impossible to generate more complex matrix codes, such as matrix transposition, block matrix operations, etc.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Formal description method of matrix code generation technology based on Coq
  • Formal description method of matrix code generation technology based on Coq
  • Formal description method of matrix code generation technology based on Coq

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0074] see Figure 1-Figure 8 , the present embodiment provides a formalized description method based on Coq-based matrix code generation technology, the logic block diagram of the method is as follows figure 1 As shown, the method specifically includes:

[0075] 1) Formally describe data types, function primitives, and command primitives. The specific implementation is as follows:

[0076] ① Establish the Coq inductive definition of data types: the data types in the DPIA principle include numerical types, index types, array types, dual types, and corresponding receivers and expression types, such as figure 2 , 3 , 4 shown. This embodiment constructs these types of Coq formal definitions:

[0077] Definition kinds:Type:=Type.

[0078] Inductive data:kinds:=

[0079] |num:data(*numerical type*)

[0080] |idx:nat->data(*index type*)

[0081] |ary:nat->data->data(*array type*)

[0082] |tensor:data->data->data.(*dual type*)

[0083] Definition phrase:kinds:=Type.

[0...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a formalized description method of a matrix code generation technology based on Coq, which is used for carrying out formalized description on the matrix code generation technology in a Coq theorem prover according to a DPIA principle, and perfecting and expanding the matrix code generation technology, and specifically comprises the following steps: carrying out formalized description on a data type, a function primitive and a command primitive; performing formalized description on the translator and the code conversion rule; realizing code conversion by utilizing a rewriting technology; defining a new variable name automatic generation rule, and solving the problem of variable name repetition; the primitives and rules are extended to achieve transcoding of more matrix operations. According to the method, a formalization technology is applied to a matrix code generation technology, the matrix code generation technology from a functional matrix code with an execution strategy to a parallel matrix C code is realized in a Coq theorem prover, and the problem of new variable naming repetition is solved.

Description

technical field [0001] The invention relates to the technical field of formal description, in particular to a formal description method based on Coq-based matrix code generation technology. Background technique [0002] The demand from intelligent computing has increased the complexity of matrix calculations. Parallel hardware has greatly improved the performance of matrix calculations. High-performance matrix codes are imperative codes, but functional matrix descriptions are suitable for matrix mathematical properties. Proofs and optimization of matrix expressions, but matrix code in functional languages ​​is not efficient. Atkey et al. proposed a method to convert functional matrix descriptions to imperative codes Data Parallel Idealized Algol (DPIA) (Atkey R, Steuwer M, Lindley S, et al.Strategy Preserving Compilation for Parallel Functional Code[J]. 2017), which is an extension of Syntactic Control of Inference Revisited (O'Hearn P W, Power A J, Takeyama M, et al. Synta...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/16G06F8/30
CPCG06F17/16G06F8/30
Inventor 陈钢麻莹莹
Owner NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products