Test device, test method, and test program

The test apparatus and method streamline the testing of complex sequence programs by using a decision table to identify test cases, reducing the time needed for testing through eliminating the need for repeated program execution.

WO2026140621A1PCT designated stage Publication Date: 2026-07-02MITSUBISHI ELECTRIC CORP

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
MITSUBISHI ELECTRIC CORP
Filing Date
2025-11-20
Publication Date
2026-07-02

AI Technical Summary

Technical Problem

Testing complex sequence programs in sophisticated systems with a large number of inputs and outputs requires numerous applications, significantly increasing the time needed for testing due to the extensive number of input-output pairs.

Method used

A test apparatus and method that utilizes a search unit to identify test cases by analyzing a decision table generated from the sequence program, eliminating the need for actual execution of the program, thereby reducing testing time.

Benefits of technology

This approach reduces the time required for testing sequence programs by searching for test cases within a decision table, eliminating the need for repeated program execution, thus enhancing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2025040621_02072026_PF_FP_ABST
    Figure JP2025040621_02072026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention shortens the time required for testing a sequence program. A test device of the present invention tests a sequence program. The test device is provided with a search unit. The search unit searches a decision table for a test case that includes an input value and an output value to be satisfied by the sequence program, and outputs a search result. The decision table is generated from the sequence program and contains input values and output values of the sequence program.
Need to check novelty before this filing date? Find Prior Art

Description

Test Device, Test Method, and Test Program

[0001] The present disclosure relates to a test device, a test method, and a test program.

[0002] A sequence program is a program that realizes sequence control and is executed by a control device such as a programmable logic controller (hereinafter referred to as PLC). The programming language specification of the sequence program is standardized as IEC61131-3 by the International Electrotechnical Commission. The sequence program is executed by a PLC through creation, compilation, and writing to the PLC in a programming device.

[0003] The sequence program is developed through the processes of specification creation, design, implementation, and testing. If a defect is found during testing, the programmer investigates the cause and, if there is an error in the implementation, modifies the sequence program. If there is an error in the design, the programmer modifies the design and the associated sequence program. The operation of checking the presence or absence of defects through testing and correcting them if there are errors is called debugging.

[0004] In testing, a test device uses test cases created based on specifications to execute the sequence program to be tested and confirm success or failure. Test cases are usually expressed as the output values of the sequence program for the input values of the sequence program. If the actual output value when the sequence program is executed for the input value matches the output value specified in the test case, the test is successful and it is determined that there are no defects related to that test case. If the output value when the sequence program is executed for the input value does not match the output value specified in the test case, the test fails and it is determined that there are defects related to that test case.

[0005] During testing, the sequence program under test is executed on a PLC (Programmable Logic Controller) or simulator. The test requires a series of operations: loading the sequence program into the PLC or simulator and executing it, manually or automatically providing the input values ​​specified in the test case to the PLC or simulator, and manually or automatically verifying the output values.

[0006] Patent Document 1 discloses a technique for determining whether there are logical inconsistencies, i.e., defects in the sequence program, by creating a data table containing input and output pairs from input and output data expressed in a time chart format that shows the specifications, and then providing this to a sequence program for verification.

[0007] Japanese Patent Publication No. 2002-163020

[0008] Patent Document 1 verifies logical inconsistencies by sequentially applying input and output pairs for each time point in a data table created from a time chart to a sequence program. This verification is performed by determining the equivalence between the output values ​​of the sequence program and the output values ​​in the data table, by executing the sequence program with input values ​​from the data table.

[0009] However, in sophisticated systems that perform complex processing or large-scale systems with a large number of inputs and outputs, the number of input-output pairs in the data table increases, requiring more application of the sequence program. Here, application of the sequence program means running the sequence program on a real machine or simulator, providing inputs from the data table, and verifying whether the output matches the expected result. In other words, for systems that require many test cases, it is necessary to run the sequence program many times, which increases the time required to conduct the tests.

[0010] This disclosure is made in view of the above and aims to reduce the time required for testing sequence programs.

[0011] The test apparatus of the present disclosure is a test apparatus for testing a sequence program, comprising a search unit that searches for test cases including input values ​​and output values ​​that the sequence program should satisfy against a decision table containing the input values ​​and output values ​​of the sequence program, which is generated from the sequence program, and outputs the search results.

[0012] The test method of this disclosure is a test method for testing a sequence program, which searches for test cases including input values ​​and output values ​​that the sequence program should satisfy against a decision table containing the input values ​​and output values ​​of the sequence program, which is generated from the sequence program, and outputs the search results.

[0013] The test program of this disclosure is a test program for causing a computer to function as a test device, and causes the computer to perform a procedure of searching for test cases including input values ​​and output values ​​that a sequence program should satisfy against a decision table containing the input values ​​and output values ​​of the sequence program, which is generated from the sequence program, and outputting the search results.

[0014] According to this disclosure, test cases containing input and output values ​​that a sequence program must satisfy are searched against a decision table containing the input and output values ​​of the sequence program, which is generated from the sequence program. This eliminates the need to actually execute the sequence program, thus reducing the time required for testing. The purposes, features, aspects, and advantages of this disclosure will become more apparent from the following detailed description and accompanying drawings.

[0015] Figure 1 is a diagram showing an example of the configuration of a test apparatus according to Embodiment 1. Figure 2 is a diagram showing an example of a sequence program. Figure 3 is a diagram illustrating various contacts of a ladder. Figure 4 is a diagram illustrating some of the various coils of a ladder. Figure 5 is a diagram showing an example of a decision table for the upper network in Figure 2. Figure 6 is a diagram showing an example of a sequence program. Figure 7 is a diagram showing an example of a decision tree. Figure 8 is a diagram showing an example of a decision table. Figure 9 is a flowchart showing the operation of generating a decision tree. Figure 10 is a flowchart showing the operation of generating a decision tree. Figure 11 is a diagram showing another example of a sequence program. Figure 12 is a diagram showing another example of a decision tree. Figure 13 is a diagram showing another example of a decision table. Figure 14 is a diagram showing an example of the hardware configuration of a test apparatus. Figure 15 is a diagram showing an example of the configuration of a test apparatus according to Embodiment 2. Figure 16 is a diagram showing a first example of a sequence program according to Embodiment 2. Figure 17 is a diagram showing an example of the configuration of a divided sequence program. Figure 18 is a diagram showing a second example of a sequence program according to Embodiment 2. Figure 19 is a diagram showing an example of the configuration of a divided sequence program. Figure 20 is a diagram showing an example of the configuration of a test apparatus according to Embodiment 3. Figure 21 is a diagram showing a first example of a sequence program according to Embodiment 3. Figure 22 is a diagram showing an example of a normalized sequence program. Figure 23 is a diagram showing another example of a decision table. Figure 24 is a diagram showing a second example of a sequence program according to Embodiment 3. Figure 25 is a diagram showing another example of a normalized sequence program. Figure 26 is a diagram showing another example of a decision table. Figure 27 is a diagram showing an example of the configuration of a test apparatus according to Embodiment 4. Figure 28 is a diagram showing an example of a sequence program according to Embodiment 4. Figure 29 is a diagram showing an example of an extended decision table. Figure 30 is a diagram showing an example of a variable lookup table. Figure 31 is a diagram illustrating rising edge detection coils and falling edge detection coils. Figure 32 is a flowchart showing part of the decision tree generation operation according to Embodiment 6.Figure 33 is a flowchart showing another part of the decision tree generation operation according to Embodiment 6. Figure 34 is a flowchart showing another part of the decision tree generation operation according to Embodiment 6. Figure 35 is a diagram showing another example of a sequence program. Figure 36 is a diagram showing a part of another example of a decision tree. Figure 37 is a diagram showing a part of another example of a decision table. Figure 38 is a diagram showing another example of a decision tree. Figure 39 is a diagram showing another example of a decision table. Figure 40 is a diagram showing another example of a sequence program. Figure 41 is a diagram showing another example of a decision tree. Figure 42 is a diagram showing another example of a decision table. Figure 43 is a diagram showing the hardware configuration of a test apparatus relating to another modification. Figure 44 is a diagram showing the hardware configuration of a test apparatus relating to another modification of Figure 31.

[0016] Embodiments of this disclosure will be described below with reference to the drawings. In the description of each embodiment, the same or similar reference numerals will be used for matters described in embodiments previously described in this disclosure, and redundant explanations may be omitted.

[0017] If only a portion of the configuration is described in each embodiment, other embodiments described earlier in this disclosure can be applied to the remaining parts of the configuration that were not described. Furthermore, in each embodiment and its modifications, in addition to the combinations of parts that are explicitly shown to be specifically combinable, embodiments can be partially combined without explicit indication, provided that there are no particular problems with the combination.

[0018] <Embodiment 1> Figure 1 shows an example of the configuration of the test device 1 according to this embodiment 1. The test device 1 is a device for testing a sequence program 110. Below, we will first describe an example of the sequence program 110 to be tested. The functional configuration of the test device 1 will be described afterward.

[0019] The sequence program 110 is created using an editor not shown. Examples of programming languages ​​for describing the sequence program 110 include instruction lists, structured text, ladder diagrams, function block diagrams, and sequential function charts, as defined in the IEC 61131-3 standard. In this embodiment, the programming language for describing the sequence program 110 is, as an example, a ladder diagram (hereinafter simply referred to as "ladder").

[0020] The sequence program 110 is, for example, a program configuration unit (POU) according to the IEC 61131-3 standard. A program configuration unit includes a program, function blocks, functions, and classes. In other words, the sequence program 110 is a unit of processing written in a programming language (in this case, ladder logic).

[0021] The execution of the sequence program 110 begins according to a predetermined execution cycle, the fulfillment of a predetermined trigger condition, or the calling of another sequence program. Once execution begins, the processing written in the programming language is executed from the beginning to the end of the sequence program 110. As the sequence program 110 is executed according to the execution cycle, the processing from the beginning to the end is repeatedly executed.

[0022] In sequence program 110, variables can be used to hold data. Hereinafter, the value of a variable during a particular execution of sequence program 110, that is, the execution of processing from beginning to end, will be referred to as the "current value". In contrast, the value of a variable during an execution prior to this execution, that is, the last execution of processing from beginning to end that occurred before the execution of processing from beginning to end of "a certain execution", will be referred to as the "previous value". Let's explain the case where a Boolean variable is used in a sequence program 110. If the value of a variable during execution A is "false", and the value of the variable during the subsequent execution B is "true", then the current value of the variable in execution B is "true", and the previous value is "false".

[0023] Next, we will explain ladder logic. Figure 2 shows an example of a sequence program 110. The sequence program 110 is divided by the leftmost vertical line, the left busbar 111, and the rightmost vertical line, the right busbar 112. The area between the left busbar 111 and the right busbar 112 is called a network 113. In the example in Figure 2, two networks 113 are shown side by side in a vertical direction. A network label 114 is associated with each network 113. The network label 114 is information used to identify the network 113, and in the example in Figure 2, the network label 114 consists of an identifier or an unsigned decimal number.

[0024] The network 113 includes a plurality of connection elements CE. In this embodiment, the connection elements CE include contacts 115 and coils 116. Details of each of the contacts 115 and coils 116 will be described later. Connections between the connection elements CE are made by horizontal connections 117 using straight lines in the horizontal direction, or by vertical connections 118 using straight lines in the vertical direction.

[0025] Ladder logic is a programming language that simulates electrical circuits. In ladder logic, the values ​​of connection elements CE can be considered as ON and OFF states of electricity. Connections between connection elements CE are synonymous with power flow, which transmits ON or OFF states of electricity. That is, a horizontal connection 117 transmits the value of the connection element CE on the left (e.g., ON or OFF) to the connection element CE on the right, and a vertical connection 118 represents the logical OR of the values ​​of all connection elements CE connected to its left. In other words, a vertical connection 118 transmits OFF to the connection element CE on the right when the values ​​of all connection elements CE on its left are OFF, and transmits ON to the connection element CE on the right when the value of one or more connection elements CE on its left is ON.

[0026] Here, the ON state of electricity is associated with "true" and the OFF state with "false," so ladder logic is a programming language that performs logical operations to calculate truth or falsity.

[0027] Figure 3 illustrates various contacts 115 in a ladder logic. The contacts 115 in Figure 3 are defined in the IEC 61131-3 standard. Each contact 115 is assigned an argument VAR (or arguments VAR1, VAR2, and so on). The argument VAR is, for example, a variable or a constant. The contact 115 outputs a value corresponding to the argument VAR to the horizontal connection 117 on the right.

[0028] The contact 115 in Figure 3(a) is an normally open (a) contact. When the argument Var is "true", the a contact outputs the value of the horizontal connection 117 on the left side of the a contact to the horizontal connection 117 on the right side. On the other hand, when the argument Var is "false", the a contact outputs "false" to the horizontal connection 117 on the right side.

[0029] The contact 115 in Figure 3(b) is a b-contact. When the argument Var is "false", the b-contact outputs the value of the horizontal connection 117 on the left side of the b-contact to the horizontal connection 117 on the right side. On the other hand, when the argument Var is "true", the b-contact outputs "false" to the horizontal connection 117 on the right side.

