PPTL (Power Point Label) standard mining system and method

文档序号:378160 发布日期:2021-12-10 浏览:2次 中文

阅读说明:本技术 一种pptl规范挖掘系统和方法 (PPTL (Power Point Label) standard mining system and method ) 是由 张南 宁新亚 段振华 田聪 王小兵 赵亮 陆旭 于斌 于 2021-08-14 设计创作,主要内容包括:本发明属于计算机程序设计语言及应用技术领域,公开了一种PPTL规范挖掘系统和方法,所述PPTL规范挖掘系统,包括Trace生成模块、Trace解析模块、PPTL-LNFG转换模块、LNFG实例化模块、LNFG检测模块和挖掘结果返回模块。本发明利用完全正则的PPTL形式化待挖掘的性质,将PPTL一次性转为LNFG从而减少时间的浪费,再用类似广度优先遍历的方式将trace中的事件与LNFG边上的PPTL状态公式进行对比,从而挖掘出满足程序执行trace的规范,且减少出现内存崩溃的情况,很好地解决了现有技术挖掘规范时由于重复将相同或类似的PPTL转为NF而导致挖掘时间过长的问题。(The invention belongs to the technical field of computer programming language and application, and discloses a PPTL specification mining system and method. The invention utilizes the completely regular PPTL formalization to-be-excavated property, converts the PPTL into the LNFG at one time so as to reduce the waste of time, compares the event in the trace with the PPTL state formula on the LNFG side in a similar breadth-first traversal mode, thereby excavating the specification meeting the program execution trace, reducing the occurrence of memory collapse and well solving the problem of overlong excavation time caused by repeatedly converting the same or similar PPTL into NF in the prior art when excavating the specification.)

1. A PPTL specification mining method is characterized by comprising the following steps: formalizing the property to be excavated by using a PPTL formula, converting the PPTL formula into a corresponding LNFG form, detecting trace and LNFG in a similar breadth-first traversal mode, and excavating a PPTL instance meeting the trace;

the PPTL specification mining method further comprises the following steps:

inputting an executable program to be mined into a Trace generation module, and outputting a function sequence which only contains method calls in the program, namely a Trace file;

inputting the Trace file into a Trace analysis module, outputting a set Events containing all Events occurring in the Trace, and abstracting the method call into Events;

inputting a PPTL formula P to be mined selected by a user into a PPTL _ LNFG conversion module, outputting an LNFG form corresponding to the P, and storing by using an adjacent linked list;

step four, inputting the event set Events output in the step two and the LNFG output in the step three into an LNFG instantiation module at the same time, and outputting the instantiated LNFG saved by using an adjacent linked list;

step five, simultaneously inputting the trace output in the step one and the instantiated LNFG output in the step four into an LNFG detection module, and outputting a Boolean variable representing whether the PPTL meets the trace;

and step six, repeatedly executing the step five until all instantiated LNFGs finish the detection with the trace file, calculating the confidence coefficient that each instantiated PPTL instance meets the trace file, and returning.

2. The PPTL specification mining method as claimed in claim 1, wherein in the second step, the Trace file is input into a Trace analysis module, and an event set Events is output, and the Trace analysis module extracts all event set Events appearing in the Trace file by traversing all Trace Events in the Trace file, namely, extracts all method call functions used in the program execution process.

3. The method for mining PPTL specifications as claimed in claim 1, wherein in step three, the inputting a PPTL formula P to be mined selected by a user into the PPTL _ LNFG conversion module and outputting the LNFG form corresponding to P for storage by using the adjacency linked list includes:

