Verification of computer-executable code generated from a slice of a model
First Claim
Patent Images
1. One or more tangible non-transitory computer-readable storage media storing instructions, the instructions comprising:
- one or more instructions that, when executed by one or more processors, cause the one or more processors to;
slice a model into a plurality of slices,each slice, of the plurality of slices, including a different portion of the model;
select a slice from the plurality of slices;
identify a portion of code, in code generated from the model, that corresponds to the selected slice;
determine that the portion of code is unverifiable;
determine, based on the portion of code being unverifiable, that the selected slice is unverifiable;
modify the portion of the model included in the selected slice to form a modified slice,the modified slice being verifiable, andthe modified portion of the model being functionally equivalent to the portion of the model;
generate a first intermediate representation based on the modified slice;
generate a second intermediate representation based on the portion of code;
normalize the first intermediate representation and the second intermediate representation;
determine that the normalized second intermediate representation includes a corresponding element for each element included in the normalized first intermediate representation;
determine that the normalized first intermediate representation includes a corresponding element for each element included in the normalized second intermediate representation; and
verify that the portion of code is equivalent to the selected slice based on the normalized second intermediate representation including the corresponding element for each element included in the normalized first intermediate representation and the normalized first intermediate representation including the corresponding element for each element included in the normalized second intermediate representation.
1 Assignment
0 Petitions
Accused Products
Abstract
In an embodiment, a model is sliced into a plurality of slices. A slice in the plurality of slices is selected. A portion of code, that corresponds to the selected slice, is identified from code generated from the model. The identified code is verified to be equivalent to the selected slice. Equivalence may include equivalent functionality, equivalent data types, equivalent performance, and/or other forms of equivalence between the selected slice and the identified generated code.
-
Citations
24 Claims
-
1. One or more tangible non-transitory computer-readable storage media storing instructions, the instructions comprising:
one or more instructions that, when executed by one or more processors, cause the one or more processors to; slice a model into a plurality of slices, each slice, of the plurality of slices, including a different portion of the model; select a slice from the plurality of slices; identify a portion of code, in code generated from the model, that corresponds to the selected slice; determine that the portion of code is unverifiable; determine, based on the portion of code being unverifiable, that the selected slice is unverifiable; modify the portion of the model included in the selected slice to form a modified slice, the modified slice being verifiable, and the modified portion of the model being functionally equivalent to the portion of the model; generate a first intermediate representation based on the modified slice; generate a second intermediate representation based on the portion of code; normalize the first intermediate representation and the second intermediate representation; determine that the normalized second intermediate representation includes a corresponding element for each element included in the normalized first intermediate representation; determine that the normalized first intermediate representation includes a corresponding element for each element included in the normalized second intermediate representation; and verify that the portion of code is equivalent to the selected slice based on the normalized second intermediate representation including the corresponding element for each element included in the normalized first intermediate representation and the normalized first intermediate representation including the corresponding element for each element included in the normalized second intermediate representation. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
-
14. A method comprising:
-
selecting a slice of a model from a plurality of slices of the model, the plurality of slices of the model being identified based on one or more criteria, and selecting the slice being performed by a device; identifying a portion of code, in code generated for the model, that corresponds to the selected slice, identifying the portion of code being performed by the device; determining that the portion of code cannot be verified, determining that the portion of code cannot be verified being performed by the device; determining, based on determining that the portion of code cannot be verified, that a portion of the model included in the selected slice cannot be verified, determining that the portion of model cannot be verified being performed by the device; modifying the portion of the model to form a modified slice that can be verified, the modified slice being functionally equivalent to the portion of the model, and modifying the portion of the model being performed by the device; generating an intermediate representation (IR) of the modified slice of the model, generating the IR of the modified slice being performed by the device; generating an IR of the portion of code, generating the IR of the portion of the code being performed by the device; and normalizing the IR of the modified slice and the IR of the portion of the code, normalizing the IR of the modified slice and the IR of the portion of code being performed by the device; determining that the normalized IR of the portion of code includes a corresponding element for each element included in the normalized IR of the modified slice and that the normalized IR of the modified slice includes a corresponding element for each element included in the normalized IR of the portion of the code, determining that the normalized IR of the portion of code includes the corresponding element for each element included in the normalized IR of the modified slice and that the normalized IR of the modified slice includes the corresponding element for each element included in the normalized IR of the portion of the code being performed by the device; verifying that the selected slice is equivalent to the portion of code based on determining that the normalized IR of the portion of code includes the corresponding element for each element included in the normalized IR of the modified slice and that the normalized IR of the modified slice includes the corresponding element for each element included in the normalized IR of the portion of the code, verifying that the selected slice is equivalent to the portion of code being performed by the device. - View Dependent Claims (15, 16, 17, 18, 19)
-
-
20. One or more tangible non-transitory computer-readable storage media storing instructions, the instructions comprising:
one or more instructions that, when executed by one or more processors, cause the one or more processors to; select a slice of a model from a plurality of slices of the model, the plurality of slices of the model being sliced based on one or more criteria associated with the model, and the selected slice containing a portion of the model; identify a portion of code, in code generated for the model, that corresponds to the portion of the model contained in the selected slice; determine that the portion of code is unverifiable; determine, based on the portion of code being unverifiable, that the selected slice is unverifiable; modify the portion of the model to form a modified slice, the modified slice being verifiable, and the modified portion of the model being functionally equivalent to the portion of the model; generate a first intermediate representation (IR) based on the modified slice; generate a second IR based on the portion of code; normalize the first IR and the second IR; determine that the normalized first IR includes a corresponding element for each element included in the normalized second IR; determine that the normalized second IR includes a corresponding element for each element included in the normalized first IR; and verify that the portion of the model and the portion of code are equivalent based on the normalized first IR including the corresponding element for each element included in the normalized second IR and the normalized second IR including the corresponding element for each element included in the normalized first IR. - View Dependent Claims (21)
-
22. One or more tangible non-transitory computer-readable storage media storing instructions, the instructions comprising:
one or more instructions that, when executed by one or more processors, cause the one or more processors to; slice a model into a plurality of slices based on an output of each portion, of a plurality of portions of the model; select a first slice included in the plurality of slices, the first slice being associated with a first portion of the plurality of portions of the model; determine that a portion of code, generated from the model, cannot be verified, the portion of code corresponding to the first portion of the model; determine, based on determining that the portion of code cannot be verified, that the first slice cannot be verified; modify the first portion of the model to form a modified slice, the modified slice being verifiable, and the modified first portion of the model being functionally equivalent to the first portion of the model; generate a first intermediate representation based on the modified slice; generate a second intermediate representation based on the portion of code; normalize the first intermediate representation and the second intermediate representation; determine that the normalized second intermediate representation includes a corresponding element for each element included in the normalized first intermediate representation; determine that the normalized first intermediate representation includes a corresponding element for each element included in the normalized second intermediate representation; verify that the portion of code is equivalent to the first portion of the model based on the normalized second intermediate representation including the corresponding element for each element included in the normalized first intermediate representation and the normalized first intermediate representation including the corresponding element for each element included in the normalized second intermediate representation; and provide a first indication, in a block diagram of the model, that indicates that the first portion of the model has been verified. - View Dependent Claims (23)
-
24. One or more tangible non-transitory computer-readable storage media storing instructions, the instructions comprising:
one or more instructions that, when executed by the one or more processors, cause the one or more processors to; identify a slice of code, of a plurality of slices of code generated from a model, the slice of code corresponding to a particular portion, of a plurality of portions, of the model; determine that the slice of code is unverifiable; determine, based on the slice of code being unverifiable, that the particular portion of the model is unverifiable; modify the particular portion of the model to form a modified portion of the model, the modified portion of the model being verifiable, and the modified portion of the model being functionally equivalent to the particular portion of the model; generate a first intermediate representation based on the modified portion of the model; generate a second intermediate representation based on the slice of code; normalize the first intermediate representation and the second intermediate representation; determine that the normalized second intermediate representation includes a corresponding element for each element included in the normalized first intermediate representation; determine that the normalized first intermediate representation includes a corresponding element for each element included in the normalized second intermediate representation; and verify that the slice of code is equivalent to the particular portion of the model based on the normalized second intermediate representation including the corresponding element for each element included in the normalized first intermediate representation and the normalized first intermediate representation including the corresponding element for each element included in the normalized second intermediate representation.
Specification