[0030] The contact 115 in Figure 3(c) is a rising edge detection contact. The rising edge detection contact outputs the value of the horizontal connection 117 on the left side to the horizontal connection 117 on the right side when the previous value of the argument VAR is "false" and the current value is "true," and outputs "false" to the horizontal connection 117 on the right side in all other cases. In other words, the rising edge detection contact outputs "false" to the horizontal connection 117 on the right side unless the previous value of the argument VAR is "false" and the current value is "true."

[0031] Contact 115 in Figure 3(d) is a falling edge detection contact. The falling edge detection contact outputs the value of the horizontal connection 117 on the left side to the horizontal connection 117 on the right side when the previous value of the argument VAR is "true" and the current value is "false," and outputs "false" to the horizontal connection 117 on the right side in all other cases. In other words, the falling edge detection contact outputs "false" to the horizontal connection 117 on the right side unless the previous value of the argument VAR is "true" and the current value is "false."

[0032] The contact 115 in Figure 3(e) is a data-specified comparison contact. The comparison contact is set with arguments VAR1 and VAR2 of a specified data type DT. The data type DT includes, for example, integer types (e.g., Int type). The comparison contact is also set with a comparison operator <cmp> that compares arguments VAR1 and VAR2. The comparison operator <cmp> can be set to, for example, "=" (match), "<>" (mismatch), ">=" (greater than or equal to), ">" (greater than), "<=" (less than or equal to), and "<" (less than). The comparison contact evaluates the comparison operation shown by arguments VAR1 and VAR2 and the comparison operator <cmp>, and outputs a value corresponding to the evaluation result to the horizontal connection 117 on the right. Specifically, when the evaluation result is "true", the comparison contact outputs the value of the horizontal connection 117 on the left side of the comparison contact to the horizontal connection 117 on the right side. On the other hand, when the evaluation result is "false", the comparison contact outputs "false" to the horizontal connection 117 on the right side.

[0033] The contact 115 in Figure 3(f) is a multi-defined type comparison contact. Arguments VAR1 and VAR2 are also set for this comparison contact. However, the data types of arguments VAR1 and VAR2 are not specified. A comparison operator <cmp> that compares arguments VAR1 and VAR2 is also set for this comparison contact. The comparison operator <cmp> can be set to one of the following, for example: "=" (match), "<>" (mismatch), ">=" (greater than or equal to), ">" (greater than), "<=" (less than or equal to), and "<" (less than). The comparison contact evaluates the comparison operation shown by arguments VAR1, VAR2, and the comparison operator <cmp>, and outputs a value corresponding to the evaluation result to the horizontal connection 117 on the right. Specifically, when the evaluation result is "true", the comparison contact outputs the value of the horizontal connection 117 on the left side of the comparison contact to the horizontal connection 117 on the right side. On the other hand, when the evaluation result is "false", the comparison contact outputs "false" to the horizontal connection 117 on the right side.

[0034] Figure 4 illustrates some of the various coils 116 of the ladder logic. Figure 4 shows coils 116 that do not include rising edge detection and falling edge detection. The coils 116 in Figure 4 are defined in the IEC 61131-3 standard. Coil 116 outputs the value of the horizontal connection 117 on the left directly to the horizontal connection 117 on the right. An argument VAR is set for coil 116. The argument VAR is, for example, a variable. Coil 116 outputs a value to the argument VAR according to the type of coil 116.

[0035] The coil 116 in Figure 4(a) is a normal coil (hereinafter referred to as a normal coil). The normal coil outputs the value of the horizontal connection 117 on the left to the argument Var.

[0036] The coil 116 in Figure 4(b) is a negation coil. The negation coil outputs the negation of the value of the horizontal connection 117 on the left to the argument Var. In other words, the negation coil outputs "false" to the argument Var when the value of the horizontal connection 117 on the left is "true", and outputs "true" to the argument Var when the value of the horizontal connection 117 on the left is "false".

[0037] The coil 116 in Figure 4(c) is a set coil. The set coil outputs "true" to the argument Var when the value of the horizontal connection 117 on the left is "true". On the other hand, the set coil maintains the value of the argument Var when the value of the horizontal connection 117 on the left is "false".

[0038] The coil 116 in Figure 4(d) is a reset coil. The reset coil outputs "false" to the argument Var when the value of the horizontal connection 117 on the left is "true". On the other hand, the reset coil maintains the value of the argument Var when the horizontal connection 117 on the left is "false".

[0039] In the upper network 113 of Figure 2, three contacts 115 and a coil 116 are connected horizontally to each other. All three contacts 115 are normally open contacts, and arguments In1 to In3 are set for each. The coil 116 is a normal coil and is installed after the three contacts 115. Out1 is set as the argument for the coil 116. The value of the horizontal connection 117 connected to the left busbar 111 is "true". In this network 113, when arguments In1 to In3 are all "true", the coil 116 outputs "true" to argument Out1. In other words, at this time, the value of argument Out1 of the coil 116 is "true". Also, when at least one of arguments In1 to In3 is "false", the coil 116 outputs "false". In other words, at this time, the value of argument Out1 of the coil 116 is "false".

[0040] In the lower network 113 of Figure 2, a portion in which two contacts 115 are connected perpendicularly to each other, another contact 115, and a coil 116 are connected horizontally to each other. Hereinafter, the portion including multiple connection elements CE connected perpendicularly to each other will be referred to as a vertical connection. "Vertical connection" is not a general term, but a provisional name used to explain the embodiments of this disclosure in an easy-to-understand manner. All three contacts 115 are normally open contacts, and arguments In4 and In5 are set for the two contacts 115 of the vertical connection, while argument In6 is set for the other contact 115. The coil 116 is a normal coil and is provided after the three contacts 115. Argument Out2 is set for the coil 116. In this network 113, when at least one of arguments In4 and In5 is "true" and argument In6 is "true", the coil 116 outputs "true". In other words, at this time, the value of argument Out2 of the coil 116 becomes "true". Furthermore, if both arguments In4 and In5 are "false", or if argument In6 is "false", coil 116 outputs "false". In other words, in this case, the value of argument Out2 of coil 116 becomes "false".

[0041] In the following, the arguments set to contact 115 will be collectively referred to as argument In, and the arguments set to coil 116 will be collectively referred to as argument Out. The value of argument In will be treated as the input value of the sequence program 110, and the value of argument Out will be treated as the output value of the sequence program 110.

[0042] The relationship between argument In and argument Out in such a sequence program 110 is determined based on the specifications of the sequence program 110. If the value of argument Out in relation to the value of argument In in the sequence program 110 is as specified, then the sequence program 110 is correct and there are no defects. Conversely, if the value of argument Out in relation to the value of argument In in the sequence program 110 is not as specified, then the sequence program 110 is incorrect and there are defects.

[0043] Referring to Figure 1, the test apparatus 1 includes a generation unit 120 and a search unit 150. Below, we will first describe the general functions of the generation unit 120 and the search unit 150, and then provide a detailed explanation.

[0044] The sequence program 110 is input to the generation unit 120. Based on the sequence program 110, the generation unit 120 generates a decision table 130. The decision table 130 is data indicating the correspondence relationship between the value of the argument In (input value) and the value of the argument Out (output value) for the sequence program 110. FIG. 5 is a diagram showing an example of the decision table 130 for the upper network 113 in FIG. 2. In FIG. 5, "-" indicates that the value may be either "true" or "false". That is, "-" indicates "any". The decision table 130 in FIG. 5 includes four cases #1 to #4. In case #1, since all of the arguments In1 to In3 are "true", the argument is "true". In case #2, since the argument In1 is "false", regardless of the values of the arguments In2 and In3, the argument Out1 is "false". In case #3, since the argument In1 is "true" and the argument In2 is "false", regardless of the value of the argument In3, the argument Out1 is "false". In case #4, since the arguments In1 and In2 are "true" and the argument In3 is "false", the argument Out1 is "false". The generation unit 120 stores the generated decision table 130 in a storage device (described later).

[0045] The decision table 130 in FIG. 5 shows the correspondence relationship between the value of the argument In (input value) and the value of the argument Out (output value) for the upper sequence program 110 in FIG. 2. If there is an error in the sequence program 110, the content of the decision table 130 also includes an error.

[0046] Therefore, in this embodiment, if the decision table 130 contains content that does not match the test case 140, which includes the values ​​of the arguments In (input value) and Out (output value) that the sequence program 110 should satisfy, the sequence program 110 is considered incorrect, i.e., the test fails. This test case 140 is generated in advance by an editor or the like (not shown). The test case 140 is derived from the specifications and is data that shows the correct combination of the values ​​of the arguments In and Out. As an example of the test case 140 in Figure 5, it includes the case that "when argument In1 is 'false', argument Out1 is 'false'". The test case 140 includes not only this case but also multiple other different cases.

[0047] The search unit 150 searches the decision table 130 for test cases 140 and outputs the search result 160. For example, if test case 140 is the case where "when argument In1 is 'false', then argument Out1 is 'false'", the search unit 150 finds this test case 140 in case #2 of the decision table 130. The search unit 150 searches the decision table 130 for each of the test cases 140. The search unit 150 stores the search result 160 in a storage device (described later). The search result 160 is data that indicates the test result of the sequence program 110. For example, if all test cases 140 are found in the decision table 130, the sequence program 110 is judged to be correct, and if at least one test case 140 is not found in the decision table 130, the sequence program 110 is judged to be incorrect.

[0048] Next, an example of a more specific operation of the generation unit 120 will be described. In the present embodiment, as an example, the generation unit 120 first generates a decision tree based on the sequence program 110, and then generates a decision table 130 based on this decision tree. To explain the operation of the generation unit 120, a specific example of the sequence program 110, the decision tree, and the decision table 130 will be introduced. FIG. 6 is a diagram showing an example of the sequence program 110, FIG. 7 is a diagram showing an example of the decision tree, and FIG. 8 is a diagram showing an example of the decision table 130.

[0049] In the example of FIG. 6, the sequence program 110 has a single network 113. This network 113 includes, as connection elements CE, an a contact 300, a b contact 310, a rising detection contact 320, and a normal coil 330, which are horizontally connected to each other. An argument In1 is set for the a contact 300, an argument In2 is set for the b contact 310, and an argument In3 is set for the rising detection contact 320. An argument Out1 is set for the normal coil 330. In the example of FIG. 6, no vertical continuator is included. The network 113 including a vertical continuator will be described in detail later.

[0050] As shown in FIG. 7, the decision tree includes nodes ND and leaves LF. The generation unit 120 generates nodes ND from the contacts 115. In FIG. 7, a node 400 is shown as the node ND corresponding to the a contact 300, a node 410 is shown as the node ND corresponding to the b contact 310, and a node 420 is shown as the node ND corresponding to the rising detection contact 320. Each node ND has an expression indicating the operation of each contact 115, and T edges and F edges corresponding to the output value of that expression. In FIG. 7, "a(In1)" is shown as the expression of the a contact 300 for the node 400, "b(In2)" is shown as the expression of the b contact 310 for the node 410, and "P(In3)" is shown as the expression of the rising detection contact 320 for the node 420.

[0051] The following describes the notation of the expressions corresponding to each contact 115 and the content of their operation. "a(Var)" corresponding to the a-contact indicates the operation of outputting "true" when the argument Var is "true" and outputting "false" when the argument Var is "false". "b(Var)" corresponding to the b-contact indicates the operation of outputting "false" when the argument Var is "true" and outputting "true" when the argument Var is "false". "P(Var)" corresponding to the rising edge detection contact indicates the operation of outputting "true" when the previous value of the argument Var is "false" and the current value of the argument Var is "true", and outputting "false" otherwise.

[0052] Although not shown in Figure 7, the formulas corresponding to the other contacts 115 will also be explained. "N(Var)", which corresponds to the falling edge detection contact, outputs "true" when the previous value of argument Var is "true" and the current value of argument Var is "false", and outputs "false" otherwise. "CMP(Var1, Var2)", which corresponds to the comparison contact (data type specification or over-definition), outputs "true" when the comparison operation Var1(CMP)Var2 is "true", and outputs "false" otherwise. Here, (CMP) represents one of "=", "<>", ">=", ">", "<=", and "<". Note that the data types of argument Var1 and argument Var2 are assumed to be the same regardless of whether they are specified or not.

[0053] The T edge corresponds to the "true" output value of the contact 115 corresponding to node ND, and the F edge corresponds to the "false" output value of the contact 115 corresponding to node ND.

[0054] Note that the configuration of node ND is not limited to the configuration described above.

[0055] The generation unit 120 generates leaf LF from the coil 116. In the example in Figure 7, leaves 430, 440, 450, and 460 are shown as leaf LF corresponding to the normal coil 330. Each leaf LF has an equation and possible values ​​for that equation (e.g., true or false). The equation corresponds to the type and output of the coil 116. In the example in Figure 7, the equation and value for leaf 430 are shown as "a(Out1) = T", and the equations and values ​​for leaves 440, 450, and 460 are shown as "a(Out1) = F".

[0056] The expression "a(Out) = Value", which corresponds to a normal coil, indicates the operation of outputting the value of an expression based on the value Value to the argument Out. The value Value can be "true" ("T" in Figure 7) or "false" ("F" in Figure 7).