the PPTL _ LNFG conversion module converts a PPTL formula into a corresponding NF form and then into an LNFG form, and the LNFG form of the PPTL formula P is a directed graph G (CL (P), EL (P) and V0,L={Li,…,LmCl (p) represents a set of nodes of graph G, each node corresponding to a PPTL formula and being a timing formula, el (p) represents a set of edges of graph G, each edge corresponding to a PPTL formula and being a state formula, each edge representing a transition condition between two nodes, V (p) represents a set of nodes of graph G, and (V) represents a transition condition between two nodes0Representing the set of initial nodes of graph G, L representing the set of labels for the nodes in graph G; due to the fact that the PPTL specification mining method based on LNFG is used for PPTL formula of nodesThe nodes in the LNFG are uniquely identified by nonnegative integers, namely anonymization is carried out, so that the storage space is saved; and an adjacency linked list data structure is adopted to store the LNFG, wherein the data field of the head node is the number of the current node after anonymization and represents the current state, the adjacency point field represents the number of the current node after passing through the PPTL formula after anonymization and represents the next state, and the weight field of the edge node stores the syntax tree of the PPTL formula and represents the migration condition.

4. The method of PPTL specification mining of claim 1, wherein in step four, said inputting event sets Events and LNFG simultaneously to an LNFG instantiation module, outputting instantiated LNFG saved with an adjacency linked list, comprises:

initializing an instance pool, i.e., constructing A (m, n) event maps, where A (m, n) m! L (m-n)! M ═ Events |, n ═ Atomic _ set |, Atomic ∈ Atomic _ set, event ∈ Events; the instantiation pool generates an iterative loader iteration _ tracker which stores n triplets (mapfrom, switch, mapto), wherein mapfrom of the ith triplet is the ith atom proposition in the atom proposition set Atomic _ set, mapto points to the jth event in the event set Events and j is more than or equal to 0 and less than or equal to m-1, switch (i) is the step size of the mapping of the mapto of the ith atom proposition to the next event, and switch (i) is mn-1-iI is more than or equal to 0 and less than or equal to n-1; because atom propositions in the atom proposition set are different, the mapto of the atom propositions cannot point to the same event; after the example pool is initialized, a pair of (atomic, event) mappings is selected in each instantiation, each edge node in the LNFG is traversed, and the atomic proposition atom of the PPTL syntax tree in the weight domain is replaced by the corresponding event.

5. The method for mining PPTL specifications as claimed in claim 1, wherein in step five, the step of inputting trace and instantiated LNFG to the LNFG detection module at the same time, and outputting a boolean variable representing whether PPTL satisfies this trace includes:

the LNFG detection module realizes the detection of trace and instantiated LNFG in a similar breadth-first traversal mode, and returns a Boolean variable representing whether the PPTL meets the trace or not;

the LNFG detection module is calculated by algorithm 1: check _ Base _ on _ LNFG _ BFS, algorithm 2: state _ Transition and Algorithm 3: the State _ Formula _ Check _ LNFG is realized and used for detecting whether the Trace meets G, wherein the Trace is a Trace file output by a Trace generation module, and G is an instantiated LNFG stored by adopting an adjacent linked list;

algorithm 1: check _ Base _ on _ LNFG _ BFS is an entry algorithm of the pptliner + detection algorithm, and outputs a boolean variable B ∈ B ═ { true, false } indicating whether the current trace satisfies the LNFG by inputting an instantiated LNFG (diagram G) and a trace; the algorithm 1 firstly judges whether a current event exists in trace, and if the current event does not exist, namely the trace only contains a separator, judges whether a termination state epsilon exists in a current state set; if the epsilon is contained, returning true to indicate that trace meets LNFG, otherwise, returning false; if the trace contains the current event, detecting a next reachable state set of the current state set by calling the algorithm 2, if the next reachable state set does not exist, returning false, otherwise, deleting the current event and calling the algorithm 1 again;

and 2, algorithm: state _ Transition, which is used for inputting a State and a trace in the current State set, detecting the next reachable State set which meets the trace in the next State set through an algorithm 3 and returning to the algorithm 1; if the PPTL state formula or the transition condition in the LNFG edge node meets the current event, adding the next state into the next reachable state set;

algorithm 3: state _ Formula _ Check _ LNFG for detecting whether the migration condition is consistent with the current event, since the State Formula only contains the 'V,', P,true and false' operators, so that the judgment is carried out according to logical semantics, wherein p is an atomic proposition; the algorithm 3 is judged according to the type of the root node of the currently input state formula, if the root node is lambada, the algorithm 3 is recursively called to the left node, and if the return value is true, the algorithm 3 is recursively called to the right nodeCalling an algorithm 3, otherwise, returning false; if the root node is V-shaped, the algorithm 3 is recursively called for the left node, if the returned value is false, the algorithm 3 is recursively called for the right node, otherwise, true is returned; if the root node is 'p', judging whether the atomic proposition is a mark or not, if so, returning to true, otherwise, comparing the atomic proposition with the current event, and if the atomic proposition is the mark, indicating that the next state is the next reachable state; if the root node isThen recursively calling algorithm 3 for its child nodes and negating its result; if the root node is "true, false", then directly return "true, false".

6. The PPTL specification mining method as claimed in claim 1, wherein in step six, the calculating the confidence that each instantiated PPTL instance satisfies a trace file and returning comprises:

the mining result returning module calculates confidence coefficient that the instantiated LNFG meets the trace file according to a Boolean variable which indicates whether the trace meets G, if the Boolean variable is true, the support +1 and the confidence coefficient are support/support _ potential, wherein the confidence coefficient is support/support _ potentialsupport _ potential | channels |; if the boolean variable is false, then support ═ support; the LNFG-based PPTL specification mining method will return a (m, n) instantiated PPTL formulas and their confidence.

7. A computer arrangement, characterized in that the computer arrangement comprises a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to carry out the steps of the PPTL specification mining method as claimed in any one of claims 1 to 6.

8. An information data processing terminal, characterized in that the information data processing terminal is used for implementing the PPTL specification mining method as claimed in any one of claims 1-6.

9. The PPTL specification mining system for implementing the PPTL specification mining method as claimed in any one of claims 1-6, wherein the PPTL specification mining system comprises a Trace generation module, a Trace analysis module, a PPTL _ LNFG conversion module, an LNFG instantiation module, an LNFG detection module and a mining result return module;

the Trace generation module is used for generating a Trace file to be normalized;

the Trace analysis module is used for generating event sets Events in the Trace file;

the PPTL _ LNFG conversion module is used for generating an LNFG form corresponding to the PPTL formula;

the LNFG instantiation module is used for realizing the instantiation of the LNFG by replacing the events in the event set with atomic propositions in the LNFG;

the LNFG detection module is used for mining the PPTL instance meeting the trace by detecting the trace file and the instantiated LNFG;

and the mining result returning module is used for returning the PPTL instance and the confidence thereof.

10. The PPTL specification mining system of claim 9, wherein the Trace generation module is comprised of a dynamic invariant generation submodule and a Trace filter submodule;

the dynamic invariant generation submodule is realized by Daikon, the input of the dynamic invariant generation submodule is an executable program written by languages including C/C + +, Java, C #, Eiffel, Perl and Visual Basic, the output of the dynamic invariant generation submodule is a dtrace file containing an API (application programming interface), a method call, a global/local variable and a method return value in the program, and the dtrace file embodies the program behavior;

the trace filtering submodule is realized by a DTraceFilter, a dttrace file output by Daikon is input, and trace only containing a method calling sequence is output;

and finally generating a Trace file containing a plurality of traces by inputting the executable program into the Trace generating module for multiple times, wherein adjacent traces are divided by separators, and the separators support user-defined.

Technical Field

The invention belongs to the technical field of computer programming languages and application, and particularly relates to a PPTL (Power Point language) standard mining system and method.

Background

Currently, software system specifications are formal descriptions of system requirements. The specification can help people to better understand the software functions and improve the maintainability of the software by capturing important features in the program. The specification may also be used for testing and verification to improve the accuracy and reliability of the software system. However, for a variety of reasons, many software systems lack formal specifications, particularly for most legacy software systems, which makes maintenance of the software difficult. Mining specifications from programs is very difficult due to the complexity of programs, the variety of language types for program development, the difficulty of program deployment and operation, and the like. To address this problem, extensive attention has been paid to elucidation and reasoning about the timing behavior of programs, wherein a specification mining method based on dynamic analysis is to mine a set of trace traces generated by a program to derive possible timing specifications for the program, API, or other aspects of the software.

Most current specification mining methods use Linear Temporal Logic (LTL) and Computational Tree Logic (CTL) as property description languages. Due to limitations of LTL and CTL expression abilities, some complex timing properties such as periodic repetition are not well represented. Propositional Projection Temporal Logic (PPTL) has a fully regular expression capability, and in addition to the Temporal properties that LTL and CTL can formalize, PPTL can describe two other properties: interval-related properties and periodically-repeating properties. The PPTL specification mining algorithm and tool PPTLiner based on the pattern library well solve the problem that the expression capacity of LTL and CTL is limited, but when the number of atoms propositions in the pattern and events in trace is too large, the recursion is too deep during detection, so that the problem of too long time or memory crash occurs. Therefore, it is urgent to develop a specification mining system that can solve the limitation of LTL and CTL expression capability and solve the recursion too deeply and propose a corresponding solution.

Through the above analysis, the problems and defects of the prior art are as follows:

(1) existing software systems lack formal specifications, especially for most legacy software systems, which makes maintenance of the software difficult.

(2) Mining specifications from programs is very difficult due to the complexity of programs, the variety of language types for program development, the difficulty of program deployment and operation, and the like.

(3) Due to limitations of LTL and CTL expression abilities, some complex timing properties such as periodic repetition are not well represented.

(4) When the number of atom propositions and events in trace in the mode is excessive, the PPTL specification mining algorithm and the tool PPTLiner based on the mode library have the problem that the recursion is too deep during detection, so that the time is too long or the memory is crashed.

The difficulty in solving the above problems and defects is: the method for solving the limitation of the expression capacities of the LTL and the CTL is to formalize the property to be mined by the PPTL, but the PPTL specification mining based on the pattern library has the defect of too deep recursion, so that the problem of trace detection frequency explosion easily occurs, even the serious result that the specification cannot be mined due to memory collapse occurs, and therefore the execution efficiency of the program needs to be further improved.

The significance of solving the problems and the defects is as follows: on the basis of solving the expression capacity limitation of LTL and CTL, when the number of primitive propositions in a PPTL formula is too large and the number of events in trace is too large, the conditions of overlong occurrence time and memory collapse are greatly reduced, and the method has higher practicability and effectiveness in practical application.

Disclosure of Invention

The invention provides a PPTL specification mining system and method, and particularly relates to a PPTL specification mining system, method, equipment and terminal based on LNFG (LabeledNormal Form graph), aiming at solving the problems of overlong time and memory crash during specification mining in the prior art.

The PPTL specification mining system comprises a Trace generation module, a Trace analysis module, a PPTL _ LNFG conversion module, an LNFG instantiation module, an LNFG detection module and a mining result returning module.

The Trace generation module is used for generating a Trace file to be normalized;

the Trace analysis module is used for generating event sets Events in the Trace file;

the PPTL _ LNFG conversion module is used for generating an LNFG form corresponding to the PPTL formula;

the LNFG instantiation module is used for realizing the instantiation of the LNFG by replacing the events in the event set with atomic propositions in the LNFG;

the LNFG detection module is used for mining the PPTL instance meeting the trace by detecting the trace file and the instantiated LNFG;

and the mining result returning module is used for returning the PPTL instance and the confidence thereof.

Further, the Trace generation module consists of a dynamic invariant generation submodule and a Trace filtering submodule;

the dynamic invariant generation submodule is realized by Daikon, the input of the dynamic invariant generation submodule is an executable program written by languages including C/C + +, Java, C #, Eiffel, Perl and Visual Basic, the output of the dynamic invariant generation submodule is a dtrace file containing an API (application programming interface), a method call, a global/local variable and a method return value in the program, and the dtrace file embodies the program behavior;

the trace filtering submodule is realized by a DTraceFilter, a dttrace file output by Daikon is input, and trace only containing a method calling sequence is output;

and finally generating a Trace file containing a plurality of traces by inputting the executable program into the Trace generating module for multiple times, wherein adjacent traces are divided by separators, and the separators support user-defined.

Another objective of the present invention is to provide a PPTL specification mining method using the PPTL specification mining system, where the PPTL specification mining method includes: the method comprises the steps of formalizing the property to be excavated by using a PPTL formula, converting the PPTL formula into a corresponding LNFG form, and detecting trace and LNFG in a similar breadth-first traversal mode, so as to excavate a PPTL instance meeting the trace.

The PPTL specification mining method further comprises the following steps:

inputting an executable program to be mined into a Trace generation module, and outputting a function sequence which only contains method calls in the program, namely a Trace file which reflects the method calls in the program and is used as one input of an LNFG detection module;

inputting the Trace file into a Trace analysis module, outputting a set of Events containing all Events occurring in the Trace, abstracting the method call into Events, wherein the Events are used for inputting a subsequent LNFG instantiation module;

inputting a PPTL formula P to be mined selected by a user into a PPTL _ LNFG conversion module, outputting an LNFG form corresponding to the P, wherein the LNFG is used for inputting a subsequent LNFG instantiation module, and storing the LNFG by using an adjacent linked list so as to improve the memory utilization rate;

step four, inputting the event set Events output in the step two and the LNFG output in the step three into an LNFG instantiation module at the same time, outputting the instantiated LNFG saved by using an adjacent linked list, and using the instantiated LNFG as one input of an LNFG detection module;

step five, simultaneously inputting the trace output in the step one and the instantiated LNFG output in the step four into an LNFG detection module, and outputting a Boolean variable which represents whether the PPTL meets the trace or not, wherein the Boolean variable is used as a basis for calculating confidence in a subsequent specification mining return module;

and step six, repeatedly executing the step five until all instantiated LNFGs finish the detection with the trace file, calculating the confidence coefficient that each instantiated PPTL instance meets the trace file, and returning.

And further, in the second step, inputting the Trace file into a Trace analysis module, and outputting event sets Events, wherein the Trace analysis module extracts all event sets Events appearing in the Trace file by traversing all Trace Events in the Trace file, namely, extracts all method call functions used in the program execution process.

Further, in step three, the inputting a PPTL formula P to be mined selected by the user into the PPTL _ LNFG conversion module, outputting an LNFG form corresponding to P, and storing with an adjacency linked list includes:

the PPTL _ LNFG conversion module converts a PPTL formula into a corresponding NF form and then into an LNFG form, and the LNFG form of the PPTL formula P is a directed graph G (CL (P), EL (P) and V0,L={Li,…,LmCl (p) represents a set of nodes of graph G, each node corresponding to a PPTL formula and being a timing formula, el (p) represents a set of edges of graph G, each edge corresponding to a PPTL formula and being a state formula, each edge representing a transition condition between two nodes, V (p) represents a set of nodes of graph G, and (V) represents a transition condition between two nodes0Representing the set of initial nodes of graph G, L representing the set of labels for the nodes in graph G; because the PPTL specification mining method based on the LNFG is not interested in the PPTL formulas at the nodes, only the PPTL formulas at the edges of the nodes are applied, the nodes in the LNFG are uniquely identified by nonnegative integers, namely, anonymization is carried out, and the storage space is saved; and an adjacency linked list data structure is adopted to store the LNFG, wherein the data field of the head node is the number of the current node after anonymization and represents the current state, the adjacency point field represents the number of the current node after passing through the PPTL formula after anonymization and represents the next state, and the weight field of the edge node stores the syntax tree of the PPTL formula and represents the migration condition.

Further, in step four, the inputting event sets Events and LNFG into LNFG instantiation module at the same time, and outputting instantiated LNFG saved with adjacency linked list includes:

initializing an instance pool, i.e., constructing A (m, n) event maps, where A (m, n) m! L (m-n)! M ═ Events |, n ═ Atomic _ set |, Atomic ∈ Atomic _ set, event ∈ Events; the instantiation pool generates an iteration loader iteration _ tracker which stores n triplets (mapfrom, switchvar, mapto), wherein the mapfrom of the ith triplet is in the Atomic topic setThe ith atom proposition points to the jth event in the event set Events, j is more than or equal to 0 and less than or equal to m-1, the mapto of the ith atom proposition is mapped to the step length of the next event, and the mapvar (i) is equal to mn-1-iI is more than or equal to 0 and less than or equal to n-1; because atom propositions in the atom proposition set are different, the mapto of the atom propositions cannot point to the same event; after the example pool is initialized, a pair of (atomic, event) mappings is selected in each instantiation, each edge node in the LNFG is traversed, and the atomic proposition atom of the PPTL syntax tree in the weight domain is replaced by the corresponding event.

Further, in step five, the step of inputting the trace and the instantiated LNFG to the LNFG detection module at the same time, and outputting a boolean variable indicating whether the PPTL satisfies the trace includes:

the LNFG detection module realizes the detection of trace and the instantiated LNFG in a similar breadth-first traversal mode, and returns a Boolean variable representing whether the PPTL meets the trace or not.

The LNFG detection module is calculated by algorithm 1: check _ Base _ on _ LNFG _ BFS, algorithm 2: state _ Transition and Algorithm 3: and the State _ Formula _ Check _ LNFG is realized and used for detecting whether the Trace meets G, wherein the Trace is a Trace file output by the Trace generation module, and G is the instantiated LNFG stored by adopting an adjacent linked list.

Algorithm 1: check _ Base _ on _ LNFG _ BFS is an entry algorithm of the pptliner + detection algorithm, and outputs a boolean variable B ∈ B ═ { true, false } indicating whether the current trace satisfies the LNFG by inputting an instantiated LNFG (diagram G) and a trace; the algorithm 1 firstly judges whether a current event exists in trace, and if the current event does not exist, namely the trace only contains a separator, judges whether a termination state epsilon exists in a current state set; if the epsilon is contained, returning true to indicate that trace meets LNFG, otherwise, returning false; if the trace contains the current event, detecting the next reachable state set of the current state set by calling the algorithm 2, if the next reachable state set does not exist, returning false, otherwise, deleting the current event and calling the algorithm 1 again.

And 2, algorithm: state _ Transition, which is used for inputting a State and a trace in the current State set, detecting the next reachable State set which meets the trace in the next State set through an algorithm 3 and returning to the algorithm 1; and if the PPTL state formula or the transition condition in the LNFG edge node meets the current event, adding the next state into the next reachable state set.

Algorithm 3: state _ Formula _ Check _ LNFG for detecting whether the migration condition is consistent with the current event, since the State Formula only contains the 'V,', P,true and false' operators, so that the judgment is carried out according to logical semantics, wherein p is an atomic proposition; the algorithm 3 is judged according to the type of a root node of a currently input state formula, if the root node is inverted V, the algorithm 3 is recursively called for a left node, if the returned value is true, the algorithm 3 is recursively called for a right node, otherwise, false is returned; if the root node is V-shaped, the algorithm 3 is recursively called for the left node, if the returned value is false, the algorithm 3 is recursively called for the right node, otherwise, true is returned; if the root node is 'p', judging whether the atomic proposition is a mark or not, if so, returning to true, otherwise, comparing the atomic proposition with the current event, and if the atomic proposition is the mark, indicating that the next state is the next reachable state; if the root node isThen recursively calling algorithm 3 for its child nodes and negating its result; if the root node is "true, false", then directly return "true, false".

Further, in step six, the calculating and returning the confidence that each instantiated PPTL instance satisfies the trace file includes:

the mining result returning module calculates confidence coefficient that an instantiated LNFG meets a trace file according to a Boolean variable indicating whether the trace meets G, if the Boolean variable is true, support +1 and support/support _ potential, wherein support belongs to the trace,} |, support _ potential |, tracks |; if the boolean variable is false, then support ═ support; the LNFG-based PPTL specification mining method will return a (m, n) instantiated PPTL formulas and their confidence.

It is a further object of the invention to provide a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:

the method comprises the steps of formalizing the property to be excavated by using a PPTL formula, converting the PPTL formula into a corresponding LNFG form, and detecting trace and LNFG in a similar breadth-first traversal mode, so as to excavate a PPTL instance meeting the trace.

Another objective of the present invention is to provide an information data processing terminal, where the information data processing terminal is configured to implement the PPTL specification mining system.

By combining all the technical schemes, the invention has the advantages and positive effects that: the PPTL specification excavation system provided by the invention uses the completely regular PPTL formalization to-be-excavated property, converts the PPTL into the LNFG once so as to reduce the waste of time, and compares the event in the trace with the PPTL state formula on the side of the LNFG in a similar breadth-first traversal mode so as to excavate the specification meeting the program execution trace and reduce the condition of memory collapse.

The system and the method for mining the PPTL specification based on the LNFG well solve the problem of long mining time caused by repeatedly converting the same or similar PPTL into NF during the specification mining in the prior art; the problem of memory collapse caused by too deep recursion in the prior art of mining the specifications is well solved. The invention can mine the specifications of any executable program written by C/C + +, Java, C #, Eiffel, Perl, Visual Basic and other languages, and can mine any specifications expressed by PPTL formula. The PPTL formula is converted into the LNFG for subsequent detection at one time, the same or similar PPTL is converted into the NF repeatedly in the prior art, the same refers to the same PPTL formula as instantiated is converted into the NF repeatedly when the same PPTL formula is detected with different trace, the same PPTL formula as instantiated is converted into the NF in the middle process when the same PPTL formula is detected with the same trace, the similar refers to the similar process of converting the same PPTL formula into the NF after the same PPTL formula is instantiated and is detected with a trace set, only events corresponding to original NF sub-propositions are different, and the important reason of the overlong mining time in the prior art is also caused. The invention uses a mode similar to breadth-first traversal to detect, and the prior art uses a mode similar to depth-first traversal to detect, which is also an important reason that the prior art is easy to have the problem of memory crash. Compared with the prior art, the invention also has the following advantages:

(1) a completely regular form language PPTL writing mode is used as a specification to be mined;

(2) anonymizing the nodes of the LNFG to save storage space;

(3) the LNFG is stored by using the adjacent linked list, so that the utilization rate of the memory is greatly improved;

(4) the PPTL formula is converted into an LNFG form at one time, so that the condition of overlong detection time is reduced;

(5) and comparing the event in the trace with a PPTL state formula on the LNFG side in a similar breadth-first traversal mode, so that the occurrence of memory crash caused by too deep recursion is reduced.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments of the present invention will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.

Fig. 1 is a flowchart of a PPTL specification mining method provided by an embodiment of the present invention.

Fig. 2 is an overall framework diagram of the PPTL specification mining system provided by the embodiment of the present invention.

Fig. 3 is an exemplary diagram of a Trace file output after an executable program of the bee colony algorithm provided by the embodiment of the present invention is input into a Trace generation module.

Fig. 4 is a schematic diagram for storing an LNFG form corresponding to PPTL by using an adjacency list according to an embodiment of the present invention.

Fig. 5 is a schematic diagram of iteration _ tracker generated when an instantiation module of the system initializes according to the embodiment of the present invention.

Fig. 6 is a schematic diagram of an idea of implementing detection by an LNFG detection module of the system according to the embodiment of the present invention.

Fig. 7 is a schematic diagram of the working sequence of three bees, namely, the lead bee, the observation bee and the scout bee, obtained according to the output result of the LNFG-based PPTL mining system according to the embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

In order to solve the problems in the prior art, the invention provides a system and a method for mining PPTL specifications, which are described in detail below with reference to the accompanying drawings.

The present embodiment aims to solve the following problems: working sequence, appearance frequency and other specifications of leading bees, observing bees and scout bees in the bee colony algorithm are mined, the specification to be mined is formally described by a PPTL formula and is simultaneously input into the PPTL specification mining system provided by the invention together with an executable program of the bee colony algorithm, and the working sequence, the appearance frequency and other properties of the three kinds of bees, namely the specification, are further obtained through a PPTL example and confidence coefficient output by the system; the embodiment specifically excavates the sequence of the work of the three types of bees.

As shown in fig. 1, the method for mining PPTL specifications provided by the embodiment of the present invention includes the following steps:

s101, inputting an executable program to be mined into a Trace generation module, and outputting a function sequence which only contains method calls in the program, namely a Trace file;

s102, inputting a Trace file into a Trace analysis module, outputting a set Events containing all Events appearing in the Trace, and abstracting method call into Events;

s103, inputting a PPTL formula P to be mined selected by a user into a PPTL _ LNFG conversion module, outputting an LNFG form corresponding to the P, and storing by using an adjacent linked list;

s104, inputting the event set Events output by S102 and the LNFG output by S103 into an LNFG instantiation module at the same time, and outputting the instantiated LNFG stored by an adjacent linked list;

s105, simultaneously inputting the trace output by S101 and the instantiated LNFG output by S104 into an LNFG detection module, and outputting a Boolean variable representing whether the PPTL meets the trace;

and S106, repeatedly executing S105 until all instantiated LNFGs finish the detection with the trace file, calculating the confidence that each instantiated PPTL instance meets the trace file, and returning.

The technical solution of the present invention is further described below with reference to specific examples.

Initiating the tool PPTLiner + by inputting a "/user/bin/time-v-o nf-order-1-res.txt./pplminster-g-f '< > p- > ([ ]. p.; s)' -print-states-context-threshold X-log fq.txt-trace-participant 'END' > lfg-order-1. txt" command, wherein "/user/bin/time-v-o nf-order-1-res.txt" indicates that command execution time will be measured using the "/user/bin/time" command and the result will be saved to the inf-order-1-res.txt file; "./pptlminar' indicates that an LNFG-based PPTL specification mining system is started; "-g" indicates that we select the LNFG-based PPTL specification mining method; "-f '< > p- > ([ ] | p; s)'" indicates that the excavated PPTL formula is "< > p- > ([ ] | p; s)"; "-print-stands" indicates that the result is printed out; "- - -" conf-threshold X "represents that when the result is printed, the result with the confidence coefficient more than or equal to" X "is output, wherein X is more than or equal to 0 and less than or equal to 1; "- - - - -log fq.txt" indicates that the trace file is fq.txt; "- - - - -trace-separator 'END'" indicates that each trace in the trace set is divided by a separator "END", and the separator supports user customization; "> inf-order-1. txt" indicates that the print result is written to an infg-order-1. txt file.

As shown in fig. 2, the system for mining PPTL specifications based on LNFG provided in the embodiment of the present invention includes: the device comprises a Trace generation module, a Trace analysis module, a PPTL _ LNFG conversion module, an LNFG instantiation module, an LNFG detection module and a mining result return module.

The embodiment of the invention comprises the following steps after the PPTL specification excavation system based on the LNFG is input:

the method comprises the following steps: inputting an executable program written in a C + + language for realizing the bee colony algorithm into a Trace generation module, and acquiring 60 traces by executing the program for multiple times, wherein each Trace contains 54 events on average, the traces are separated by using 'END', and one Trace is shown in FIG. 3.

Step two: inputting Trace into a Trace analysis module, and analyzing event sets, namely { sendemployedboxes (), sendOnlookerBees (), main (), initilize (), employedboxes _ update (), employedboxes _ cache (), callaterobabilites _ update (), OnlookerBees _ cache (), scanousboxes _ limit (), and whereinthe event represents the meaning shown in table 1 and contains 11 Events in total.

TABLE 1 event correspondence

Step three: the PPTL formula P is selected to be input into a PPTL _ LNFG converter, P: < > p- > ([ ] | p; s), meaning that event s occurs before event p. The information obtained after converting PPTL to LNFG is shown in table 2. Before storing the LNFG, anonymizing the nodes of the LNFG is performed, that is, numbering the nodes to save the storage space, where after anonymizing, the corresponding LNFG information is shown in table 3, and an adjacency linked list is used to store a graph G, and the storage result is shown in fig. 4.

Step four: the LNFG instantiator first generates an iterative loader upon initialization of the instantiation pool as shown in fig. 5 by generating an instantiation pool configuration a (11,2) as 110 pairs (event) mapping pair set. And selecting an arbitrary group of mappings (s,. initilize ()) (p,. sendemployee dbees ()) to traverse the edge node chain corresponding to each head node in the graph G, and replacing p in the syntax tree of the edge node weight domain with.. sendemployee dbees () and s with.. initile (), so as to finally finish the instantiation of the LNFG.

TABLE 2 CL (P), V0, EL (P), L info (P ═ P- > ([ ] | P; s))

TABLE 3 anonymized LNFG CL (P), V0, EL (P), L information (P ═ P- > ([ ]. P; s))

Step five: according to the detection idea of fig. 6, trace and LNFG in fig. 3 are selected for detection, and the detection intermediate process is shown in table 4. If the current event is consistent with the transition condition in the next state set, the current state set may reach the next reachable state set through the current event, and in step 4, the state "3" in the current state set may pass through the transition condition: "true" to states "3" and "4", state "4" may pass through the migration condition "! SE "reached states" 4 "," 5 ", and the current event" EU "with migration conditions" true "and"! SE' is consistent, then the next reachable state set is {3,4,5 }. Since SL is the last current event and the next reachable state set contains ε in step 19, this test returns true, meaning that the instantiated < > SE- > ([ ]. SE; init) satisfies trace, i.e., init occurs before SE.

TABLE 4 intermediate procedures in testing

The pptliner + final output a (11,2) is 110 instantiated PPTL formulas and corresponding confidence levels. The result of the interception is shown in table 5, and the three bee work sequences of the leading bee, the observation bee and the reconnaissance bee of the bee colony algorithm in fig. 7 can be obtained according to the result.

Table 5 mining part results

Executable programs of the bee colony algorithm and different PPTL formulas are respectively input into the PPTL specification mining system based on the LNFG and the system in the prior art, the performances of the two systems in time and memory are obtained as shown in Table 6, wherein the time is obtained through "/usr/bin/time" in a command line, the memory is obtained in real time through the result of a system monitor of the Linux system, and the equipment used in the embodiment is as follows: ubuntu 18.04.5LTS, 7.7GB, processor:CoreTM i7-9750H [email protected]

TABLE 6 comparison of PPTLiner and PPTLiner + results

Note: an "X" indicates a memory crash and no result can be obtained.

As can be seen from table 6, the system in the prior art is more prone to memory crash, and the run time of the LNFG-based PPTL specification mining system is significantly less than that of the system in the prior art without memory crash.

In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When used in whole or in part, can be implemented in a computer program product that includes one or more computer instructions. When loaded or executed on a computer, cause the flow or functions according to embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL), or wireless (e.g., infrared, wireless, microwave, etc.)). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

The above description is only for the purpose of illustrating the present invention and the appended claims are not to be construed as limiting the scope of the invention, which is intended to cover all modifications, equivalents and improvements that are within the spirit and scope of the invention as defined by the appended claims.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于TFS确认投产需求的方法及相关装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!