PROOF OF THE FUNCTIONALITY OF A COMPUTER PROGRAM USING A QUANTUM COMPUTER AND A PROOF ASSISTANT
The integration of a quantum computer and proof assistant for encoding and verifying proof states improves the reliability and security of software by efficiently generating and validating proof steps, addressing the limitations of traditional proof assistants.
Patent Information
- Application Number
- DE102024115482
- Authority / Receiving Office
- DE · DE
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2025-12-04
AI Technical Summary
Existing proof assistants are not fully utilized for ensuring the correctness and reliability of computer programs, lacking efficient methods to verify and improve the functionality and security of software systems.
A method utilizing a quantum computer and a proof assistant to encode a proof state into a quantum state, leveraging quantum machine learning to generate proof steps, and integrating with a classical proof assistant for iterative verification.
Enhances the efficiency and accuracy of proving computer program statements, identifying and eliminating vulnerabilities, and ensuring the correctness and security of software before deployment.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical field
[0001] Various embodiments relate to computer systems and, in particular, to a method for proving a statement of a computer program. background
[0002] In computer science and mathematics, the process of proving the correctness of a statement or program can be carried out with the help of a proof assistant. Proof assistants are software tools used to create, verify, and manage formal proofs in mathematics and computer science. They provide a formal language for writing mathematical definitions, algorithms, and theorems, as well as an environment for developing machine-verified proofs. Proof assistants play a role in ensuring the correctness and reliability of mathematical proofs and software systems; however, there is a need for improved utilization of proof assistants. Summary
[0003] Exemplary embodiments provide a method (also called a proof method) for proving a statement of a computer program using a quantum computer and a proof assistant, wherein the statement describes a functionality of the computer program, and wherein the method comprises: a) encoding a current proof state into a vector of real numbers of fixed length, the current proof state defining a task for proving at least part of the statement; b) encoding the vector into a quantum state of a quantum system of the quantum computer; c) using the quantum state as an input quantum state by a quantum machine learning model to provide an output quantum state, the measurement of which constitutes a proof step for the defined task; d) measuring the output quantum state, thereby obtaining the proof step for the defined task;e) Providing the proof step to the proof assistant; f) in response to the provision of the proof step, receiving a next proof state from the proof assistant.
[0004] Exemplary embodiments provide a computer system for proving a statement of a computer program using a quantum computer and a proof assistant, wherein the statement describes a functionality of the computer program, the computer system includes the proof assistant, and the computer system is configured to: encode a current proof state into a vector of real numbers of a fixed length, the current proof state defining a task for proving at least part of the statement; control the quantum computer to encode the vector into a quantum state of a quantum system of the quantum computer; control the quantum computer to use the quantum state as an input quantum state by a quantum machine learning model to provide, through the quantum machine learning model, an output quantum state, the measurement of which constitutes a proof step for the defined task;Controlling the quantum computer to measure the initial quantum state in order to obtain the proof step for the defined task; Providing the evidence step to the evidence assistant; in response to the provision of the evidence step, receiving the next evidence state from the evidence assistant.
[0005] Exemplary embodiments provide a computer program product that includes instructions to cause a computer system to perform at least the following: encoding a current proof state into a vector of real numbers of a fixed length, wherein the current proof state defines a task for proving at least part of a statement of a computer program; controlling a quantum computer to encode the vector into a quantum state of a quantum system of the quantum computer; controlling the quantum computer to use the quantum state as an input quantum state by a quantum machine learning model to provide an output quantum state, the measurement of which constitutes a proof step for the defined task; controlling the quantum computer to measure the output quantum state to obtain the proof step for the defined task; and providing the proof step to a proof assistant.in response to the provision of the evidence step, receiving a next evidence state from the evidence assistant. Brief description of the drawings
[0006] The accompanying figures serve to further understand the examples and are an integral part of this description. The figures contain: Fig. 1 a diagram showing a computer system according to an example of the present subject. Fig. 2. A flowchart of a procedure for proving a statement of a computer program according to an example of the present subject matter. Fig. 3. A block diagram of an exemplary computer system for implementing at least part of the present method in accordance with an example of the present subject matter. Detailed description
[0007] In the following description, specific details such as particular architectures, interfaces, techniques, etc., are presented for illustrative purposes, not as limitations, to facilitate a comprehensive understanding of the examples. However, it will be clear to those skilled in the art that the disclosed subject matter can also be implemented in other examples that differ from these specific details. In some cases, detailed descriptions of known devices and / or methods are omitted to avoid cluttering the description with unnecessary details.
[0008] The present subject matter can facilitate debugging in computer programs as well as the identification and elimination of vulnerabilities. It can increase confidence in the reliability and functionality of computer programs by, for example, proving their correctness. By applying this proof method, potential errors and bugs can be identified and eliminated before the program is deployed. This can lead to improved software quality and a reduction in the risks associated with program errors or malfunctions.
[0009] The present object can prove the statement of the computer program using the quantum computer and the proof assistant.
[0010] A computer program can be a set of instructions written in a programming language that a computer can execute to perform a specific task or solve a problem. A statement can describe a functionality of the computer program. For example, a statement can be a specification of what the computer program should do. This specification can include properties, requirements, or invariants that the computer program should fulfill. The specification can serve as a precise description of the desired behavior of the computer program. A statement can be stored as a simple text file, in a database, or in a code repository. For example, a statement can be a compound statement, which may contain a sequence of statements. The sequence of statements can include, for example, intermediate statements or sub-statements of the compound statement.The combination of intermediate statements can represent (or correspond to) the composite statement of the computer program. Each intermediate statement can, for example, describe a functionality of a corresponding part of the computer program.
[0011] A proof assistant can be a software tool that helps in developing formal proofs. It can also be called an interactive theorem prover. A proof assistant can provide a formal language for formulating proofs and a set of rules for manipulating these formal expressions. The proof assistant can, for example, sequentially generate proof states during a proof process. A proof state can represent the current state of a proof within the proof assistant. It can represent a snapshot of the progress in constructing the proof and guide the subsequent application of proof steps. For example, a proof state can contain a goal or sub-goal that needs to be proven. The goal can represent a specific statement to be proven, where the specific statement can be the statement of the computer program or an intermediate statement.The proof state can optionally contain at least one of the following elements: a definition, a property, or an assumption that may be related to the goal defined in the proof state. The proof state can be updated when proof steps are applied. The proof state can be represented as a structured data object.
[0012] To prove the statement of the computer program using the quantum computer and the proof assistant, a proof procedure can be employed. This proof procedure includes step a) of encoding the current proof state into a vector of real numbers of fixed length. The current proof state can be encoded into a vector of real numbers. The vector has a predefined length. The current proof state defines a task for proving at least part of the statement. At the beginning of the proof procedure, the proof assistant can, for example, be provided with the statement of the computer program and the computer program itself. The proof assistant can then generate the current proof state, which defines the task of proving the entire statement.The statement of the computer program and the computer program itself can be formalized or expressed using the programming language or syntax of the proof assistant. The computer program can be expressed, for example, by defining its data types, functions, and operations. The statement of the computer program can be expressed as one or more theorems. The theorem can capture the desired functionality of the computer program. The theorem can be expressed using the syntax of the proof assistant, which provides a computational interpretation.
[0013] To illustrate this with an example: If the computer program implements a sorting algorithm, the statement of the computer program can be expressed by a theorem that states that the computer program has the function of arranging elements in a certain order, e.g., in ascending order.
[0014] In one example, the current proof state can be encoded into a fixed-length vector of real numbers by representing different aspects of the proof state as specific values within the vector. For instance, the vector could contain elements representing the goal or other relevant information about the proof state. By encoding the proof state into a vector, it can be made accessible for manipulation and processing by the quantum computer.
[0015] The proof procedure further includes step b)) of representing the vector in a quantum state of a quantum system of the quantum computer. For example, the vector of real numbers can be normalized before encoding so that the vector's values lie between zero and one. Once the vector representation of the proof state has been obtained, the quantum computer can be controlled, for example, to encode this vector into a quantum state of a quantum system. In this encoding process, the unique properties of quantum systems, such as superposition and entanglement, can be used to represent the proof state in quantum form. The quantum state serves as input for a quantum machine learning model.
[0016] The proof procedure further includes step c) of using the quantum state as an input quantum state by the quantum machine learning model to generate an output quantum state. The measurement of this output quantum state constitutes a proof step for the defined task. For example, the quantum machine learning model can use the input quantum state to perform computations and generate the output quantum state. The output quantum state represents a proof step for the defined task. The measurement d) of the output quantum state yields a specific combination of data (e.g., classical bits) that represents the proof step and can be manipulated and interpreted by a classical computer. This data combination can be linked to a corresponding proof step in a predefined mapping.The data combination can be linked to a specific tactic or a command of the proof wizard. The command might contain instructions that the classical computer can use to construct the proof step. The tactic might refer to an overarching strategy or rule that can be used to construct the proof step. The classical computer can use the tactic to generate the proof step. The proof step itself might refer to the individual actions or operations performed during the proof construction process. For example, the proof step might include applying logical rules, introducing or eliminating variables, and any other transformations or deductions during the proof process.By using machine quantum learning, the device can explore and exploit the computational advantages of quantum systems to improve the efficiency and accuracy of the proof process.
[0017] To further illustrate this, the theorem, similar to the sorting example above, can be passed to the proof wizard as a predicate that checks whether a list of natural numbers is in ascending order. The predicate can state that for any two elements a and b in the list, if a appears before b, then a is less than or equal to b according to the sorting algorithm. As proof state, the proof wizard can provide a list L representing the list of positive natural numbers and a goal "isAscendingOrder" to show that the list L satisfies the property of ascending order.In response to the proof status, the proof step can be carried out by calculating the multiplicative inverse of the numbers in the list, applying the sorting algorithm to the resulting numbers, and showing that the order of the list has been inverted so that the element that was last in the original order becomes first, and so on.
[0018] The proof procedure further includes step e) of entering the proof step into the proof assistant. The proof step can, for example, be written in a language supported by the proof assistant before being made available to it.
[0019] The proof procedure further includes step f) of receiving a next proof state from the proof assistant. The proof assistant generates this next proof state based on the input proof step. The next proof state can represent the updated state of the proof task after the proof step has been applied. For example, the proof assistant can analyze the proof step and provide the next proof state. The next proof state can indicate the completion of the proof. Alternatively, the next proof state can contain a goal, corrections to be made, or other relevant information to advance the proof process. The updated proof state can then be used as the current proof state for a possible subsequent repetition of the proof procedure.
[0020] In one example (called an incremental procedural example), the proof procedure can be repeated based on a state of the proof. In the incremental procedural example, the proof procedure can involve repeated execution of procedural steps a) through f) until a termination criterion is met. For example, the execution of the proof procedure can include an initial execution of steps a) through f), followed by one or more further executions of steps a) through f) until the termination criterion is met. The termination criterion can, for example, require that the proof be completed or that a maximum number of iterations be reached. It can be determined, for example, whether the proof of the computer program's statement is complete. To determine whether the proof is complete, the received state of the proof can, for example, be examined.The proof state can contain indicators or flags that indicate the completion of the proof task. For example, the proof state can contain a specific value or combination of values that indicate successful completion of the proof. By analyzing the received proof state, it can be determined whether the proof is complete or whether further iterations are required. If the received proof state does not indicate that the proof is complete, the proof process can be repeated, using the last received proof state as the current proof state for the repetition. For this repetition, the proof state can, for example, define a task to prove a sub-statement of the statement.This iterative process allows for a step-by-step approach to fulfilling the proof task by encoding, processing, and analyzing the proof states using the quantum computer and the proof assistant. When the received proof state indicates that the proof is complete, the process can stop to signal that the statement has been proven.
[0021] According to one example, the described functionality of the statement is a security property or feature of the computer program. The security feature can refer to the mechanism and functionality implemented to protect the computer program and its data from unauthorized access, attacks, and vulnerabilities. The security feature can aim to ensure the confidentiality, integrity, and availability of the computer program and its associated resources. For example, the security feature might include data encryption or authentication to verify the identity of a user or entity before granting access to a computer system or its resources. The evidence assistant can provide an evidence state to prove the statement or an intermediate statement associated with the security feature.The proof step for proving the statement can involve the application of a technique such as induction, case analysis, or logical deduction. In the case of an encryption algorithm, the proof step can verify the length of the key generated by the encryption algorithm. If the length is greater than or equal to the predefined lengths of the encryption algorithm, this can prove the algorithm. If the proof step is consistent with the security property and contributes to achieving the goal of the current proof state, it can be accepted by the proof assistant. Conversely, if the proof step contradicts the security property or does not contribute to solving the goal, it can be rejected by the proof assistant. In the case of a failed proof, the computer program can be analyzed for potential vulnerabilities to ensure its resistance to attacks.The evidence assistant can help to identify and fix security vulnerabilities in the program, such as buffer overflows and weak passwords.
[0022] According to one example, the procedure further includes: in response to the finding that the proof is incomplete and the security property is not satisfied, identifying security vulnerabilities in the computer program that cause the error. The computer program can be modified accordingly, and the procedure can be repeated to prove the statement of the modified computer program. For example, after modifying the computer program, the procedure to prove the statement can be repeated. However, the procedure is now applied to the modified computer program. This repetition of the procedure ensures that the proof is complete and the security property is satisfied.
[0023] This example can provide a feedback mechanism. This feedback mechanism is triggered if the proof is incomplete and the security property is not satisfied. For example, after identifying the security vulnerabilities that may have caused the failure, the computer program can be modified accordingly. These vulnerabilities can be considered the cause of the error and may need to be addressed to ensure the computer program's security. The modification process might involve changing the computer program's code, configurations, or settings to mitigate or eliminate the identified vulnerabilities. This modification can be a direct response to the identified vulnerabilities, thereby increasing the computer program's security.
[0024] For example, if the initial proof fails due to a security vulnerability related to input validation, this vulnerability can be identified and the computer program modified by implementing stricter input validation mechanisms. The proof procedure can then be repeated for the modified computer program to ensure that the vulnerability has been effectively eliminated and the security property is now satisfied. Alternatively, different modification techniques can be employed depending on the nature of the identified security vulnerabilities. For instance, if the vulnerability is caused by an access control flaw, the computer program can be modified by implementing more robust access control mechanisms, such as role-based access control or attribute-based access control.
[0025] According to one example, the proof of the statement includes proof of the correctness of the computer program. Proof of the correctness of the computer program can include proof that the computer program behaves as intended and has no logical or functional errors. This example can ensure that the computer program functions as intended.
[0026] According to an exemplary implementation of the incremental procedure example, proving a statement or proving the correctness of the computer program can be achieved, in particular, by at least: providing a portion of the computer program to the proof assistant before executing the procedure, in order to obtain the current state of the proof. The current state of the proof further indicates whether the portion of the computer program is correct or incorrect. The procedure further includes: executing the procedure for another portion of the computer program if the current state of the proof indicates that the portion of the computer program is correct and / or that the proof for that portion of the computer program is complete, and if the current state of the proof indicates that the portion of the computer program is incorrect or that the proof is not complete, adapting the computer program.
[0027] The computer program can, for example, consist of several parts. The statement can first be provided to the proof assistant. The parts can then be processed sequentially using the following program processing procedure. The current part of the computer program is provided to the proof assistant to obtain an up-to-date state of the evidence. If the current state of the evidence indicates that the part of the computer program is faulty, the computer program can be modified. If the current state of the evidence indicates that the part of the computer program is correct, the procedural steps a) to f) can optionally be repeated until the termination criterion is met. Therefore, executing the program processing procedure can either lead to the modification of the computer program or confirm that the current part of the computer program is correct, optionally performing the proof for the currently correct part of the program.If the current proof status indicates that the part of the computer program is correct and / or that the proof for the current part of the computer program is complete, the next part of the computer program can be processed using the program processing procedure. Parts can be processed sequentially using the program processing procedure until all parts have been processed or until the computer program is updated.
[0028] In another example, the computer program can consist of a sequence of parts: Part 1, Part 2, Part N. The proof assistant can initially be provided with the statement. The first part, Part 1, can be made available to the proof assistant, and then steps a) through f) can be repeatedly executed for Part 1 until the termination criterion is met. If, after the termination criterion is met, the current proof state indicates that Part 1 is correct and / or that the proof for Part 1 is complete, the second part, Part 2, can be processed as described with reference to Part 1. However, if the current proof state indicates that Part 1 is incorrect or that the proof for Part 1 is not complete, the computer program can be adjusted and the procedure terminated.If the procedure is not terminated, the second part (Part 2) can be made available to the proof assistant. Steps a) through f) can then be repeated for this part (Part 2) until the termination criterion is met. If, after the termination criterion is met, the current proof state indicates that Part 2 is correct and / or that the proof for Part 2 is complete, the third part (Part 3) can be processed as described with reference to Part 1. If the current proof state indicates that Part 2 is faulty or that the proof for Part 2 is not complete, the computer program can be adjusted and the procedure terminated, and so on. This process can be repeated until all parts have been processed or the computer program has been adjusted.
[0029] According to one example, encoding the current proof state into the vector involves: providing a recurrent neural network (RNN) trained using proof states as sequential data to encode the proof state into a fixed-size vector, and inputting the current proof state into the recurrent neural network to obtain the vector.
[0030] During a proof, the proof assistant's state might be represented by a sequence of characters. Since the length of this sequence can change from one proof step to the next, it can be encoded into a fixed-length vector of real numbers. One way to do this is to use a recurrent neural network to encode the proof state into a so-called "context." The recurrent neural network can be specifically designed and trained to process sequential data, such as proof states, and encode them into fixed-size vectors. Training the recurrent neural network might involve using a large dataset of proof states so that it can learn patterns and relationships within the sequential data.
[0031] In an alternative example, instead of a recurrent neural network, other machine learning techniques, such as convolutional neural networks (CNNs) or transformers, can be used to encode the proof state into a fixed-size vector. These alternative techniques may be better suited for certain types of proof states or offer different advantages in terms of computational efficiency or accuracy.
[0032] Once the current proof state is encoded into a vector, it can be used for various purposes. For example, the encoded vector can be used to compare it with other proof states to identify similarities or differences. This can help in detecting patterns or recurring vulnerabilities in a computer program.
[0033] For example, the vector is encoded into the quantum state using amplitude or angle encoding. The choice of encoding can depend, for instance, on the specific quantum machine learning model.
[0034] In amplitude encoding, the vector can be represented as a linear combination of basis states, where the amplitudes of the states can correspond to the elements of the vector. This encoding technique can enable efficient manipulation and processing of the quantum state. Angle encoding, on the other hand, can represent the vector by encoding the angles between the basis states. The angles can be determined based on the elements of the vector, and the quantum state is then prepared accordingly. Angle encoding can offer advantages in terms of robustness against certain types of errors and noise.
[0035] In an example where the vector to be encoded is [1, 0], the prepared quantum state can be provided by amplitude encoding as a linear combination of the basis states |0〉 and |1〉, where the amplitudes correspond to the elements of the vector. For example, the resulting quantum state could be represented as α|0〉 + β|1〉, where α and β are complex numbers determined by the vector elements.
[0036] Alternatively, in angle encoding, the angles between the basis states can be determined based on the vector elements. For example, if the angles θ1 and θ2 are specified for the basis states |0〉 and |1〉 respectively, the quantum state can be prepared by applying suitable quantum gates to generate the desired angles between the basis states.
[0037] Amplitude and angle encoding are described here as examples, but other quantum encoding techniques can also be used. These alternative techniques could involve different mathematical representations or encoding schemes, depending on the specific requirements and limitations of the system.
[0038] According to one example, the procedure is carried out automatically in response to the computer program receiving a statement. This can speed up the evidentiary process and reduce user intervention.
[0039] In one example, the proof assistant is configured to run on a classical computer, with the procedure implemented by a hybrid classical algorithm and a quantum algorithm. The execution of the classical algorithm on the classical computer causes the classical computer to perform the procedure, which includes controlling the quantum computer according to the quantum algorithm to encode the vector, provide the output quantum state, and measure the output quantum state. The present procedure can be hybridized, meaning it can contain a combination of classical and quantum components.
[0040] In one example, the quantum system is defined by a number of qubits, which is determined based on the number of elements in the vector.
[0041] The quantum system can consist of a specific number of qubits, determined based on the number of elements present in the vector. This specification ensures that the quantum system is appropriately dimensioned for the proof process. By keeping the number of qubits constant, the consistency and reliability of the proof procedure can be guaranteed.
[0042] The quantum system can, for example, comprise a set of qubits, where the number of qubits in the set is defined by the size of the vector. For example, if the size of the vector is N, the quantum system can comprise n qubits, where N = 2. n The quantum state can represent the values of the vector. If the size of the vector is not a power of two, the vector can be padded to a dimension that is a power of two, for example, with predefined values such as zeros.
[0043] In one example, the size of the vector is set to a value that depends on the number of qubits available in the quantum computer.
[0044] The fixed size of the vector is determined based on the number of qubits available in the quantum computer. This ensures that the vector is optimized for the specific resources of the quantum computer used. The fixed size of the vector can, for example, be adapted to the specific requirements of the quantum computer. If, for instance, a different quantum computer with a different number of qubits is used, the size of the vector can be adjusted accordingly. This flexibility allows the method to be adapted to different quantum computer resources.
[0045] According to one example, the procedure prior to proving the statement by the computer program includes: training the quantum machine learning model. The training includes: providing a training dataset. The training dataset contains entries, where each entry represents a proof state and a corresponding tactic or command for constructing a proof step.
[0046] Alternatively, the training dataset can be provided such that each entry in the training dataset comprises a proof state and a corresponding proof step derived from a tactic. Alternatively, each entry in the training dataset can contain a proof and a corresponding statement. The tactic might, for example, refer to an overarching strategy or rule used to construct the proof step, where the proof step can refer to the individual actions or operations performed during the proof construction process. The quantum machine learning model can be trained to provide a tactic for a given proof state.
[0047] In an example of training data generation, a proof wizard can be used to create a set of proof states for the training dataset. These proof states can represent intermediate steps in the process of proving program statements. Each proof state is linked in its respective entry in the training dataset to a corresponding tactic, which can be a specific strategy or rule used to create the proof step.
[0048] For example, the training dataset is obtained using the proof assistant employed by the proof procedure and / or one or more other proof assistants. This can enable the collection of a comprehensive dataset that can be used to train the quantum machine learning model. Alternatively, the training dataset can be obtained using a different proof assistant than the one employed by the proof procedure. This proof assistant can have different features or capabilities, allowing for the collection of a variety of proof states and tactics. This variation of the training dataset can help improve the robustness and generalizability of the quantum machine learning model.
[0049] In addition to the proof assistant, alternative methods for obtaining the training dataset can also be explored. For example, the dataset can be generated using several automated theorem provers or formal verification tools. These tools can assist in generating proof states and corresponding tactics or statements that can be used as entries in the training dataset.
[0050] In one example of training data generation, the method can create the training dataset by directly providing a set of pre-existing proofs along with their corresponding statements. These proofs serve as examples for the quantum machine learning model to learn from. Once the training dataset is available, the quantum machine learning model is trained. This training process can involve feeding the training dataset into the model and iteratively adjusting its parameters to optimize its performance in proving program statements.
[0051] In an example of training data generation, the training dataset can be provided based on the area or domain of the computer program to be proven. For instance, if the procedure is used to prove sorting algorithms, the training of the quantum machine learning model can be performed to prove the correctness of sorting algorithms. The training dataset can be generated using the proof wizard. The proof wizard can generate a set of proof states, each representing a step in proving the correctness of a particular sorting algorithm. These proof states are then paired with the corresponding tactics, which describe the specific strategies used to construct each proof step.Alternatively, if a set of existing proofs for the domain is provided, the method can use these proofs, along with the corresponding statements, directly as a training dataset. For example, a series of proofs demonstrating the correctness of various sorting algorithms can be used as a training dataset.
[0052] In an example of training data generation, the training dataset described above can be updated. To further improve the training process, the procedure can, for example, incorporate various data augmentation techniques. The update can involve manipulating the existing training dataset to generate additional variations of the evidence states and the corresponding tactics or statements. This can be achieved through techniques such as data perturbation, where small changes are made to the existing entries to create new instances. The updated training dataset can include the manipulated entries and, optionally, the existing training dataset. Another approach can involve generating synthetic data using generative models or simulation techniques.The updated training dataset can include the synthetic data and optionally the existing training dataset.
[0053] In another example, alternative approaches can be used to generate the training dataset. For instance, the method can use natural language processing techniques to generate statements that describe the desired properties of the program.
[0054] In an example of training data generation, at least a portion of the training dataset can be generated using a machine learning model to produce true statements and proofs. This "at least part" of the training dataset can be the training dataset itself. Alternatively, it can be a subset of the entries within the training dataset. The remaining parts of the training dataset can be provided using one or more of the training data generation methods mentioned above. For example, the true statements and proofs can be generated using classical reinforcement learning, hybrid reinforcement learning, quantum reinforcement learning, other classical machine learning techniques, hybrid machine learning techniques, or quantum machine learning techniques.These generated statements and evidence can be used, for example, to expand an existing database of statements and evidence for the assistant, thus providing enough data points to train a quantum large language model "from scratch".
[0055] The machine learning model (for generating true statements) can be trained, for example, on a large corpus of existing true statements and proofs. This corpus can be drawn from various reliable and verified databases or repositories. The machine learning model learns the patterns, structures, and logical reasoning behind these true statements and proofs. Once the machine learning model is trained, it can generate new true statements and proofs based on the learned patterns and reasoning. These generated statements and proofs can then be used to construct at least part of the training dataset. Each entry in the training dataset can contain a generated true statement or proof and the corresponding proof step or tactic.Alternatively, the machine learning model can be trained on various subsets of existing true statements and proofs to create specialized training datasets. This allows the machine learning model to be trained for specific domains or problem types, thereby improving its performance and accuracy in those areas. These generated true statements and proofs, along with the corresponding proof steps or tactics, form part of the training dataset. The machine learning model can then use this dataset to learn how to prove program statements using quantum computing techniques.
[0056] In one example, the machine learning model used to create the training dataset can be fine-tuned and optimized based on the specific requirements of the quantum learning machine model being trained. Various machine learning algorithms and architectures can be explored to improve the quality and variety of the generated statements and evidence.
[0057] Besides using a machine learning model, alternative methods for creating the training dataset can also be considered. Instead of relying solely on a machine learning model, for example, human experts can manually create a set of true statements and evidence covering a wide range of scenarios. These manually created statements and evidence can then be combined with the machine-generated ones to form a comprehensive training dataset.
[0058] During the training process, the quantum learning model can learn to recognize patterns and relationships between the proof states and the corresponding tactics or statements. Through the iterative adjustment of its parameters, the model can become increasingly better at delivering proof steps.
[0059] In a training example, the quantum machine learning model can include an encoding layer. The encoding layer can be configured to encode a fixed-size vector into a quantum state using a set of qubits. The quantum machine learning model can further include a learning layer with one or more trainable or free parameters. The learning layer can be configured to modify the quantum state by applying one or more unitary transformations. The trainable parameters can be, for example, the rotation angles of Pauli rotation gates for individual qubits; that is, the Pauli rotation angle can be applied to qubits of the set of qubits after the quantum state has been generated. The trainable parameters can, for example, include a number of rotation angles, each of which is applied to the set of qubits.The quantum machine learning model can further include a measurement layer for measuring the initial quantum state. A loss function can be evaluated using the proof step represented by the measurement and the corresponding proof step in the training dataset. The quantum machine learning model can be trained by backpropagation using the loss function and an optimization technique performed by the classical computer to verify a convergence criterion. Backpropagation can enable the updating of the learnable parameters by gradient descent. The convergence criterion might, for example, require that the loss function exceeds a threshold.
[0060] In a training example, and assuming the vector is provided by the recurrent neural network described here, the quantum machine learning model and the recurrent neural network can be trained together. For example, in each training iteration, the proof state can be fed into the recurrent neural network to generate the vector. This vector is then provided as input to the quantum machine learning model, and the resulting measurement can provide a clue to the proof step. A loss function can be evaluated using the measurement and the proof step in the training dataset. If the loss function fails to meet a convergence criterion, backpropagation is performed to update both the learnable parameters of the quantum machine learning model and the weights of the recurrent neural network.Updating the weights of the recurrent neural network and the learnable parameters can be performed using gradient descent. If the loss function satisfies the convergence criterion, the trained recurrent neural network and the learning model can be deployed to the quantum machine. The convergence criterion might, for example, require the loss function to exceed a threshold.
[0061] For example, the quantum machine learning model is a quantum reinforcement learning model, where the procedure involves training the quantum reinforcement learning model using the Proof Assistant or another proof assistant as its environment before the computer program proves its statement. Reinforcement learning is a type of machine learning in which an agent learns to make decisions by interacting with an environment and receiving feedback in the form of rewards or punishments. The quantum reinforcement learning model uses quantum algorithms to optimize the decision-making process and improve learning efficiency. This quantum reinforcement learning model can overcome the limitations of classical methods in efficiently and purposefully searching large action spaces.
[0062] During the training process, the quantum amplification learning model can interact with the proof assistant or another proof assistant serving as its environment. The model can learn to make decisions based on the current proof state provided by the proof assistant and the available tactics to achieve the desired proof outcome. Through iterative training, the model can improve its ability to deliver proof step(s) for a given proof state.
[0063] In addition to the example described, there are alternative approaches that can be used for the training process. For instance, instead of a proof assistant, the method can use a simulated environment specifically designed for training the quantum amplification learning model. This simulated environment can mimic the behavior of a proof assistant and provide a controlled environment for training the model.
[0064] According to one example, the encoding of the current proof state into the vector is performed using a recurrent neural network, with the training of the quantum machine learning model involving the simultaneous training of the quantum machine learning model and the recurrent neural network.
[0065] An RNN can be a type of artificial neural network capable of processing sequential data by maintaining internal memory. This memory allows the RNN to capture and utilize information from previous proof states when encoding the current proof state. RNNs can be implemented using various architectures, such as Long Short-Term Memory (LSTM) or Gated Recurrent Units (GRUs). These architectures enable the RNN to effectively capture long-term dependencies and handle issues with vanishing or exploding gradients that may occur during training.
[0066] Joint training can be performed, for example, as follows. The training dataset consists of entries, each containing a proof state and a corresponding tactic for creating a proof step. The RNN encodes the proof state of a current entry into a vector representation, which is then fed into the quantum machine learning model. The model uses this encoded information to generate the appropriate tactic for the given proof state. Specifically, joint training of the RNN and the QML model can be performed, for example, as follows. The training dataset, particularly the proof states, can be prepared in a sequential format suitable for the RNN component. The training dataset can be compatible with both the RNN and the QML components.In each training iteration, a forward pass through the joint model can be performed, feeding the test state into the RNN component and passing the RNN's output vector as a quantum state to the QML component. The QML component processes the quantum state and generates the output quantum state, which represents a proof step. The loss between the predicted proof step and the target proof step of the training dataset is determined. The QML component can perform backpropagation to compute the gradients of the parameters with respect to the loss. The parameters of the QML component can be updated, for example, using an optimization algorithm. In the RNN component, backpropagation through time can be performed to compute the gradients of the RNN weights with respect to the loss.Backpropagation Through Time (BPTT) can involve unfolding the RNN over time and propagating the gradients through each time step. The RNN weights can be updated using the optimization algorithm. Repetition can be performed for a specific number of iterations or until convergence is reached.
[0067] For example, the quantum machine learning model is a neural network, a quantum support vector machine (QSVM), a quantum large language model (LLM), or a quantum amplification learning model.
[0068] QSVM is a quantum version of the classical Support Vector Machine (SVM) algorithm, a supervised learning method used for classification and regression tasks. QSVM utilizes quantum algorithms to perform classification tasks on quantum data. These quantum-based machine learning models can efficiently overcome the limitations of classical methods. In this case, the RNN and QSVM can, for example, be trained together, as described in the document arXiv:2308.08467.
[0069] The quantum LLM model can be developed for processing and understanding natural language texts using quantum algorithms. It can be trained on a large corpus of text data and used for tasks such as speech translation, sentiment analysis, and text generation.
[0070] The evidence assistant can be, for example, the LEAN proof assistant or any other evidence assistant that makes it possible to prove the statements according to the present subject matter. Fig. Figure 1 is a diagram showing a computer system according to an example from the present subject matter. The computer system 100 comprises a classical computer 101. The computer system 100 may also include a quantum computer 102. An example implementation of the classical computer 101 is shown using the following: Fig. 3 described. The quantum computer 102 can comprise qubits. The qubits can, for example, be part of the quantum registers 105.1 to 105.L. The classical computer 101 can be configured to control the operation of the quantum computer 102. The classical computer 101 can use an interface 103 with the quantum computer 102 to control the operation of the quantum computer 102 in accordance with an example of the present subject matter. The classical computer can include a proof assistant 107. The proof assistant can be, for example, the LEAN proof assistant or another proof assistant with which the statements according to the present subject matter can be proven. Fig. Figure 2 is a flowchart of a procedure for proving a statement of a computer program using a quantum computer and a proof assistant, according to an example from the present subject matter. For clarification: The in Fig. The two described procedures can be found in the Fig. The procedure can be implemented in the system shown in point 1, but is not limited to this implementation. For example, the procedure can be executed by computer system 100. In step 201, a current proof state can be encoded into a vector of real numbers of fixed length. The current proof state defines a task to prove at least part of the statement. In step 203, the vector can be encoded into a quantum state of a quantum system of the quantum computer (e.g., 102). For example, the classical computer 101 can control the quantum computer 102 to execute step 203. In step 205, the quantum state can be used as an input quantum state by a quantum machine learning model to provide an output quantum state, with the measurement of the output quantum state constituting a proof step for the defined task. The output quantum state can be measured, for example, in step 205. The proof step can then be passed to the proof assistant (e.g., 102) in step 207.B. 107). In response to the provision of the proof step, a next proof state can be received from the proof assistant 107 in step 209. In step 211, it can be determined whether the received proof state indicates that the proof is complete. If it is determined that the proof is not complete, the received proof state can be used as the current proof state for repeating procedural steps 201 to 211. In an example, procedural steps 201 to 211 can be repeated until a termination criterion is met. The termination criterion might, for example, require that the proof is complete or that a maximum number of iterations has been reached. If, for example, it is determined that the proof is complete, the procedure can be terminated. Fig. Figure 3 is a block diagram of an exemplary computer system for implementing at least part of the present procedure in accordance with an example of the present subject matter.
[0071] The components of the 702 computer system can include, among other things, one or more processors or processing units 703, a storage system 711, a memory unit 705, and a bus 707 that connects various system components, including the memory unit 705, to the processor 703. The storage system 711 can, for example, include a hard disk drive (HDD). The memory unit 705 can contain computer-readable media in the form of volatile memory, such as random-access memory (RAM) and / or cache memory.
[0072] The Computer System 702 can also communicate with one or more external devices, such as a keyboard, pointing device, display 713, etc., enabling a user to interact with the Computer System 702, and / or with any devices (e.g., network card, modem, etc.) that allow the Computer System 702 to communicate with one or more other computer devices. Such communication can occur via the I / O interface(s) 719. Furthermore, the Computer System 702 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or a public network (e.g., the Internet), via a network adapter 709. As shown, the network adapter 709 communicates with the other components of the Computer System 702 via the bus 707.
[0073] The 705 memory unit is configured to store applications that can be executed on the 703 processor. The 705 memory unit can, for example, contain an operating system and one or more application programs. The application programs contain instructions that, when executed, carry out the operation described in the 703 processor. Fig. The two described procedures enable
[0074] As will be clear to those skilled in the art, aspects of the present invention can be embodied as a device, a method, a computer program, or a computer program product. Accordingly, aspects of the present invention can take the form of a purely hardware variant, a purely software variant (including firmware, resident software, microcode, etc.), or a variant that combines software and hardware aspects, which may be generally referred to here as a "circuit," "module," or "system." Furthermore, aspects of the present invention can take the form of a computer program product embodied in one or more computer-readable media on which computer-executable code is embodied. A computer program comprises the computer-executable code or "program instructions."
[0075] Any combination of one or more computer-readable media can be used. The computer-readable medium can be a computer-readable storage medium. A "computer-readable storage medium," as used here, includes any tangible storage medium capable of storing instructions that can be executed by a processor of a computing device. The computer-readable storage medium can be referred to as a computer-readable non-transitory storage medium. The computer-readable storage medium can also be referred to as a concrete computer-readable medium. In some embodiments, a computer-readable storage medium may also be capable of storing data that can be accessed by the processor of the data processing system.
[0076] Computer memory is an example of a computer-readable storage medium. Computer memory is any memory that a processor can directly access. Another example of a computer-readable storage medium is computer mass storage. Computer mass storage is any non-volatile, computer-readable storage medium. In some embodiments, computer mass storage can also be computer memory, or vice versa.
[0077] A "processor," as used here, comprises an electronic component capable of executing a program, a machine-executable instruction, or computer-executable code. References to the data processing system comprising "a processor" should be understood to mean that it may contain more than one processor or processing core. The processor may, for example, be a multi-core processor. A processor may also refer to a collection of processors within a single computer system or distributed across multiple computer systems. The term "computer equipment" should also be interpreted to mean a collection or network of computing devices, each comprising one or more processors.The computer executable code can be executed by multiple processors, which may be located in the same computer device or even distributed across multiple computer devices.
[0078] Computer-executable code may comprise machine-executable instructions or a program that causes a processor to execute an aspect of the present invention. Computer-executable code for performing operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, Smalltalk, C++, or similar languages, and conventional procedural programming languages such as the programming language "C" or similar languages, and compiled into machine-executable instructions. In some cases, the computer-executable code may be in the form of a high-level language or in pre-compiled form and used in conjunction with an interpreter that generates the machine-executable instructions on the fly.
[0079] In general, program instructions can be executed on one processor or on multiple processors. In the case of multiple processors, these can be distributed across several different units. Each processor could execute a portion of the instructions intended for that unit. Therefore, when referring to a system or process involving multiple units, the computer program or program instructions are to be understood as being capable of being executed by a processor assigned to or associated with the respective unit.
Claims
[1] Method for proving a statement of a computer program using a quantum computer (102) and a proof assistant (107), wherein the statement describes a functionality of the computer program and the method is provided for proving the conformity of the computer program with the described functionality, the method comprising: a) Encoding (201) a current proof state into a vector of real numbers of fixed length, wherein the current proof state defines a task to prove at least part of the statement; b) Encoding (203) the vector into a quantum state of a quantum system of the quantum computer; c) Using (205) the quantum state as an input quantum state by a quantum machine learning model to generate an output quantum state by the quantum machine learning model, the measurement of which constitutes a proof step for the defined task; d) Measuring the initial quantum state in order to obtain the proof step for the defined task; e) Providing (207) the evidentiary step to the Evidence Assistant; f) in response to the provision of the Evidence Step, receiving (209) a next Evidence State from the Evidence Assistant. [2] The method according to claim 1, further comprising Determine whether the received state of evidence indicates that the evidence is complete; In response to the finding that the evidence is not complete, use the received state of evidence as the current state of evidence and repeat procedural steps a) to f). [3] Method according to claim 2, wherein the described functionality is a safety feature. [4] The method according to claim 3, further comprising: In response to the finding that the evidence is incomplete and does not meet the security requirements, identifying security vulnerabilities in the computer program that are causing the error; appropriate adjustment of the computer program; and Repeating procedural steps a) to f) to prove the statement of the adapted computer program. [5] Method according to any one of the preceding claims 2 to 4, wherein proving the statement includes proving the correctness of the computer program. [6] A method according to any one of the preceding claims 2 to 5, wherein, prior to the execution of the method: a part of the computer program is made available to the evidence assistant in order to obtain the current state of the evidence, wherein the current state of the evidence further indicates whether the part of the computer program is correct or faulty; wherein the method further comprises: Performing the procedure for another part of the computer program if the current state of evidence indicates that the part of the computer program is correct and / or that the proof for that part of the computer program is complete; If the current state of the evidence indicates that part of the computer program is faulty or the evidence is not complete, adjust the computer program. [7] The method according to any of the preceding claims, comprising encoding the current state of the evidence into the vector: Providing a recurrent neural network trained using proof states as sequential data to encode the proof state into a fixed-size vector; Inputting the current proof state into the recurrent neural network to preserve the vector. [8] The method according to any of the preceding claims, wherein the encoding of the vector into the quantum state is carried out using amplitude encoding or angle encoding. [9] The method according to any of the preceding claims, which is carried out automatically in response to the receipt of the statement by the computer program. [10] Method according to any of the preceding claims, wherein the proof assistant is configured to run on a classical computer, the method being implemented by a hybrid quantum-classical algorithm, the execution of which on the classical computer causes the classical computer to perform the method comprising controlling the quantum computer to encode the vector, provide the output quantum state and measure the output quantum state. [11] Method according to any of the preceding claims, wherein the quantum system is defined by a number of qubits which is determined on the basis of the number of elements of the vector. [12] Method according to any of the preceding claims, wherein the size of the vector is fixed to a value which depends on the available number of qubits in the quantum computer. [13] The method according to any of the preceding claims, comprising, prior to proving the statement of the computer program, training the quantum machine learning model, wherein the training comprises: Providing a training dataset, wherein the training dataset comprises entries, wherein Each entry contains a proof status and a corresponding tactic for building a proof step; or Each entry contains evidence and a corresponding statement; Training the quantum machine learning model to prove program statements using the training dataset. [14] Method according to claim 13, wherein the training data set is obtained using the evidence assistant and / or one or more other evidence assistants. [15] Method according to claim 13 or 14, further comprising generating at least part of the training data set using a machine learning model to generate true statements and evidence. [16] Method according to any one of the preceding claims 1 to 12, wherein the quantum machine learning model is a quantum amplification learning model, wherein the method comprises training the quantum amplification learning model using the proof assistant or another proof assistant as an environment prior to proving the statement of the computer program. [17] Method according to any one of the preceding claims 13 to 16, wherein the encoding of the current proof state into the vector is performed using a recurrent neural network, wherein the training of the quantum machine learning model comprises the joint training of the quantum machine learning model and the recurrent neural network. [18] The method according to any of the preceding claims, wherein the quantum machine learning model is a quantum neural network, a quantum support vector machine (QSVM), a quantum large language model or a quantum amplification learning model. [19] A computer system (100, 702) for proving a statement of a computer program using a quantum computer (102) and a proof assistant (107), wherein the statement describes a functionality of the computer program, wherein the computer system (100, 702) includes the proof assistant, wherein the computer system (100, 702) is configured to: Encoding a current proof state into a vector of real numbers of fixed length, where the current proof state defines a task to prove at least part of the statement; Controlling the quantum computer to encode the vector into a quantum state of a quantum system of the quantum computer; Controlling the quantum computer to use the quantum state as an input quantum state by a quantum machine learning model in order to generate an output quantum state through the quantum machine learning model, the measurement of which represents a proof step for the defined task; Controlling the quantum computer to measure the initial quantum state in order to obtain the proof step for the defined task; Providing the evidentiary step to the evidence assistant; In response to the provision of the evidence step, the next evidence state is received from the evidence assistant. [20] The computer system according to claim 19, comprising the quantum computer. [21] A computer program product containing instructions to cause a computer system to perform at least the following: Encoding a current proof state into a vector of real numbers of fixed length, where the current proof state defines a task to prove at least part of the statement; Controlling the quantum computer to encode the vector into a quantum state of a quantum system of the quantum computer; Controlling the quantum computer to use the quantum state as an input quantum state by a quantum machine learning model in order to generate an output quantum state through the quantum machine learning model, the measurement of which represents a proof step for the defined task; Controlling the quantum computer to measure the initial quantum state in order to obtain the proof step for the defined task; Providing the evidence step to the evidence assistant; in response to the provision of the evidence step, receiving a next evidence state from the evidence assistant.