[0057] Although not shown in Figure 7, the formulas corresponding to the other coils will also be explained. The formula for the negation coil, "b(Out) = Value," indicates the operation of outputting the inverse value of Value to the argument Out. The formula for the set coil, "S(Out) = Value," indicates the operation of outputting "True" to the argument Out when Value is "True," and maintaining the value of argument Out when Value is "False." The formula for the reset coil, "R(Out) = Value," indicates the operation of outputting "False" to the argument Out when Value is "True," and maintaining the value of argument Out when Value is "False."

[0058] Note that the configuration of the Leaf LF is not limited to the configuration described above.

[0059] Figures 9 and 10 are flowcharts illustrating the decision tree generation process. The generation unit 120 operates according to this flowchart, scanning the network 113 in ladder execution order from the left busbar 111, generating decision tree nodes ND or leaves LF from the connection elements CE, which are contacts 115 or coils 116, and connecting them to each other. As an example, the last connection element CE of the network 113 is assumed to be a coil 116. The flowchart in Figure 9 will be explained below using Figures 6 and 7.

[0060] First, in step S1, the generation unit 120 clears the connection edge, horizontal connection list, and inverted output list, which are outlined below. The connection edge indicates the edge to which the newly generated node ND or leaf LF of the generation unit 120 is connected. The horizontal connection list indicates the edge to which the node or leaf generated from the next connection element of the vertical connection body is connected. In the example of Figure 6, the network 113 does not contain a vertical connection body, so the horizontal connection list will be described in detail later. The inverted output list indicates the edge to which the value Value of the connected coil 116 is "false", as will be described later.

[0061] Next, in step S2, the generation unit 120 acquires one connection element CE from the network 113 in execution order. In the example in Figure 6, the generation unit 120 first acquires the normally open contact 300.

[0062] Next, in step S3, the generation unit 120 determines the type of the acquired connection element CE (contact 115 or coil 116). If the connection element CE is a contact 115, in step S4, the generation unit 120 generates a node ND corresponding to the connection element CE and sets an expression according to the type of connection element CE. If the connection element CE is an a-contact 300 having argument In1, the generation unit 120 generates a node 400 whose expression is "a(In1)".

[0063] Next, in step S5, the generation unit 120 connects the generated node ND to a connection edge. If the connection edge is empty, node ND is not connected to any node and becomes the first node (i.e., the root node). In the example in Figure 6, if the connection element CE obtained in step S2 is an a-contact 300, then node 400 becomes the root node.

[0064] Next, in step S6, the generation unit 120 determines whether the connection to the right of the acquired connection element CE is a horizontal connection 117 or a vertical connection 118. If the connection element CE is an a-contact 300, in Figure 6, the connection to the right is a horizontal connection 117. When the connection is a horizontal connection 117, in step S7, the generation unit 120 determines whether the horizontal connection list is empty. In this case, the horizontal connection list is empty.

[0065] If the horizontal connection list is empty, in step 8, the generation unit 120 sets the T edge of the generated node ND as the connection edge and adds the F edge of node ND to the inverted output list. If node ND is node 400, the T edge of node 400 is set as the connection edge and the F edge of node 400 is added to the inverted output list.

[0066] The generation unit 120 executes step S2 again. In the example in Figure 6, the generation unit 120 acquires the b-contact 310 in step S2. The generation unit 120 determines that the acquired connection element CE is the contact 115 (step S3), generates a node 410 corresponding to the b-contact 310 (step S4), and connects the node 410 to the connection edge (step S5). As a result, node 410 is connected to the T-edge of node 400 (see also Figure 7). Then, the generation unit 120 determines that the connection to the right of the acquired b-contact 310 is a horizontal connection (step S6), determines that the horizontal connection list is empty (step S7), sets the T-edge of node 410 as the connection edge, and adds the F-edge of node 410 to the inverted output list (step S8). As a result, the connection edge is updated from the T-edge of node 400 to the T-edge of node 410, and the inverted output list includes the F-edge of node 400 and the F-edge of node 410.

[0067] The generation unit 120 executes step S2 again. In the example in Figure 6, the generation unit 120 acquires the rising edge detection contact 320 in step S2. The generation unit 120 determines that the acquired connection element CE is the contact 115 (step S3), generates a node 420 corresponding to the rising edge detection contact 320 (step S4), and connects the node 420 to the connection edge (step S5). As a result, node 420 is connected to the T edge of node 410 (see also Figure 7). Then, the generation unit 120 determines that the connection to the right of the acquired rising edge detection contact 320 is a horizontal connection (step S6), determines that the horizontal connection list is empty (step S7), sets the T edge of node 420 to the connection edge, and adds the F edge of node 420 to the inverted output list (step S8). As a result, the connected edge is updated from the T edge of node 410 to the T edge of node 420, and the inverted output list includes the F edge of node 400, the F edge of node 410, and the F edge of node 420.

[0068] The generation unit 120 executes step S2 again. In the example in Figure 6, the generation unit 120 acquires a normal coil 330 in step S2. In step S3, the generation unit 120 determines that the acquired connection element CE is a coil 116. Once it is determined that the connection element CE is a coil 116, in step S9, the generation unit 120 generates a leaf 430 corresponding to the normal coil 330. Specifically, the generation unit 120 sets an expression corresponding to the type of coil 116 with the value Value set to "true" ("T" in Figure 7).

[0069] Next, in step S10, the generation unit 120 connects the generated leaf 430 to the connecting edge. This connects the leaf 430 to the T edge of node 420 (see also Figure 7). Next, in step S101, the generation unit 120 determines whether the horizontal connection list is empty or not. If the horizontal connection list is empty, the process in step S11 is performed. If the horizontal connection list is not empty, in step S102, the generation unit 120 copies the generated leaf for the length of the horizontal connection list and connects it to all edges in the horizontal connection list.

[0070] Next, in step S11, the generation unit 120 copies the generated leaf 430 for a number of times equal to the list length (i.e., the number of elements) of the inverted output list (in this case, 3 times), with the value Value set to "false" ("F" in Figure 7), thereby generating leaves 440, 450, and 460, and connects leaves 440, 450, and 460 to the respective F edges of the inverted output list. As a result, for example, leaf 440 is connected to the F edge of node 400, leaf 450 is connected to the F edge of node 410, and leaf LF460 is connected to the F edge of node 420 (see also Figure 7).

[0071] As described above, the generation unit 120 generates the decision tree shown in Figure 7 based on the sequence program 110 shown in Figure 6.

[0072] Next, the generation unit 120 generates the decision table 130 shown in Figure 8 based on the decision tree shown in Figure 7. The number of leaf LFs appearing in the decision tree becomes the minimum number of argument Out1 in the decision table 130. In the example in Figure 7, there are 4 leaf LFs, so the minimum number of argument Out1 in the decision table 130 is 4. The number of argument Out1 in the decision table 130 is, for example, the total number of paths from the root node (here, node 400) to each leaf LF.

[0073] The generation unit 120 determines the correspondence between argument In and argument Out by scanning the decision tree. In the example in Figure 7, the generation unit 120 sequentially scans the paths from the root node (node ​​400) to each of the leaves 430, 440, 450, and 460, and generates a decision table 130 by associating the value of argument In of the contact 115 corresponding to node ND in each path with the value of argument Out of the coil 116 corresponding to leaf LF.

[0074] For example, the generation unit 120 first searches for a path to the leaf 430. Here, the generation unit 120 finds a single first path: node 400 - T edge - node 410 - T edge - node 420 - T edge - leaf 430. In the first path, node 400 is connected to node 410 by a T edge, so the argument In1 (here, "true") is adopted for the normally open contact 300 to output "true". Similarly, in the first path, node 410 is connected to node 420 by a T edge, so the argument In2 (here, "false") is adopted for the normally closed contact 310 to output "true", and in the first path, node 420 is connected to leaf 430 by a T edge, so the argument In3 (here, the previous value was "false" and the current value is "true") is adopted for the rising edge detection contact 320 to output "true". The argument Out1 of leaf 430 is the value when the value of the expression corresponding to coil 330 is "true" (in this case, "true"). The generation unit 120 sets the value of the argument In and the argument Out of the first path to case #1 in Figure 8.

[0075] Since there is no other path to leaf 430, the generation unit 120 searches for a path to the next leaf 440. The generation unit 120 finds a single second path: node 400 - F edge - leaf 440. In the second path, node 400 is connected to leaf 430 at the F edge, so the argument In1 (here, "false") is adopted for the normally open contact 300 to output "false". Since nodes 410 and 420 do not exist in the second path, the generation unit 120 sets arguments In2 ​​and In3 to arbitrary values. In the second path, the argument Out1 for leaf 440 is normally the value when the value Value of the expression corresponding to coil 330 is "false" (here, "false"). The generation unit 120 sets the values ​​of argument In and argument Out for the second path to case #2 in Figure 8.

[0076] Since there is no other path to leaf 440, the generation unit 120 finds a single third path to the next leaf 450: node 400 - T edge - node 410 - F edge - leaf 450. Since node 400 on the third path is connected to the T edge, the argument In1 (here, "true") is adopted for the normally open contact 300 to output "true". Also, since node 410 on the third path is connected to the F edge, the argument In2 (here, "true") is adopted for the normally closed contact 310 to output "false". The generation unit 120 sets the other argument In3 to arbitrary. For leaf 450 in the third path, the argument Out1 is usually the value when the value Value of the expression corresponding to coil 330 is "false" (here, "false"). The generation unit 120 sets the values ​​of argument In and argument Out for the third path to case #3 in Figure 8.

[0077] Since there is no other path to leaf 450, the generation unit 120 finds a single fourth path to the next leaf 460: node 400 - T edge - node 410 - T edge - node 420 - F edge - leaf 460. Since nodes 400 and 410 on the fourth path are connected to the T edge, the argument In1 (here, "true") for the a-contact 300 to output "true" and the argument In2 (here, "false") for the b-contact 310 to output "true" are adopted. Also, since node 420 on the fourth path is connected to the F edge, the argument In2 (here, except when the previous value was "false" and the current value is "true") for the rising edge detection contact 320 to output "false" is adopted. In the fourth path, the argument Out1 of leaf 460 is normally the value when the value Value of the expression corresponding to coil 330 is "false" (here, "false"). The generation unit 120 sets the values ​​of the argument In and argument Out of the fourth path to case #4 in Figure 8.

[0078] As described above, the generation unit 120 can generate a decision tree from the sequence program 110 according to the flowchart in Figure 9, and generate a decision table 130 from the decision tree.

[0079] Next, an example of a generation operation for a sequence program 110 including a vertical connection will be described. Figure 11 shows another example of the sequence program 110, Figure 12 shows another example of the decision tree, and Figure 13 shows another example of the decision table 130.

[0080] In the example shown in Figure 11, the sequence program 110 has a single network 113. This network 113 includes a contact 700, a falling-edge detection contact 710, a data-specified comparison contact 720, and a negative coil 730 as connection elements CE. The contact 700 and the falling-edge detection contact 710 are connected perpendicularly to each other. The vertical connection including the contact 700 and the falling-edge detection contact 710, the comparison contact 720, and the negative coil 730 are connected horizontally to each other. The contact 700 is set to argument In1, and the falling-edge detection contact 710 is set to argument In2. The comparison contact 720 is set to arguments Var1 and Var2, with ">" (greater than) as the comparison operator and "Int" (integer type) as the data type. The negative coil 730 is set to argument Out1.

[0081] The generation unit 120 operates, for example, according to the flowcharts in Figures 9 and 10. The generation unit 120 clears the connection edge, horizontal connection list and inverted output list (step S1), acquires the a-contact 700 as the connection element CE (step S2), determines that the connection element CE is a contact 115 (step S3), generates a node 800 corresponding to the a-contact 700 (step S4), and places the node 800 as the root node (step S5).

[0082] Then, in step S6, the generation unit 120 determines whether the connection to the right of the acquired connection element CE (in this case, the a-contact 700) is a horizontal connection 117 or a vertical connection 118. Since the connection to the right of the a-contact 700 is a vertical connection 118, in step S12, the generation unit 120 determines whether the acquired connection element CE (in this case, the a-contact 700) is located at the end of the vertical connection body. In the example in Figure 11, the a-contact 700 is the first connection element CE of the vertical connection body. For this reason, the generation unit 120 determines that the connection element CE is not located at the end, and in step S13, sets the F edge of the generated node ND (in this case, node 800) as the connection edge and adds the T edge of node ND to the horizontal connection list. As a result, the F edge of node 800 is set as the connection edge, and the T edge of node 800 is included in the horizontal connection list.

[0083] The generation unit 120 executes step S2 again. In the example in Figure 11, the generation unit 120 acquires the falling edge detection contact 710 in step S2. The generation unit 120 determines that the acquired connection element CE is the contact 115 (step S3) and generates a node 810 corresponding to the falling edge detection contact 710 (step S4). The formula for node 810 is "N(In2)" (see also Figure 12). Then, the generation unit 120 connects node 810 to the connection edge (step S5). As a result, node 810 is connected to the F edge of node 800 (see also Figure 12). Next, the generation unit 120 determines that the connection to the right of the acquired falling edge detection contact 710 is the vertical connection 118 (step S6) and determines whether the falling edge detection contact 710 is located at the end (step S12). In the example shown in Figure 11, the falling edge detection contact 710 is located at the end of the vertical connection. Therefore, in step S14, the generation unit 120 sets the T-edge of node 810 as the connection edge and adds the F-edge of node 810 to the inverted output list. As a result, the connection edge is updated from the F-edge of node 800 to the T-edge of node 810, and the inverted output list now includes the F-edge of node 810. The horizontal connection list remains unchanged and therefore still includes the T-edge of node 800.

[0084] The generation unit 120 executes step S2 again. In the example in Figure 11, the generation unit 120 acquires the comparison contact 720 in step S2. The generation unit 120 determines that the acquired connection element CE is the contact 115 (step S3) and generates a node 820 corresponding to the comparison contact 720 (step S4). The expression for node 820 is ">(Var1, Var2)" (see Figure 12). Then, the generation unit 120 connects node 820 to the connection edge (step S5). As a result, node 820 is connected to the T edge of node 810 (see Figure 12). Next, the generation unit 120 determines that the connection to the right of the acquired comparison contact 720 is the horizontal connection 117 (step S6) and determines whether the horizontal connection list is empty or not (step S7). Here, the horizontal connection list contains the T edge of node 800. The generation unit 120 determines that the horizontal connection list is not empty and, in step S15, connects node 820 to all edges in the horizontal connection list. As a result, node 820 is also connected to the T-edge of node 800 (see Figure 12). The generation unit 120 then clears the horizontal connection list. Next, the generation unit 120 sets the T-edge of node 820 as the connection edge and adds the F-edge of node 820 to the inverted output list (step S8). As a result, the connection edge is updated from the T-edge of node 810 to the T-edge of node 820, and the inverted output list now includes the F-edge of node 810 and the F-edge of node 820. The horizontal connection list is empty.

[0085] The generation unit 120 executes step S2 again. In the example in Figure 11, the generation unit 120 acquires the negative coil 730 in step S2. The generation unit 120 determines that the acquired connection element CE is the coil 116 (step S3) and generates a leaf 830 corresponding to the negative coil 730 (step S9). Specifically, the generation unit 120 sets an expression corresponding to the type of negative coil 730 with the value Value set to "true" (T in Figure 12). Next, the generation unit 120 connects the leaf 830 to a connection edge (here, the T edge of node 820) (step S10), copies the leaf 830 a number of times equal to the list length (i.e., the number of elements) of the inverted output list (two in this case) with the value Value set to "false" (F in Figure 12), generates leaves 840 and 850, and connects leaves 840 and 850 to the respective F edges of the inverted output list. As a result, for example, leaf 840 is connected to the F edge of node 810, and leaf 850 is connected to the F edge of node 820 (see Figure 12).

[0086] As described above, the generation unit 120 generates the decision tree shown in Figure 12 based on the sequence program 110 shown in Figure 11.

[0087] Next, the generation unit 120 generates the decision table 130 shown in Figure 13 based on the decision tree shown in Figure 12. The generation unit 120 sequentially scans the paths from the root node (node ​​800) to each of the leaves 830, 840, and 850, and associates the value of the argument In of the contact 115 corresponding to node ND in each path with the value of the argument Out of the coil 116 corresponding to leaf LF, thereby generating the decision table 130.

[0088] For example, the generation unit 120 first searches for a path to the leaf 830. Through this search, the generation unit 120 discovers the following two paths: the first path is node 800 - T edge - node 820 - T edge - leaf 830, and the second path is node 800 - F edge - node 810 - T edge - node 820 - T edge - leaf 830.

[0089] In the first path, node 800 is connected to node 820 by a T-edge, so the argument In1 (here, "true") for the normally open contact 700 to output "true" is adopted. In the first path, node 820 is connected to leaf 830 by a T-edge, so the evaluation result of the comparison operation of arguments Var1 and Var2 (here, "true") for the comparison contact 720 to output "true" is adopted. Then, the argument Out1 of leaf 830 is the value when the value Value of the expression corresponding to the negation coil 730 is "true" (here, "false"). Node 810 does not exist in the first path, so the argument In2 is arbitrary. The generation unit 120 sets the values ​​of the argument In and argument Out of the first path to case #1 in Figure 12.

[0090] In the second path, node 800 is connected to node 810 by an F edge, so argument In1 (here, "false") is adopted for the normally open contact 700 to output "false". In the second path, node 810 is connected to node 820 by a T edge, so argument In2 (here, the previous value was "true" and the current value is "false") is adopted for the falling edge detection contact 710 to output "true". In the second path, node 820 is connected to leaf 830 by a T edge, so the evaluation result of the comparison operation of arguments Var1 and Var2 (here, "true") is adopted for the comparison contact 720 to output "true". Then, for the argument Out1 of leaf 830, the value when the value Value of the expression corresponding to the negation coil 730 is "true" (here, "false") is adopted. The generation unit 120 sets the values ​​of argument In and argument Out of the second path to case #2 in Figure 12.

[0091] Next, the generation unit 120 searches for a path to, for example, a leaf 840. Through this search, the generation unit 120 discovers the following two third and fourth paths. The third path is node 800 - T edge - node 820 - F edge - leaf 840, and the fourth path is node 800 - F edge - node 810 - T edge - node 820 - F edge - leaf 840.

[0092] In the third path, node 800 is connected to node 820 by a T-edge, so the argument In1 (here, "true") is adopted for the normally open contact 700 to output "true". In the third path, node 820 is connected to leaf 840 by an F-edge, so the evaluation result of the comparison operation of arguments Var1 and Var2 (here, "false") is adopted for the comparison contact 720 to output "false". Then, the argument Out1 of leaf 840 is adopted as the value when the value Value of the expression corresponding to the negation coil 730 is "false" (here, "true"). Since node 810 does not exist in the third path, the argument In2 is arbitrary. The generation unit 120 sets the values ​​of the argument In and argument Out of the third path to case #3 in Figure 12.

[0093] In the fourth path, node 800 is connected to node 810 by an F edge, so argument In1 (here, "false") is adopted for the normally open contact 700 to output "false". In the fourth path, node 810 is connected to node 820 by a T edge, so argument In2 (here, the previous value was "true" and the current value is "false") is adopted for the falling edge detection contact 710 to output "true". In the fourth path, node 820 is connected to leaf 840 by an F edge, so the evaluation result of the comparison operation of arguments Var1 and Var2 (here, "false") is adopted for the comparison contact 720 to output "false". Then, for the argument Out1 of leaf 840, the value when the value Value of the expression corresponding to the negation coil 730 is "false" (here, "true") is adopted. The generation unit 120 sets the values ​​of argument In and argument Out of the fourth path to case #4 in Figure 12.

[0094] Next, the generation unit 120 searches for a path to, for example, leaf 850. Through this search, the generation unit 120 discovers a single fifth path: node 800 - F edge - node 810 - F edge - leaf 850. In the fifth path, node 800 is connected to node 810 by an F edge, so the argument In1 (here, "false") is adopted for the normally open contact 700 to output "false". In the fifth path, node 810 is connected to leaf 850 by an F edge, so the argument In2 (here, anything other than (previous value "true" and current value "false") is adopted for the falling edge detection contact 710 to output "false". Then, the argument Out1 of leaf 850 is adopted as the value when the value Value of the expression corresponding to the negation coil 730 is "false" (here, "true"). Since node 820 is not in the fifth path, argument In3 is arbitrary. The generation unit 120 sets the values ​​of the argument In and argument Out of the fifth path to case #5 in Figure 12.

[0095] As described above, the generation unit 120 can generate a decision tree from the sequence program 110 in accordance with the flowcharts in Figures 9 and 10, and generate a decision table 130 from the decision tree.

[0096] Next, a more detailed example of the operation of the search unit 150 will be described. Test case 140 includes a pair of input and output values. In test case 140 corresponding to Figure 6, the values ​​of arguments In1 to In3 are used as input values, and the value of argument Out1 is used as the output value.

[0097] From the pairs of input and output values ​​that the network 113 must satisfy, several test cases 140 necessary for testing the network 113 are designed. For example, a possible first test case 140 is: "If argument In1 is 'true', argument In2 is 'false', and the previous value of argument In3 was 'false' and the current value is 'true', then argument Out1 is 'true'." This first test case 140 is derived from the specifications that led to the implementation of the network 113 shown in Figure 6. Note that the expression of test case 140 is not limited to this.

[0098] The search unit 150 searches for test cases 140 in the decision table 130. For example, the search unit 150 compares each test case 140 with each case in the decision table 130 to determine if the test case 140 is included in any of the cases in the decision table 130. For example, the search unit 150 compares the values ​​of each argument In and argument Out of test case 140 with the values ​​of each argument In and argument Out in the decision table 130, case by case. As a specific example, the search unit 150 compares the values ​​of each argument In and argument Out of test case 140 with the values ​​of argument In and argument Out of case #1, respectively. For example, the search unit 150 compares argument In1 of the first test case 140 with argument In1 of case #1, compares argument In2 of the first test case 140 with argument In2 of case #1, compares argument In3 of the first test case 140 with argument In3 of case #1, and compares argument Out1 of the first test case 140 with argument Out1 of case #1. The search unit 150 then determines that the first test case 140 is included in case #1 of the decision table 130, that is, the first test case has been found, when all the comparison results are in agreement. On the other hand, if the comparison result for any item is in agreement, the search unit 150 determines that the first test case 140 is not included in case #1 of the decision table 130. The search unit 150 can search for the first test case 140 against the decision table 130 by comparing the first test case 140 with the decision table 130.

[0099] In the example shown in Figure 6, the first test case 140 exists in case #1 of the decision table 130. Therefore, the search unit 150 determines that the first test case 140 is included in case #1 of the decision table 130 and stores the search result for the first test case 140 as "true" in the search result 160. The search result "true" means that the test case 140 was found in the decision table 130.

[0100] Note that the expression of search result 160 for test case 140 is not limited to this. Also, the search method is not limited to the above.

[0101] Furthermore, suppose there is a second test case 140 in which "if argument In1 is 'false', then argument Out1 is 'false'." The second test case 140 does not mention arguments In2 ​​and In3. In the example in Figure 8, in case #2 of decision table 130, argument In1 is 'false', arguments In2 ​​and In3 are arbitrary, and argument Out1 is 'false'. Therefore, the second test case 140 matches case #2 of decision table 130. The search unit 150 stores the search result for the second test case 140 as 'true' in the search result 160.

[0102] Furthermore, suppose there is a third test case 140 in which "if argument In1 is 'true' and argument In2 is 'true', then argument Out1 is 'false'." In the example in Figure 8, in case #3 of decision table 130, argument In1 is 'true', argument In2 is 'true', and argument Out1 is 'false'. Therefore, the third test case 140 matches case #3 of decision table 130 with respect to arguments In1, In2, and Out1. Although the third test case 140 does not mention argument In3, since argument In3 is arbitrary in case #3 of decision table 130, the search unit 150 stores the search result for the third test case 140 as 'true' in the search result 160.

[0103] Suppose there is a fourth test case 140 in which "if argument In1 is 'true', argument In2 is 'false', and the previous value of argument In3 is 'false' and the current value is 'true', then argument Out1 is 'false'." In the example in Figure 8, although arguments In1 to In3 of the fourth test case 140 match those of case #1 in decision table 130, the value of argument Out1 is different. The fourth test case 140 does not match any of the other cases in decision table 130. For this reason, the search unit 150 stores the search result for the fourth test case 140 as 'false' in the search result 160. The search result 'false' means that test case 140 could not be found in decision table 130.

[0104] Suppose there is a fifth test case 140, which is "if argument In1 is 'true', then argument Out1 is 'true'". In the example in Figure 8, the fifth test case 140 partially matches case #1 of decision table 130, and cases #3 and #4 where the value of argument In1 is 'true'. However, the fifth test case 140 does not contain the values ​​of other arguments present in cases #1, #3, and #4 of decision table 130, and the value of argument Out1 is also different from argument Out1 ('false') in cases #3 and #4. Therefore, there is no case in decision table 130 that matches the fifth test case 140, and the search unit 150 stores the search result for the fifth test case 140 as 'false' in the search result 160.

[0105] For example, when the network 113 is actually executed using the argument In of the first test case 140, the argument Out1 is "true," which matches the argument Out1 of the first test case 140. Therefore, the first test case 140 is correctly implemented in the network 113. In this case, the first test case 140 will appear in the decision table 130 created from the same network 113, so the search unit 150 will find "true" when searching for the first test case 140 in the decision table 130. In other words, the search result is equivalent to the first test case 140 being actually executed in the network 113 and being correctly executed. Also, for example, when the network 113 is actually executed using the argument In of the fourth test case 140, the argument Out1 is "true," which does not match the argument Out1 of the fourth test case 140. Therefore, the fourth test case 140 is not correctly implemented in the network 113. In this case, the fourth test case 140 will not appear in the decision table 130 created from the same network 113, and the search unit 150 will return "false" when searching for the fourth test case 140 in the decision table 130. In other words, the search result is equivalent to the fourth test case 140 being actually executed on network 113 and not being executed correctly. The same applies to the second, third, and fifth test cases 140.

[0106] As described above, the test device 1 according to this embodiment 1 creates a decision table 130 from the network 113 that constitutes the sequence program 110, and searches for test cases 140 against the decision table 130. This yields the same result as executing the test cases 140 in the sequence program 110. In this embodiment 1, since it is not necessary to actually run the sequence program 110, the time required for testing can be shortened.

[0107] The test device 1 may output the search results 160 to a display device such as a display. Figure 14 shows an example of the hardware configuration of the test device 1. The test device 1 comprises an input device 21, a computer 22, an external storage device 27, and an output device 28. The computer 22 comprises a CPU (Central Processing Unit) 23, a main memory 24, and an auxiliary storage device 25. The computer 22 substantially executes the procedures of the functional unit (generation unit 120 and search unit 150) of the test device 1 shown in Figure 1. The computer 22 and the external storage device 27 are communicated together via a signal line 26.

[0108] The functions of the generation unit 120 and the search unit 150 shown in Figure 1 are realized by software, firmware, or a combination of software and firmware. The software or firmware is written as a program and stored in the auxiliary storage device 25. The CPU 23 realizes each function by reading and executing the program recorded in the auxiliary storage device 25. These programs can also be said to cause the computer 22 to execute the procedures or methods of the generation unit 120 and the search unit 150.

[0109] Furthermore, some functions of the generation unit 120 and the search unit 150 may be implemented using dedicated hardware, while other functions may be implemented using software or firmware.

[0110] The output device 28 is, for example, a display such as a liquid crystal display device. For example, the search unit 150 causes the search results 160 to be displayed on the output device 28. The search unit 150 may cause the output device 28 to display test cases in which the search result is "true" in a normal manner, and test cases in which the search result is "false" in an emphasized manner. The emphasized manner here includes, for example, a manner in which the search results are displayed in a font size larger than the font size in the normal manner, a manner in which the search results are displayed in a color different from the font color in the normal manner (for example, red), or a manner in which the search results are displayed in a font different from the font in the normal manner (for example, underlined). The search unit 150 also stores the search results 160 in, for example, the main memory 24, the auxiliary memory 25, and the external memory 27, or at least one of them. The generation unit 120 stores the decision table 130 in, for example, the main memory 24, the auxiliary memory 25, and the external memory 27, or at least one of them.

[0111] <Embodiment 2> Figure 15 shows an example of the configuration of the test apparatus 1 according to Embodiment 2. The test apparatus 1 according to Embodiment 2 differs from the test apparatus 1 according to Embodiment 1 in that it has a division unit 900. The sequence program 110 is input to the division unit 900. As described later, the division unit 900 divides the network 113 of the sequence program 110 into a plurality of divided networks to generate a divided sequence program 901.

[0112] Figure 16 shows a first example of a sequence program 110 according to Embodiment 2. In Embodiment 2, the sequence program 110 includes a single network 113, and one network 113 includes a plurality of coils 116. In Figure 16, coils 116A to 116C are shown as the plurality of coils 116. Such a network 113 also conforms to the IEC 61131-3 standard. In the example in Figure 16, the network 113 includes one or more branches 902, and a coil 116 is provided after each branch 902. In the example in Figure 16, three branches 9021, 9022, and 9023 are shown as branches 902. In the example in Figure 16, three contacts 115 are connected horizontally to each other before the branches 902. After each branch 9021 to 9023, at least a coil 116 is included as a connecting element CE. In the example shown in Figure 16, the first coil 116A is included after branch 9021, the second coil 116B is included after branch 9022, and the contact 115 and the third coil 116C are included after branch 9023. After branch 9023, the contact 115 and the third coil 116C are connected horizontally to each other.

[0113] The splitting unit 900 determines, based on the sequence program 110, whether a single network 113 contains multiple coils 116. When the network 113 contains multiple coils 116, the splitting unit 900 generates a split network 908 from the network 113 for each coil 116, and generates a split sequence program 901 containing multiple split networks 908. Figure 17 shows an example of the configuration of the split sequence program 901.

[0114] As a more specific example, the splitting unit 900 determines whether the sequence program 110 includes a branch 902. If a branch 902 is included, the splitting unit 900 generates a split network 908 from the sequence program 110 for each branch 902. For example, the splitting unit 900 generates a split network 908 by horizontally connecting the configuration after each branch 902 to the configuration before the branch 902. In the example in Figure 17, three split networks 908 are shown. The upper first split network 908A corresponds to branch 9021. The splitting unit 900 generates the first split network 908A by horizontally connecting the configuration before branch 9021 and the configuration after branch 9021. The first split network 908A includes the first coil 116A but does not include the second coil 116B and the third coil 116C. The central second split network 908B corresponds to branch 9022. The splitting unit 900 horizontally connects the configuration before branch 9022 and the configuration after branch 9022 to generate a second split network 908B. The second split network 908B includes a second coil 116B but does not include the first coil 116A and the third coil 116C. The lower third split network 908C corresponds to branch 9023. The generating unit 120 horizontally connects the configuration before branch 9023 and the configuration after branch 9023 to generate a third split network 908C. The third split network 908C includes a third coil 116C but does not include the first coil 116A and the second coil 116B. The splitting sequence program 901 includes these multiple split networks 908 (for example, split networks 908A to 908C).

[0115] The generation unit 120 generates a decision table 130 based on the division sequence program 901. The method for generating the decision table 130 is the same as in Embodiment 1. As a result, a decision table 130 is generated for each division network 908.

[0116] The search unit 150 searches the decision table 130 for the test case 140, similar to the first embodiment. This allows the test device 1 to test the sequence program 110.

[0117] Figure 18 shows a second example of a sequence program 110 according to Embodiment 2. In the example in Figure 18, one network 113 includes multiple (two in the figure) coils 116 connected horizontally to each other. Such a network 113 also conforms to the IEC 61131-3 standard. In the example in Figure 18, three contacts 115, a first coil 116A, one contact 115, and a second coil 116B are provided in this order as they move away from the left busbar 111. These are connected horizontally to each other.

[0118] For example, first, the splitting unit 900 determines whether the sequence program 110 includes multiple coils 116 connected horizontally within a single network that does not include branches. If the splitting unit 900 includes multiple coils 116 connected horizontally to each other, it generates a split network 908 for each coil 116 from the sequence program 110 and generates a split sequence program 901 that includes multiple split networks 908. Figure 19 shows an example of the configuration of the split sequence program 901.

[0119] The division unit 900 extracts the configuration from the left busbar 111 to each coil 116 in Figure 18. In the example of Figure 18, the division unit 900 extracts the configuration from the left busbar 111 to the first coil 116A, and this becomes the first division network 908A. The division unit 900 also extracts the configuration from the left busbar 111 to the second coil 116B. If a coil 116 (in this case, the first coil 116A) is included in the middle of this configuration, the division unit 900 deletes the coil 116, and this becomes the second division network 908B.

[0120] In the example in Figure 19, the upper first divided network 908A corresponds to the first coil 116A. The first divided network 908A includes only the configuration prior to the first coil 116A. The second divided network 908B corresponds to the second coil 116B. The second divided network 908B has a configuration obtained by omitting all other coils 116 from the configuration prior to the second coil 116B. The division sequence program 901 includes these multiple divided networks 908 (e.g., divided networks 908A, 908B).

[0121] The generation unit 120 generates a decision table 130 based on the division sequence program 901. For example, the generation unit 120 generates a decision table 130 for each division network 908. The method for generating the decision table 130 is the same as in Embodiment 1.

[0122] The search unit 150 searches the decision table 130 for the test case 140, similar to the first embodiment.

[0123] As described above, when a single network 113 contains multiple coils 116, the test device 1 generates a divided network 908 for each coil 116, generates a decision table 130 based on the divided network 908, and searches for the test case 140 against the decision table 130. Therefore, the same result as executing the test case 140 in the sequence program 110 is obtained. Furthermore, in the second embodiment, since it is not necessary to actually run the sequence program 110, the test device 1 can perform the test in a shorter time.

[0124] <Embodiment 3> Figure 20 shows an example of the configuration of the test apparatus 1 according to Embodiment 3. The test apparatus 1 according to Embodiment 3 differs from the test apparatus 1 according to Embodiment 1 in that it has a normalization unit 910. The normalization unit 910 performs normalization on the sequence program 110 as described later.

[0125] Figure 21 shows a first example of a sequence program 110 according to Embodiment 3. In the example in Figure 21, in one network 113, contacts 115 having arguments In1 to In4 respectively constitute a horizontal-vertical connection HVC. Here, the horizontal-vertical connection HVC is a vertical connection that includes horizontal connections. A horizontal connection is a part that includes a plurality of connection elements CE connected horizontally to each other. Here, "horizontal-vertical connection" and "horizontal connection" are not general terms, but provisional names used to explain the embodiments of this disclosure in an easy-to-understand manner. In the example in Figure 21, the horizontal-vertical connection HVC includes horizontal connections HC1 and HC2. Horizontal connection HC1 includes a contact 115 having argument In1 and a contact 115 having argument In2, and each contact is connected horizontally. Horizontal connection HC2 includes a contact 115 having argument In3 and a contact 115 having argument In4, and each contact is connected horizontally. Horizontal connections HC1 and HC2 are connected vertically to each other.

[0126] The normalization unit 910 normalizes the sequence program 110 when the sequence program 110 includes the horizontal-vertical connector HVC. Specifically, the normalization unit 910 normalizes the horizontal-vertical connector HVC by treating each of the horizontal connectors HC1 and HC2 as an independent network, outputting the evaluation result to a normal coil that takes a temporary variable as an argument, and replacing HC1 and HC2 with a-contacts that take the temporary variable as an argument, thereby generating a normalized sequence program 911. Figure 22 shows an example of the normalized sequence program 911. For example, the normalized sequence program 911 includes a normalized network 918 and dependent networks 916 and 917. The normalized network 918 is a network obtained by replacing each of the horizontal connectors HC1 and HC2 included in the horizontal-vertical connector HVC with a-contacts that take a temporary variable as an argument, which outputs the evaluation result of an independent network. Dependent network 916 is a network obtained by horizontally connecting a normal coil 915, which has a temporary variable for which an evaluation result is output as an argument, to the configuration of horizontal connector HC1. Dependent network 917 is a network obtained by horizontally connecting a normal coil 915, which has a temporary variable for which an evaluation result is output as an argument, to the configuration of horizontal connector HC2.

[0127] As a specific example of processing, the normalization unit 910 first determines whether the sequence program 110 includes a horizontal-vertical connector HVC based on the connection relationships between the connection elements CE of the sequence program 110. When the sequence program 110 includes a horizontal-vertical connector HVC, the normalization unit 910 generates a normalization network 918 and dependent networks 916 and 917. Specifically, the normalization unit 910 connects a normal coil 915 with temporary variable Tmp1 as an argument to the horizontal connector HC1 to generate the upper dependent network 916. The normalization unit 910 also connects a normal coil 915 with temporary variable Tmp2 as an argument to the horizontal connector HC2 to generate the lower dependent network 917.

[0128] Furthermore, the normalization unit 910 generates a normalized network 918 by replacing each horizontal connector HC1 and HC2 included in the horizontal-vertical connector HVC in the network 113 with a contact 913. The normalization unit 910 sets a temporary variable Tmp1 to output the evaluation result of horizontal connector HC1 as the argument of the contact 913 corresponding to horizontal connector HC1, and sets a temporary variable Tmp2 to output the evaluation result of horizontal connector HC2 as the argument of the contact 913 corresponding to horizontal connector HC2. In other words, the argument of the normal coil 915 corresponding to horizontal connector HC1 and the argument of the contact 913 corresponding to horizontal connector HC1 are the same temporary variable Tmp1, and the argument of the normal coil 915 corresponding to horizontal connector HC2 and the argument of the contact 913 corresponding to horizontal connector HC2 are the same temporary variable Tmp2.

[0129] In the example shown in Figure 21, network 113 contains a single horizontal-vertical connector HVC. However, network 113 may also contain multiple horizontal-vertical connector HVCs. In this case, the normalization unit 910 repeatedly performs normalization processing on the normalized network 918 until it no longer contains any horizontal-vertical connector HVCs. This generates one normalized network 918 that does not contain any horizontal-vertical connector HVCs, and multiple dependent networks 916, 917.

[0130] The generation unit 120 generates decision tables 130 based on the normalization sequence program 911. For example, the generation unit 120 generates decision tables 130 for the normalization network 918 and the dependent networks 916 and 917. The method for generating the decision tables 130 is the same as in Embodiment 1. Figure 23 shows another example of the decision table 130. The decision table 130 includes a decision table 933 corresponding to the normalization network 918, a decision table 931 corresponding to the dependent network 916, and a decision table 932 corresponding to the dependent network 917. Decision table 931 includes the temporary variable Tmp1 as an output, decision table 932 includes the temporary variable Tmp2 as an output, and decision table 934 includes the temporary variables Tmp1 and Tmp2 as inputs.

[0131] The search unit 150 searches for the test case 140 against the decision table 130 (including decision tables 931, 932, and 933, and so on) in the same manner as in Embodiment 1. Here, as an example, let's assume that the test case 140 is the case where "if argument In1 is "true", argument In2 is "true", argument In3 is "false", and argument In4 is "false", then argument Out1 is "true". For example, first the search unit 150 searches for the test case 140 against the decision table 931. However, the search unit 150 searches for the input items of each decision table 931 within the test case 140. The search unit 150 finds the condition in one of the decision tables 931 where "argument In1 is "true" and argument In2 is "true"" within the test case 140, and determines the value of the temporary variable Tmp1 at this time. Next, the search unit 150 finds the condition in the other decision table 932 that "argument In3 is false and argument In4 is false" in test case 140, and determines the value of the temporary variable Tmp2 in this case. Then, for example, the search unit 150 replaces arguments In1 and In2 of test case 140 with the temporary variable Tmp1, and replaces arguments In3 and In4 of test case 140 with the temporary variable Tmp2. As a result, the search unit 150 generates the case "if temporary variable Tmp1 is true and temporary variable Tmp2 is false, then argument Out1 is true". The search unit 150 searches for this case in decision table 130 and finds it in decision table 933.

[0132] This allows the search unit 150 to appropriately search the decision table 130 for the test case 140.

[0133] Figure 24 shows a second example of a sequence program 110 according to Embodiment 3. In the example in Figure 24, in one network 113, contacts 115 having arguments In1 to In4 respectively constitute a vertical-horizontal connection VHC. Here, the vertical-horizontal connection VHC is a horizontal connection that includes vertical connections. Here, "vertical-horizontal connection" is not a general term, but a provisional name used to explain the embodiments of this disclosure in an easy-to-understand manner. In the example in Figure 24, the vertical-horizontal connection VHC includes vertical connections VC1 and VC2. Vertical connection VC1 includes a contact 115 having argument In1 and a contact 115 having argument In2, and each contact is connected vertically. Vertical connection VC2 includes a contact 115 having argument In3 and a contact 115 having argument In4, and each contact is connected vertically. Vertical connections VC1 and VC2 are connected horizontally to each other.

[0134] The normalization unit 910 normalizes the sequence program 110 when the sequence program 110 includes the vertical-horizontal connector VHC. Specifically, the normalization unit 910 normalizes the vertical-horizontal connector VHC by treating each of the vertical connectors VC1 and VC2 as an independent network, outputting the evaluation result to a normal coil that takes a temporary variable as an argument, and replacing VC1 and VC2 with these normally open contacts that take the temporary variable as an argument, thereby generating a normalized sequence program 911. Figure 25 shows an example of the normalized sequence program 911. For example, the normalized sequence program 911 includes a normalized network 918 and dependent networks 916 and 917. The normalized network 918 is a network obtained by replacing each of the vertical connectors VC1 and VC2 included in the vertical-horizontal connector VHC with normally open contacts that take a temporary variable as an argument, which outputs the evaluation result of an independent network. The dependent network 916 is a dependent network in which a normal coil 915 is horizontally connected to the vertical connector VC1. The dependent network 917 is a dependent network in which a normal coil 915 is horizontally connected to the vertical connector VC2.

[0135] As an example of specific processing, the normalization unit 910 first determines whether the sequence program 110 includes a vertical-horizontal connection VHC based on the connection relationships between the connection elements CE of the sequence program 110. When the sequence program 110 includes a vertical-horizontal connection VHC, the normalization unit 910 generates a normalization network 918 and dependent networks 916 and 917. The normalization unit 910 generates a dependent network 916 by connecting a normal coil 915 with temporary variable Tmp1 as an argument to the subsequent stage of the vertical connection VC1. The normalization unit 910 generates the lower dependent network 917 by connecting a normal coil 915 with temporary variable Tmp2 as an argument to the subsequent stage of the vertical connection VC2.

[0136] Furthermore, the normalization unit 910 generates a normalized network 918 by replacing each vertical connector VC1 and VC2 included in the vertical-horizontal connector VHC in the network 113 with a contact 913. The normalization unit 910 sets a temporary variable Tmp1 to output the evaluation result of vertical connector VC1 as the argument of the contact 913 corresponding to vertical connector VC1, and sets a temporary variable Tmp2 to output the evaluation result of vertical connector VC2 as the argument of the contact 913 corresponding to vertical connector VC2. In other words, the argument of the normal coil 915 corresponding to vertical connector VC1 and the argument of the contact 913 corresponding to vertical connector VC1 are the same temporary variable Tmp1, and the argument of the normal coil 915 corresponding to vertical connector VC2 and the argument of the contact 913 corresponding to vertical connector VC2 are the same temporary variable Tmp2.

[0137] In the example shown in Figure 25, network 113 contains a single vertical-horizontal connection VHC. However, network 113 may also contain multiple vertical-horizontal connection VHCs. In this case, the normalization unit 910 repeatedly performs normalization processing on the normalized network 918 until it no longer contains any vertical-horizontal connection VHCs. This generates one normalized network 918 that does not contain any vertical-horizontal connection VHCs, and multiple dependent networks 916, 917.

[0138] The generation unit 120 generates a decision table 130 based on the normalization sequence program 911. For example, the generation unit 120 generates decision tables 130 for the normalization network 918 and the dependent networks 916 and 917. The method for generating the decision table 130 is the same as in Embodiment 1. Figure 26 shows another example of the decision table 130. The decision table 130 includes a decision table 933 corresponding to the normalization network 918, a decision table 931 corresponding to the dependent network 916, and a decision table 932 corresponding to the dependent network 917. Decision table 931 includes the temporary variable Tmp1 as an output, decision table 932 includes the temporary variable Tmp2 as an output, and decision table 933 includes the temporary variables Tmp1 and Tmp2 as inputs.

[0139] The search unit 150 searches the decision table 130 for test case 140, similar to the first embodiment. Here, as an example, let's assume that test case 140 is the case where "if argument In1 is 'true', argument In2 is 'true', argument In3 is 'false' and argument In4 is 'false', then argument Out1 is 'false'." For example, first the search unit 150 searches the decision table 931 for test case 140. The search unit 150 finds the condition "argument In1 is 'true' and argument In2 is 'true'" in the decision table 931 and calculates the value of the temporary variable Tmp1 in this case. Next, it finds the condition "argument In3 is 'false' and argument In4 is 'false'" in the decision table 932 and calculates the value of the temporary variable Tmp2 in this case. Then, for example, the search unit 150 replaces the arguments In1 and In2 of test case 140 with the temporary variable Tmp1, and replaces the arguments In3 and In4 of test case 140 with the temporary variable Tmp2. As a result, the search unit 150 generates a case where "if temporary variable Tmp1 is 'true' and temporary variable Tmp2 is 'false', then argument Out1 is 'false'." The search unit 150 searches for this case in the decision table 130 and finds the case in the decision table 933.

[0140] As described above, according to this embodiment 3, the test apparatus 1 generates a normalized sequence program 911 from the sequence program 110 when the sequence program 110 includes at least one of the horizontal-vertical connector HVC and the vertical-horizontal connector VHC. The normalized sequence program 911 does not include either the horizontal-vertical connector HVC or the vertical-horizontal connector VHC. Therefore, the generation unit 120 can generate a decision table 130 (for example, decision tables 931, 932, and 933) from the normalized sequence program 911, similar to embodiment 1. The search unit 150 searches for the test case 140 against the decision table 130. When the search unit 150 searches for decision tables 931 and 932 that include a temporary variable (Tmp) in their output when searching for the test case 140, it then searches for another decision table 933 that includes the same temporary variable in its input. This allows the search unit 150 to appropriately search for the test case 140 against the decision table 130.

[0141] <Embodiment 4> Figure 27 shows an example of the configuration of the test apparatus 1 according to Embodiment 4. The test apparatus 1 according to Embodiment 4 includes an extended generation unit 920 and an extended search unit 922. The extended generation unit 920 is included in the concept of the generation unit 120, but has a function corresponding to the jump described later. The extended search unit 922 is included in the concept of the search unit 150, but has a function corresponding to the jump described later.

[0142] Figure 28 shows an example of a sequence program 110 according to Embodiment 4. In the example in Figure 28, among the multiple networks 113, the network 113 whose network label 114 is "0001:" includes a jump 923. The jump 923 is provided at the end of the network 113. The jump 923 includes a jump label 924. The jump 923 performs the operation described below. That is, when the value of the horizontal connection 117 to the left of the jump 923 is "true", it jumps to the network 113 having the same network label 114 as the jump label 924, and when the value of the horizontal connection 117 to the left is "false", nothing is done.

[0143] In the example in Figure 28, the upper network 113 has network label 114 "0001:", the middle network 113 has network label 114 "0002:", and the lower network 113 has network label 114 "0003:". In the example in Figure 28, the jump label 924 is "0003", so when the value of the horizontal connection 117 to the left of jump 923 is "true", the middle network 113 is not executed and the lower network 113 is executed. On the other hand, when the value of the horizontal connection 117 to the left of jump 923 is "false", the middle network 113 and the lower network 113 are executed in that order.

[0144] The extension generation unit 920 generates an extended decision table 921 from the network 113 containing the jump 923 in the sequence program 110. The extended decision table 921 is a type of decision table 130 and shows the correspondence between the input values ​​and output values ​​of the sequence program 110. However, the output value for the network 113 containing the jump 923 indicates the "enabled / disabled" status of the other networks 113. Here, "enabled" means that the network 113 is executed and its decision table can be evaluated. "Disabled" means that the network 113 is not executed, its decision table is not evaluated, and all evaluation results are "false". Figure 29 shows an example of the extended decision table 921.

[0145] In the example in Figure 28, the upper network 113 has two contacts 115 and a jump 923 connected horizontally. When the extension generation unit 920 detects the jump 923, it sets the "enabled / disabled" status of the skip network, which will be described next, in the extension decision table 921. The skip network is the central network 113 located between the upper network 113, which includes the jump 923, and the lower network 113, which is specified by the jump label 924. In other words, the skip network corresponds to the network that is not executed when the value of the horizontal connection 117 to the left of the jump 923 is "true". The extension generation unit 920 changes the "enabled / disabled" status of the skip network according to the value of the horizontal connection 117 to the left of the jump 923. In the example in Figure 28, the two contacts 115 of the upper network 113 are a-contacts with arguments InA and InB. In this case, when argument InA is "true" and argument InB is "true", "true" is input to jump 923, and the skip network becomes "disabled". In all other cases, the skip network is "enabled".

[0146] Furthermore, the extended generation unit 920 sets the lower network 113 as "enabled" in all cases and configures the extended decision table 921 accordingly.

[0147] Such an extended decision table 921 is also generated in the same manner as in Embodiment 1. However, the leaf corresponding to the jump 923 includes a leaf indicating that the skip network is enabled and a leaf indicating that the skip network is disabled. For example, when the connection element CE is a jump 923, the extended generation unit 920 generates a leaf indicating that the skip network is disabled in step S9 of Figure 9, connects the leaf to the connection edge in step S10, and connects the leaf indicating that the skip network is enabled to the inverted output list in step S11. This generates a decision tree. The extended generation unit 920 generates an extended decision table 921 based on the decision tree. Specifically, similar to Embodiment 1, the extended generation unit 920 creates an extended decision table 921 showing the correspondence between the value of argument In and the value of output Out based on each path and leaf. The extended generation unit 920 sets all networks 113 other than the skip network to "enabled" in the extended decision table 921 corresponding to the network 113 including the jump 923. This generates the extended decision table 921 shown in Figure 29.

[0148] The extended search unit 922 searches the extended decision table 921 (including the decision table 130) for test case 140, similar to the first embodiment. The extended search unit 922 performs the search on the extended decision table 921, taking into account whether the network 113 is "enabled / disabled". As an example, suppose test case 140 is the case where "if argument InA is "true", argument InB is "true", argument In1 is "true", argument In2 is "true", and argument In3 is "true", then argument Out1 is "true". In this case, the extended search unit 922 stores "false" as the search result in search result 160.

[0149] <Embodiment 5> In Embodiments 1 to 4, the generation unit 120 (including the extended generation unit 920; the same applies hereinafter) may generate a plurality of decision tables 130 based on the sequence program 110. For example, if the sequence program 110 includes a plurality of networks 113, the generation unit 120 generates a decision table 130 for each network 113. Alternatively, as in Embodiment 2 or Embodiment 3, the generation unit 120 generates a plurality of networks 113 (including a partitioned network 908, a normalized network 918, and a dependent network 916) from a single network 113, and generates a decision table 130 for each of these networks 113.

[0150] Therefore, in Embodiment 5, the generation unit 120 may generate a variable search table that shows the correspondence between the variables used as arguments In and Out (or temporary variable Tmp) included in each decision table 130 and each decision table 130. The variable search table is used to search for the decision table 130 in which a variable is used, based on the variables used as arguments In and Out (or temporary variable Tmp).

[0151] Figure 30 shows an example of a variable lookup table. In the example in Figure 30, a variable lookup table corresponding to the decision table 130 in Figure 23 or Figure 26 is shown. The variable lookup table shows each variable (argument In, argument Out) included in the decision table 130.

[0152] The search unit 150 (including the extended search unit 922, hereinafter the same) first identifies a table to be searched from among the decision tables 130 based on the variable search table to search for a certain test case 140. Specifically, the search unit 150 identifies a decision table 130 that contains at least one of the variables of the test case 140 as the table to be searched. The search unit 150 then searches for the test case 140 only in the identified decision table 130. This allows the search unit 150 to omit searching for decision tables 130 that do not contain the items of the test case 140. Therefore, the search unit 150 can search for the test case 140 at a faster speed.

[0153] <Embodiment 6> In Embodiments 1 to 5, the sequence program 110 may include a rising edge detection coil and a falling edge detection coil as the coil 116. Therefore, Embodiment 6 will describe the case in which a rising edge detection coil and a falling edge detection coil are applied as the coil 116.

[0154] Figure 31 illustrates an example of a coil 116, specifically a rising edge detection coil and a falling edge detection coil. The coil 116 in Figure 31(a) is a rising edge detection coil. The rising edge detection coil outputs "true" to the argument Var when the previous value of the horizontal connection 117 on the left was "false" and the current value is "true". On the other hand, the rising edge detection coil maintains the value of the argument Var except when the previous value of the horizontal connection 117 on the left is "false" and the current value is "true".

[0155] The coil 116 in Figure 31(b) is a falling edge detection coil. The falling edge detection coil outputs "true" to the argument Var when the previous value of the horizontal connection 117 on the left was "true" and the current value is "false". On the other hand, the falling edge detection coil maintains the value of the argument Var except when the previous value of the horizontal connection 117 on the left is "true" and the current value is "false".

[0156] Next, an example of the specific leaf generation operation for the rising edge detection coil and the falling edge detection coil of the generation unit 120 will be described. The generation unit 120 generates leaf LF from the coil 116. Leaf LF has an expression and possible values ​​for that expression (true, false, or maintain). The expression corresponds to the type and output of the coil 116. "P(Out) = Value" corresponding to the rising edge detection coil indicates that when the value Value is "true," that is, when the previous value of the horizontal connection 117 on the left was "false" and the current value is "true," "true" is output to the argument Out, and when the value Value is "false," the value of the argument Out is maintained. The "N(Out) = Value" corresponding to the falling edge detection coil indicates that when the value Value is "true," that is, when the previous value of the horizontal connection 117 on the left was "true" and the current value is "false," "true" is output to the argument Out, and when the value Value is "false," the value of the argument Out is maintained.

[0157] Figures 32, 33, and 34 are flowcharts showing the decision tree generation operation according to Embodiment 6. The generation unit 120 operates, for example, according to the flowcharts in Figures 10, 32 to 34. Figures 32 to 34 show flowcharts in which processing for cases where coil 116 is a rising edge detection coil and a falling edge detection coil, respectively, is added to the flowchart in Figure 9.

[0158] First, an example of the generation operation for the sequence program 110, which includes a rising edge detection coil, will be described. Figure 35 shows another example of the sequence program 110, Figure 36 shows a part of another example of the decision tree, Figure 37 shows a part of another example of the decision table 130, Figure 38 shows another example of the decision tree, and Figure 39 shows another example of the decision table 130.

[0159] In the example shown in Figure 35, the sequence program 110 has a single network 113. This network 113 includes a normally open contact 500, a normally open contact 510, and a rising edge detection coil 520 as connection elements CE. The normally open contacts 500 and 510 are connected perpendicularly to each other. The vertical connection including the normally open contacts 500 and 510 and the rising edge detection coil 520 are connected horizontally to each other. Argument In1 is set for normally open contact 500, and argument In2 is set for normally open contact 510. Argument Out1 is set for the rising edge detection coil 520.

[0160] The generation unit 120 operates, for example, according to the flowcharts in Figures 10 and 32 to 34. The generation unit 120 clears the connection edge, horizontal connection list and inverted output list (step S1), first acquires the a-contact 500 as the connection element CE (step S2), determines that the connection element CE is a contact 115 (step S3), generates a node 530 corresponding to the a-contact 500 (step S4), and places node 530 as the root node (step S5). The expression for node 530 is "a(In1)" (see also Figure 36).

[0161] Then, in step S6, the generation unit 120 determines whether the connection to the right of the acquired connection element CE (in this case, the a-contact 500) is a horizontal connection 117 or a vertical connection 118. Since the connection to the right of the a-contact 500 is a vertical connection 118, in step S12, the generation unit 120 determines whether the acquired connection element CE (in this case, the a-contact 500) is located at the end of the vertical connection body. In the example of Figure 35, the a-contact 500 is the first connection element CE of the vertical connection body. For this reason, the generation unit 120 determines that the connection element CE is not located at the end, and in step S13, sets the F edge of the generated node ND (in this case, node 530) as the connection edge and adds the T edge of node ND to the horizontal connection list. As a result, the F edge of node 530 is set as the connection edge, and the T edge of node 530 is included in the horizontal connection list.

[0162] The generation unit 120 executes step S2 again. In the example in Figure 35, the generation unit 120 acquires the a-contact 510 in step S2. The generation unit 120 determines that the acquired connection element CE is the contact 115 (step S3) and generates a node 540 corresponding to the a-contact 510 (step S4). The formula for node 540 is "a (In2)" (see also Figure 36). Then, the generation unit 120 connects node 540 to the connection edge (step S5). As a result, node 540 is connected to the F edge of node 530 (see also Figure 36). Next, the generation unit 120 determines that the connection to the right of the acquired a-contact 510 is the vertical connection 118 (step S6) and determines whether the a-contact 510 is located at the end (step S12). In the example shown in Figure 35, since the normally open contact 510 is located at the end of the vertical connection, in step S14, the generation unit 120 sets the T-edge of node 540 as the connection edge and adds the F-edge of node 540 to the inverted output list. As a result, the connection edge is updated from the F-edge of node 530 to the T-edge of node 540, and the inverted output list now includes the F-edge of node 540. The horizontal connection list remains unchanged, so it continues to include the T-edge of node 530.

[0163] As described above, the generation unit 120 generates a decision tree (see Figure 36) for the connection elements CE up to the coil 116.

[0164] The generation unit 120 executes step S2 again. In the example shown in Figure 35, the generation unit 120 acquires the rise detection coil 520 in step S2. The generation unit 120 determines that the acquired connection element CE is the coil 116 (step S3) and generates a leaf 670 corresponding to the rise detection coil 520 (step S9). Specifically, the generation unit 120 generates the leaf 670 by setting the formula "P(Out1)" according to the type of rise detection coil 520, with the value Value set to "true".

[0165] Next, in step S200, the generation unit 120 determines the type of coil of the acquired connection element CE. Specifically, the generation unit 120 determines whether the coil type is a normal coil, a negative coil, a set coil, or a reset coil, or whether the coil type is a rising edge detection coil or a falling edge detection coil. If we introduce the concept of a detection coil, which includes rising edge detection coils and falling edge detection coils, the generation unit 120 determines whether the coil type is a detection coil or not.

[0166] When the coil type is a normal coil, a negative coil, a set coil, or a reset coil, that is, when it is not a detection coil, the generation unit 120 executes steps S10 and later. On the other hand, when the coil type is a rising-point detection coil or a falling-point detection coil, that is, when it is a detection coil, the generation unit 120 executes step S201, which will be described later. In the example of Figure 35, the connecting element CE is a rising-point detection coil 520, so the generation unit 120 determines that the coil type is a detection coil.

[0167] At this stage, the decision tree created by the generation unit 120 is in the state shown in Figure 36. In other words, the decision tree of the connection element CE up to the rise detection coil 520 is in the state shown in Figure 36. The connection edge is the T edge 540T of node 540, and the horizontal connection list includes the T edge 530T of node 530. The inverted output list includes the F edge 540F of node 540. Also, a part of the decision table corresponding to a part of the decision tree in Figure 36 is shown in Figure 37. That is, cases #1, #2, and #3 in Figure 36 exist as paths to the T edge 530T, T edge 540T, and F edge 540F in Figure 34, respectively.

[0168] Here, the rising edge detection coil outputs "true" to argument Out when the previous value of the horizontal connection 117 on the left is "false" and the current value is "true," and maintains the value of argument Out otherwise. In other words, argument Out1 of the rising edge detection coil 520 depends on the previous and current values ​​of the output of the connection element CE up to the rising edge detection coil 520. For this reason, in embodiment 6, as described later, a decision tree including the rising edge detection coil is constructed using a previous value subtree, which represents the previous value, and a current value subtree, which represents the current value.

[0169] Specifically, in step S201, the generation unit 120 copies the decision tree in Figure 36 (i.e., the decision tree of connection elements CE up to the rise detection coil 520) into two copies, one becoming the previous tree and the other the current tree. In the example in Figure 36, nodes 530 and 540 are copied as nodes 600 and 610 of the previous tree, respectively, and are also copied as nodes 620 and 630 of the current tree, respectively (Figure 38, details will be described later). As a result of this copy, the connection edge of the previous tree is the T edge 610T of node 610, the horizontal connection list of the previous tree contains the T edge 600T of node 600, and the inverted output list of the previous tree contains the F edge 610F of node 610. Similarly, the connection edge of the current tree is the T edge 630T of node 630, the horizontal connection list of the current tree contains the T edge 620T of node 620, and the inverted output list of the current tree contains the F edge 630F of node 630.

[0170] Next, in step S202, the generation unit 120 determines whether the coil type is a rising edge detection coil or a falling edge detection coil. If the coil type is a rising edge detection coil, in step S203, the generation unit 120 connects the root node of the current tree to all edges in the inverted output list of the previous tree. In the example of Figure 36, the inverted output list includes the F edge 540F of node 540, so the inverted output list of the previous tree includes the F edge 610F of node 610. In the example of Figure 36, the root node is node 530, so the root node of the current tree is node 620. Therefore, as shown in Figure 38, the generation unit 120 connects node 620 of the current tree to the F edge 610F of node 610 of the previous tree.

[0171] Next, in step S204, the generation unit 120 connects the leaf 670 corresponding to the rise detection coil 520 to the T-edge 630T of the node 630, which is the connecting edge of the tree.

[0172] Next, in step S205, the generation unit 120 determines whether the horizontal connection list is empty. If the horizontal connection list is empty, the generation unit 120 executes the process in step S208, which will be described later. In the example in Figure 36, the horizontal connection list is not empty, so in step S206, the generation unit 120 copies the leaf 670 as many times as there are edges (elements) in the horizontal connection list, and connects these leaves to all the edges in the horizontal connection list of the current tree. In the example in Figure 38, the edge in the horizontal connection list of the current tree is the T edge 620T of node 620, and its element count is 1. Therefore, the generation unit 120 copies the leaf 670 to generate the leaf 660, and connects the leaf 660 to the T edge 620T.

[0173] Next, in step S207, the generation unit 120 copies leaf 670 with the value Value set to "false" for the number of edges (elements) included in the horizontal connection list, and connects these leaves to all the edges included in the horizontal connection list of the previous tree. Note that when the value Value is "false", the argument Out1 is "maintained" as described above. In the example in Figure 38, the edge included in the horizontal connection list of the previous tree is the T edge 600T of node 600, and its number of elements is 1. Therefore, the generation unit 120 copies leaf 670 with the value Value set to "false" to generate one leaf 640, and connects this leaf 640 to the T edge 600T.

[0174] Next, in step S208, the generation unit 120 copies leaf 670 with the value Value set to "false" as many times as there are connected edges in the previous tree and all the edges in the inverted output list of the current tree, and connects these leaves to all the connected edges in the previous tree and all the edges in the inverted output list of the current tree. In the example in Figure 38, the connected edges in the previous tree are the T edge 610T of node 610, and the edges included in the inverted output list of the current tree are the F edge 630F of node 630, and there are 2 of them. For this reason, the generation unit 120 copies leaf 670 with the value Value set to "false" to generate two leaves (leaf 650 and leaf 680), connects leaf 650 to T edge 610T, and connects leaf 680 to F edge 630F.

[0175] As described above, the generation unit 120 generates the decision tree shown in Figure 38 based on the sequence program 110 shown in Figure 35.

[0176] Next, the generation unit 120 generates the decision table 130 shown in Figure 39 based on the decision tree shown in Figure 38. The generation unit 120 sequentially scans the paths from the root node (node ​​600) to each of the leaves 640, 650, 660, 670, and 680, and associates the value of the argument In of the contact 115 corresponding to node ND in each path with the value of the argument Out of the coil 116 corresponding to leaf LF, thereby generating the decision table 130.

[0177] Here, the path to each of the leaves 640, 650, 660, 670, and 680 scanned by the generation unit 120 is configured as a combination of the decision tables of the previous tree and the current tree shown in Figure 37. That is, in this configuration, the decision table of the current tree is included in case #3 in Figure 37 (where both arguments In1 and In2 are false), which corresponds to a case in the decision table of the previous tree corresponding to the F edge 610F of node 610 where the previous tree and the current tree are connected, and the decision table 130 shown in Figure 39 is generated. Note that the rising edge detection coil maintains the value of argument Out when the value Value is "false". In other words, since the value Value of leaves 640, 650, and 680 is "false", the value of argument Out1 of leaves 640, 650, and 680 is "maintained". Therefore, the value of argument Out1 in cases #1, #2, and #5 in Figure 39, which correspond to leaves 640, 650, and 680, will be "Maintain".

[0178] Next, an example of the generation operation for the sequence program 110, which includes a falling edge detection coil, will be described. Figure 40 shows another example of the sequence program 110, Figure 41 shows another example of the decision tree, and Figure 42 shows another example of the decision table 130.

[0179] In the example shown in Figure 40, the sequence program 110 has a single network 113. This network 113 includes a contact 550, a contact 560, and a falling edge detection coil 570 as connection elements CE. The contacts 550 and 560 are connected perpendicularly to each other. The vertical connection including the contacts 550 and 560 and the falling edge detection coil 570 are connected horizontally to each other. Argument In1 is set for the contact 550, and argument In2 is set for the contact 560. Argument Out1 is set for the falling edge detection coil 570.

[0180] The generation unit 120 operates, for example, according to the flowcharts in Figures 10 and 32 to 34. In the example of Figure 40, the configuration other than the falling edge detection coil 570 is the same as the configuration other than the rising edge detection coil 520 in the example of Figure 35, and the processing up to the point in step S3 when the connection element CE is determined to be a coil is also the same. That is, by the time the connection element CE is determined to be a coil in step S3, the decision tree created by the generation unit 120 is in the same state as in Figure 36, the connection edge is the T edge 540T of node 540 corresponding to the a-contact 560, and the horizontal connection list includes the T edge 530T of node 530 corresponding to the a-contact 550. The inverted output list includes the F edge 540F of node 540 corresponding to the a-contact 560. Also, a part of the decision table corresponding to a part of the decision tree in Figure 36 is shown in Figure 37. In other words, there are cases #1, #2, and #3 in Figure 37, respectively, which are paths leading to the T-edge 530T, T-edge 540T, and F-edge 540F in Figure 36.

[0181] Next, the generation unit 120 executes step S9 to generate a leaf 697 corresponding to the falling edge detection coil 570. Specifically, the generation unit 120 sets the formula "N(Out1)" according to the type of falling edge detection coil 570 with the value Value set to "true" to generate the leaf 697.

[0182] Next, in step S200, the generation unit 120 determines that the coil type is a detection coil. Here, the falling edge detection coil outputs "true" to argument Out when the previous value of the horizontal connection 117 on the left side is "true" and the current value is "false," and maintains the value of argument Out otherwise. For this reason, a decision tree including the falling edge detection coil is constructed using the previous tree, which is a subtree representing the previous value, and the current tree, which is a subtree representing the current value. So, in step S201, the generation unit 120 copies the decision tree in Figure 36 into two copies, one as the previous tree and the other as the current tree. In the example in Figure 36, nodes 530 and 540 are copied as nodes 691 and 692 of the previous tree, respectively, and are also copied as nodes 693 and 694 of the current tree, respectively (Figure 41, details will be described later). Furthermore, the connecting edge of the previous tree is the T edge 692T of node 692, the horizontal connection list of the previous tree includes the T edge 691T of node 691, and the inverted output list of the previous tree includes the F edge 692F of node 692. Similarly, the connecting edge of the current tree is the T edge 694T of node 694, the horizontal connection list of the current tree includes the T edge 693T of node 693, and the inverted output list of the current tree includes the F edge 694F of node 694.

[0183] Next, in step S202, the generation unit 120 determines that the coil type is a falling edge detection coil. Once it determines that the coil type is a falling edge detection coil, in step S209, the generation unit 120 connects the root node of the current tree to the connected edge of the previous tree. In the example in Figure 36, the connected edge is the T edge 540T of node 540, so as shown in Figure 41, the generation unit 120 connects node 693, which is the root node of the current tree, to the T edge 692T of node 692 of the previous tree.

[0184] Next, in step S210, the generation unit 120 copies the leaf 697 as many times as there are edges in the inverted output list, and connects these leaves to all the edges in the inverted output list of the current tree. In the example in Figure 41, the generation unit 120 connects the leaf 697 to the F edge 694F of node 694 included in the inverted output list of the current tree. In the example in Figure 36, since there is only one edge in the inverted output list of the current tree, the leaf 697 generated in step S9 is essentially connected as is.

[0185] Next, in step S211, the generation unit 120 determines whether the horizontal connection list is empty or not. If the horizontal connection list is empty, the generation unit 120 executes the process in step S214, which will be described later. In the example in Figure 36, the horizontal connection list is not empty, so in step S212, the generation unit 120 connects the root node of the current tree to all edges included in the horizontal connection list of the previous tree. In the example in Figure 41, the edge included in the horizontal connection list of the previous tree is the T edge 691T of node 691, so the generation unit 120 connects node 693, which is the root node of the current tree, to it.

[0186] Next, in step S213, the generation unit 120 copies leaf 697 with the value Value set to "false" for every edge included in the horizontal connection list, and connects these leaves to all the edges included in the horizontal connection list of the current tree. In the example in Figure 41, the edge included in the horizontal connection list of the current tree is the T edge 693T of node 693, so the generation unit 120 copies leaf 697 with the value Value set to "false" to generate leaf 695, and connects leaf 695 to the T edge 693T.

[0187] Next, in step S214, the generation unit 120 copies leaf 697 with its value Value set to "false" as many times as there are edges in the previous tree's inverted output list and connected edges in the current tree, and connects these leaves to all edges in the previous tree's inverted output list and connected edges in the current tree. In the example in Figure 41, leaf 698 and leaf 696, which are copies of leaf 697 with its value Value set to "false", are connected to the F edge 692F of node 692 included in the previous tree's inverted output list and to the T edge 694T of node 694, which is a connected edge in the current tree.

[0188] As described above, the generation unit 120 generates the decision tree shown in Figure 41 based on the sequence program 110 shown in Figure 40.

[0189] Next, the generation unit 120 generates the decision table 130 shown in Figure 42 based on the decision tree shown in Figure 41. The generation unit 120 sequentially scans the paths from the root node (node ​​691) to each of the leaves 695, 696, 697, and 698, and associates the value of the argument In of the contact 115 corresponding to node ND in each path with the value of the argument Out of the coil 116 corresponding to leaf LF, thereby generating the decision table 130.

[0190] Here, the paths leading to each of the leaves 695, 696, 697, and 698 scanned by the generation unit 120 are configured by combining the decision tables of the previous tree and the current tree shown in Figure 37. That is, in this configuration, the decision table of the current tree is included in each of the cases in the decision table of the previous tree corresponding to the T edge 691T of node 691 and the T edge 692T of node 692 in Figure 37, namely Case #1 (argument In1 is true) and Case #2 (argument In1 is false and argument In2 is true), and the decision table 130 shown in Figure 42 is generated. The falling edge detection coil maintains the value of argument Out when the value Value is "false". Therefore, the value of argument Out1 in cases #1 and #4 of Figure 42, which corresponds to leaf 695, the value of argument Out1 in cases #2 and #5 of Figure 42, which corresponds to leaf 696, and the value of argument Out1 in case #7 of Figure 42, which corresponds to leaf 698, are "maintained".

[0191] <Other Modifications> The generation unit 120 (including the extended generation unit 920, the same applies hereinafter) and the search unit 150 (including the extended search unit 922, the same applies hereinafter) described above can be realized by the processing circuit 81 shown in Figure 43. That is, the processing circuit 81 comprises a generation unit 120 that generates a decision table 130 from a sequence program 110, and a search unit 150 that searches for test cases 140 against the decision table 130. Dedicated hardware may be applied to the processing circuit 81, or a processor that executes a program stored in memory may be applied. Examples of processors include central processing units, processing units, arithmetic units, microprocessors, microcomputers, and DSPs (Digital Signal Processors).

[0192] If the processing circuit 81 is dedicated hardware, it may be, for example, a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a combination thereof. Each function of the generation unit 120 and the search unit 150 may be implemented by a circuit with distributed processing circuits, or the functions of each unit may be implemented together by a single processing circuit.

[0193] When the processing circuit 81 is a processor, the functions of the generation unit 120 and the search unit 150 are realized in combination with software, etc. The software, etc. may include, for example, software, firmware, or both. The software, etc. is written as a program and stored in memory. As shown in Figure 44, the processor 82 applied to the processing circuit 81 realizes the functions of each unit by reading and executing a program stored in memory 83, which functions as a work memory connected via bus 84. That is, the test device 1 includes memory 83 for storing a program that, when executed by the processing circuit 81, will ultimately execute the steps of creating a decision table 130 from a sequence program 110 and searching for a test case 140 against the decision table 130. In other words, this program can be said to cause the computer to execute the procedures and methods of the generation unit 120 and the search unit 150. Here, memory 83 may be, for example, non-volatile or volatile semiconductor memory such as RAM (Random Access Memory), ROM (Read Only Memory), flash memory, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), HDD (Hard Disk Drive), magnetic disk, flexible disk, optical disk, compact disk, minidisc, DVD (Digital Versatile Disc), their drive devices, or any storage medium used in the future.

[0194] The above describes a configuration in which the functions of the generation unit 120 and the search unit 150 are realized by either hardware or software. However, this is not the only configuration; some parts of each function unit may be realized by dedicated hardware, and other parts by software. For example, the generation unit 120 can be realized by a processing circuit 81 as dedicated hardware, while the other functions can be realized by a processing circuit 81 as a processor 82 reading and executing a program stored in memory 83.

[0195] As described above, the processing circuit 81 can realize each of the above-mentioned functions by hardware, software, or a combination thereof.

[0196] Furthermore, it is possible to freely combine each embodiment, or to modify or omit each embodiment as appropriate.

[0197] The various aspects of this disclosure are summarized below as an appendix.

[0198] (Note 1) A test apparatus for testing a sequence program, comprising a search unit that searches a decision table containing the input and output values ​​of the sequence program, which is generated from the sequence program, for test cases containing input and output values ​​that the sequence program should satisfy, and outputs the search results.

[0199] (Note 2) A test apparatus as described in (Note 1), further comprising a generation unit that generates the decision table from the sequence program.

[0200] (Note 3) A test apparatus as described in (Note 1) or (Note 2), further comprising a division unit in the sequence program that divides a network including a first coil and a second coil into a first divided network including the first coil but not the second coil, and a second divided network including the second coil but not the first coil.

[0201] (Note 4) A test apparatus according to any one of (Note 1) to (Note 3), further comprising a normalization unit that normalizes a horizontal-vertical connection including a horizontal connection having a plurality of contacts connected horizontally to each other into a vertical connection in which the horizontal connection is considered as a single contact, or a vertical-horizontal connection including a vertical connection having a plurality of contacts connected vertically to each other into a horizontal connection in which the vertical connection is considered as a single contact.

[0202] (Note 5) A test apparatus according to any one of (Note 1) to (Note 4), wherein the generation unit creates an extended decision table from the network including jumps in the sequence program, and the search unit also searches for the test case against the extended decision table.

[0203] (Note 6) A test method for testing a sequence program, the method comprising searching for test cases that include input values ​​and output values ​​that the sequence program should satisfy against a decision table generated from the sequence program that includes the input values ​​and output values ​​of the sequence program, and outputting the search results.

[0204] (Note 7) A test program for causing a computer to function as a test device, which causes the computer to perform a procedure of searching for test cases that include input values ​​and output values ​​that a sequence program should satisfy against a decision table containing the input values ​​and output values ​​of the sequence program, which is generated from the sequence program, and outputting the search results.

[0205] 1 Test device, 120 generation unit, 150 search unit, 900 division unit, 910 normalization unit, 920 generation unit (extended generation unit), 922 search unit (extended search unit).

Claims

1. A test apparatus for testing a sequence program, comprising a search unit that searches a decision table containing the input and output values ​​of the sequence program, generated from the sequence program, for test cases containing input and output values ​​that the sequence program should satisfy, and outputs the search results.

2. The test apparatus according to claim 1, further comprising a generation unit that generates the decision table from the sequence program.

3. The test apparatus according to claim 1 or 2, further comprising a division unit in the sequence program that divides a network including a first coil and a second coil into a first divided network including the first coil but not the second coil, and a second divided network including the second coil but not the first coil.

4. A test apparatus according to any one of claims 1 to 3, further comprising a normalization unit that normalizes a horizontal-vertical connection including a horizontal connection having a plurality of contacts connected horizontally to each other into a vertical connection in which the horizontal connection is considered as a single contact, or a vertical-horizontal connection including a vertical connection having a plurality of contacts connected vertically to each other into a horizontal connection in which the vertical connection is considered as a single contact.

5. The test apparatus according to claim 2, wherein the generation unit creates an extended decision table from the network of the sequence program including jumps, and the search unit also searches for the test cases against the extended decision table.

6. A test method for testing a sequence program, comprising searching for test cases that include input and output values ​​that the sequence program should satisfy against a decision table generated from the sequence program that includes the input and output values ​​of the sequence program, and outputting the search results.

7. A test program for causing a computer to function as a test device, the test program causing the computer to perform a procedure of searching for test cases, which include input and output values ​​that a sequence program should satisfy, against a decision table containing the input and output values ​​of the sequence program, which is generated from the sequence program, and outputting the search results.