WO2015139755A1 - Method and engineering system for verifying an automation program - Google Patents

Method and engineering system for verifying an automation program Download PDF

Info

Publication number
WO2015139755A1
WO2015139755A1 PCT/EP2014/055624 EP2014055624W WO2015139755A1 WO 2015139755 A1 WO2015139755 A1 WO 2015139755A1 EP 2014055624 W EP2014055624 W EP 2014055624W WO 2015139755 A1 WO2015139755 A1 WO 2015139755A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
formula
automation
cpi
instructions
Prior art date
Application number
PCT/EP2014/055624
Other languages
German (de)
French (fr)
Inventor
Martin Richard NEUHÄUSSER
Thomas Trenner
Sylvia REICHARDT
Original Assignee
Siemens Aktiengesellschaft
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Siemens Aktiengesellschaft filed Critical Siemens Aktiengesellschaft
Priority to PCT/EP2014/055624 priority Critical patent/WO2015139755A1/en
Publication of WO2015139755A1 publication Critical patent/WO2015139755A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation

Definitions

  • the present invention relates to a method for verifying an automation program for automation ⁇ assurance system by determining a predicate logic first formula of the automation program with a Recheneinrich ⁇ tung, determining a predicate logic second formula of undesirable behavior of the automation system with the computing device, ANDing the first and second Formula with the computing device to a total formula and testing with a test device, whether the overall formula is true under at least one condition.
  • the present invention relates to a corresponding engineering system for verifying an automation program.
  • industrial to take are embedded systems that are programmed by programming languages according to IEC 61131-3 out specific reasoning tasks Steue ⁇ .
  • a verification tool is created, which checks ⁇ fully automated by means of a formal predetermined characteristic the code fragment to be tested. This can save costs be reduced in the system test, the quality of the resulting code is improved and costs due to errors in operation (eg due to errors overlooked in the system test) can be reliably avoided.
  • the object of the present invention is thus to provide a method with which it is possible to investigate an automation program for an automation system for undesired behavior.
  • an engineering system is to be provided with which such a verification is possible.
  • this method is achieved by a drive Ver ⁇ for verifying an automation program by for an automation system
  • the invention provides a
  • a computing device for determining a predicate-logical first formula of the automation program, for determining a predicate-logical second formula of undesired behavior of the automation system, and for ANDing the first and second formulas into an overall formula
  • the computing device is designed so that only those instructions are taken into account for each program step in the first formula, based on the
  • the invention thus makes it possible, in the search for conditions for undesired behavior of the automation program or of the automation system, to use a graph model with which only those instructions are analyzed which are actually achieved in the individual sequence steps of the automation program.
  • the number of instructions to be checked is drastically reduced, in particular in the case of automation programs.
  • automation programs usually have no loops or branches, so that in each workflow step, not all instructions of each Pro ⁇ must be checked program branch.
  • due to the previ ⁇ ously cyclical execution models of PLC programs usually only one or very few instructions are to be checked in each execution step.
  • one of the instructions may relate to an engine speed of the automation system. This makes it possible to check whether the automation program controls the automation system to an undesirably high engine speed.
  • one of the instructions may relate to an angle of a controller or encoder of the automation system. This makes it possible to check, for example, whether a swivel arm of the automation system pivots into a prohibited or safety-relevant area.
  • the automation program is a program for a programmable logic controller.
  • PLC programs are usually given purely sequential processes. For example, in one step, a sensor detects an engine speed, and in a second step, this engine speed is used to control another component.
  • sequential processes ie if there are no loops, the optimization according to the invention can be most benefited by a graph model of the instructions.
  • path information for each instruction of the automation program is determined for determining the first formula, and the path information is the set of step numbers in which the respective instruction can be reached in the automation program is.
  • the path information thus provides for an instruction the information in which steps this information is reached. Conversely, it can be immediately deduced from the path information which instructions can be reached in a certain step. This results in the optimization that not all instructions must be checked.
  • Unwanted behavior of the automation system may be visualized by a visualization device if the overall formula is true under the at least one condition. By checking the truth of the overall formula can be targeted manner thereon so that the automation program and the automation system displays an undesirable behavior, which can then be visually ei ⁇ nem operator negotiate to correct the Automatmaschinespro ⁇ program accordingly.
  • An engineering system for creating automation programs can be designed in such a way that it contains a Veri ⁇ fikationstool or verification tool.
  • the engineering system can then be an automatic code verification, for example, for a PLC program after the
  • a project or program PRO is provided ⁇ means of the engineering system.
  • This PRO program undergoes fully automated VA verification. For this purpose it is fed to the verification tool VT.
  • VT a desired or expected behavior EXB of the automation program and the automation system verification work ⁇ convincing VT is supplied ⁇ leads.
  • the verification tool now determines whether the Pro ⁇ gram equivalent PRO expected behavior EXB. If that is the case, the verification tool VT is the Informa ⁇ tion "correct" co from. Otherwise, it sends the "incorrect” inco out.
  • a entspre ⁇ sponding error visualization EV follows a visualization device. The presented visualization can be used by an operator to perform an error correction EC.
  • the verification tool VT thus automatically checks VA whether the expected property EXB is fulfilled by the program PRO to be examined. In the positive case, it has been mathematically proven that the PRO program fulfills the EXB property in all cases (ie the result is complete - unlike testing procedures). Otherwise, the property will EXB injured and the verification tool VT gene ⁇ preferably riert a counterexample CEX (see FIG. 2), which is provided for the developer as a diagnostic feedback (eg., In the form of a debugger) to him to assist with troubleshooting or error correction EC.
  • a diagnostic feedback eg., In the form of a debugger
  • FIG. 2 shows the core of the verification method in more detail.
  • the automation program becomes concrete
  • PRO translates into a model MOD in a translator TR.
  • the MOD model is represented in a symbolic So MOORISH model ⁇ a predicate logic formula first set to ⁇ .
  • the expected behavior EXB is converted into a predicate-logical second formula ⁇ by a further formalization tool FW.
  • the formalization generator FG negates the second formula ⁇ - ⁇ .
  • the Formal Deutschensgenerator FG also outputs a test depth k before talking ent ⁇ the number of steps, which are executed by the automation program.
  • solver SOL which serves as a checking device, checks for all steps k whether the predicate logic formulas -i ⁇ and ⁇ individually or their AND operation (overall formula) can be satisfied under at least one condition. If this is not the case, the solver SOL outputs a corresponding information USAT, which means that an undesired behavior in the automation program in all k
  • Steps is not present. Otherwise, if least determines under min- a condition of the Solver SOL that the AND operation of the two predicate logic formulas -, ß, and ⁇ is true, it displays the information satellite from which be ⁇ indicated that occurs in the automation program unexpected behavior , Based on this information, the SAT counterexample CEX is generated, which can be used to modify the Pro ⁇ program PRO.
  • FIG. 3 shows an automation program in the programming language AWL which calculates the largest common divisor of two numbers a and b and places it in the first accumulator.
  • An input arrow EP symbolizes the start of the program.
  • Program sections are labeled 1, 2, 3 and 4. Jump instructions on lines 4 and 13 form a loop structure with a complex number of loop iterations. The following is a proof obligation for the program of FIG.3 without the inventive path analysis and optimization ⁇ tion is represented:
  • ⁇ 2 ⁇ 2, ⁇ 2 , 2 ⁇ 2,3 ⁇ 2 , 4
  • ⁇ 3 ⁇ 3, ⁇ 3,2 ⁇ 3,3 ⁇ 3 , 4
  • ⁇ 4 ⁇ 4, ⁇ 4 ⁇ 2 ⁇ 4 ⁇ 3 ⁇ 4 ⁇ 4
  • denotes a call or a step in the automation program and ⁇ ⁇ ⁇ an instruction in the ith step in the mth program section. It can be seen that all instructions cpi, m are taken into account here for the entire steps ⁇ , so that a matrix is created. With each step and each program section of the matrix is increased by one row and thus the mediatorver ⁇ obligation correspondingly more complex.
  • FIG. 4 shows a graph model of the individual instructions cpi, ⁇ 2 , ⁇ 3 and ⁇ 4. These instructions cpl to ⁇ 4 have the same effect as the program sections al to a4 of FIG. 3. However, the path analysis and optimization according to the invention are used here. This results in the following simplified formulas needed for verification:
  • the first line of these formulas results from the fact that in the first step i
  • i2 ° pt either the instruction ⁇ 2 or the instruction 93 is reached.
  • i3 ° pt either in the case of the loop passage starting from Instruction ⁇ 3 again reaches the instruction cpi or it is jumped starting from the instruction 9 2 to the instruction ⁇ 4 .
  • i4 ° pt after the first loop pass, starting from instruction cpi, either instruction 9 2 or instruction ⁇ 3 is jumped. Another possibility in the fourth step is not.
  • step i i5 ° pt , starting from instruction 9 2, the instruction jumps back to instruction ⁇ 4 in the fourth step or back to instruction cpi on the basis of instruction ⁇ 3 .
  • the formulas can be continued in this way.
  • the size of the formulas is reduced by a factor of 2k, where k is the number of program steps considered.
  • control programs are generally much less complex in their operation. In particular, only very simple loops exist whose iteration number is usually constant and is not dynamically determined as in FIG. The simpler the cyclic program paths in the program, the greater the reduction of the size and complexity of the evidence obligation.
  • Proble ⁇ matics is independent of the particular programming language, in particular, it applies regardless of whether the verification environment in a PLC is used. Yet is their special ⁇ those benefits in automation technology as by the cyclic execution model of today's programmable logic controllers and the fact possess rolling flow graph a very simple and iA acyclic Kont- the resulting time requirements PLC programs.
  • AI ⁇ is the amount of step numbers in which the ith instruction can be achieved in the underlying program. Specifically, this means that 3, 5, .. ⁇ , because the first instruction cpi becomes the first step, after a loop pass in the third step and another
  • the predicate logic formula that formalizes the program semantics in the jth step is restricted to the instructions instr ⁇ for which there is an execution path ⁇ such that instr ⁇ is performed in the jth step.
  • Therein lies the optimization ⁇ tion or reduction: are to formalize Instead each execution step in that all program instructions considered possible, the quantity of candidates can be obtained by the Path analysis are drastically restricted. As a result, only such instructions are discarded that are guaranteed not to come in the j-th step to execute.
  • Static analyzes are known from the field of compiler construction in computer science.
  • the analysis information calculated with the path analysis is in the manner according to the invention in FIG.
  • Compiler construction can not be used because there are no restrictions on the instruction number considered (as in bounded model checking). Furthermore, the presented path analysis for Bounded Model Checking of arbitrary programs can be used in principle, but is generally inefficient due to complex loops and recursions.
  • the Bounded Model Checking can be used as a process, as a PLC forces due to the real-time requirements per execution cycle ⁇ an upper bound on executable instructions and has a cyclical model.
  • PLC programs usually have a simple and linear sequence structure. Therefore, the path analysis as a preliminary analysis for the verification of PLC programs is particularly suitable. In general, the path analysis can bring great benefits for all simple programs .
  • safety modules can be verified that serve to safely monitor a hazardous area in automation systems. This can be verified that the security modules z. B. also ensure that the danger zone is not affected by a machine or plant.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The verification of automation programs is to be configured more efficiently. For this, a first predicate logic formula (Ψ) of the automation program (PRO) and a second predicate logic formula (¬ß) are proposed to determine undesired behaviour of the automation system and to combine these two formulas into one complete AND formula. The complete formula is then examined for truth. To determine the first formula (Ψ), a graph model of instructions (*) of the automation program is used and, for each program step in the first formula, only the respective instructions are considered which can actually be achieved on the basis of the graph model in the respective program step.

Description

Beschreibung description
Verfahren und Engineeringsystem zum Verifizieren eines Method and engineering system for verifying a
Automatisierungsprogramms automation program
Die vorliegende Erfindung betrifft ein Verfahren zum Verifizieren eines Automatisierungsprogramms für ein Automatisie¬ rungssystem durch Ermitteln einer prädikatenlogischen ersten Formel des Automatisierungsprogramms mit einer Recheneinrich¬ tung, Ermitteln einer prädikatenlogischen zweiten Formel von unerwünschtem Verhalten des Automatisierungssystems mit der Recheneinrichtung, UND-Verknüpfen der ersten und zweiten Formel mit der Recheneinrichtung zu einer Gesamtformel und Prü- fen mit einer Prüfeinrichtung, ob die Gesamtformel unter mindestens einer Bedingung wahr ist. Darüber hinaus betrifft die vorliegende Erfindung ein entsprechendes Engineeringsystem zum Verifizieren eines Automatisierungsprogramms. Speicherprogrammierbare Steuerungen (SPS; englisch: PLC = Programmable Logic Control) sind eingebettete Systeme, die durch Programmiersprachen entsprechend der Norm IEC 61131-3 darauf programmiert werden, spezifische industrielle Steue¬ rungsaufgaben zu übernehmen. Logische Fehler in diesen Pro- grammen führen im Allgemeinen zu einem Stillstand der Anlage und können darüber hinaus eine Gefahr für Bedienpersonal und Umwelt darstellen. Sie erzeugen in kurzer Zeit sehr hohe Kosten und sind daher sowohl aufgrund regulatorischer Maßnahmen als auch aus ökonomischen Gründen möglichst auszuschließen. Das geschieht bisher durch Tests, deren Umfang sich je nach Kritikalität der Anlage unterscheidet. Dabei sind Tests mit einem hohen zeitlichen und finanziellen Aufwand verbunden und bleiben immanent unvollständig, da sie die Abwesenheit von Fehlern bis auf trivialen Code nicht nachweisen. Mittels ei- ner Code-Verifikation kann diesem Umstand begegnet werden.The present invention relates to a method for verifying an automation program for automation ¬ assurance system by determining a predicate logic first formula of the automation program with a Recheneinrich ¬ tung, determining a predicate logic second formula of undesirable behavior of the automation system with the computing device, ANDing the first and second Formula with the computing device to a total formula and testing with a test device, whether the overall formula is true under at least one condition. Moreover, the present invention relates to a corresponding engineering system for verifying an automation program. Programmable logic controllers (PLC; English: PLC = Programmable Logic Control), industrial to take are embedded systems that are programmed by programming languages according to IEC 61131-3 out specific reasoning tasks Steue ¬. Logical errors in these programs generally lead to a standstill of the system and can also pose a danger to operating personnel and the environment. They generate very high costs in a short time and are therefore to be excluded as much as possible due to regulatory measures as well as for economic reasons. So far, this has been done by tests whose scope differs depending on the criticality of the system. Testing involves a great deal of time and money and remains inherently incomplete, as it does not prove the absence of errors except for trivial code. This circumstance can be counteracted by means of a code verification.
Hierzu wird ein Verifikationswerkzeug erstellt, welches voll¬ automatisiert anhand einer formal vorgegebenen Eigenschaft das zu prüfende Codefragment prüft. Damit können die Kosten im Systemtest reduziert werden, die Qualität des entstehenden Codes verbessert und Kosten durch Fehler im Betrieb (z. B. durch im Systemtest übersehene Fehler) sicher vermieden werden . For this purpose, a verification tool is created, which checks ¬ fully automated by means of a formal predetermined characteristic the code fragment to be tested. This can save costs be reduced in the system test, the quality of the resulting code is improved and costs due to errors in operation (eg due to errors overlooked in the system test) can be reliably avoided.
Bisherige Werkzeuge zur Systemüberprüfung fokussieren auf die Berechnung von Safety-Eigenschaften (z. B. Zuverlässigkeitswerte) , wohingegen die Verifikation mit Bounded Model Previous tools for system validation focus on the calculation of safety properties (eg reliability values), whereas the verification with Bounded Model
Checking die Erfüllung einer Eigenschaft von SPS-Code mathe¬ matisch nachweist. Die zu prüfende Eigenschaft des SPS-Codes muss zudem nicht zwingend sicherheitsrelevant sein, sondern kann auch zum Nachweis der Funktion eines Algorithmus dienen. Auch im akademischen Bereich sind keine Tools bekannt, die automatisiert logische Korrektheitsnachweise von SPS- Programmen führen können. Gründe dafür sind insbesondere die Komplexität der Verifikation, die dazu führt, dass selbst für kleine SPS-Programme ein algorithmischer Nachweis häufig nicht gelingt (entweder aufgrund des exponentiellen Speicherplatzbedarfs oder der Laufzeit, die exponentiell steigt) . Checking the fulfillment of a property of PLC code math ¬ matically verifies. In addition, the property of the PLC code to be tested does not necessarily have to be security-relevant, but can also serve to prove the function of an algorithm. Even in the academic field, no tools are known that can automatically lead to logical proof of correctness of PLC programs. The reasons for this are in particular the complexity of the verification, which leads to the fact that even for small PLC programs an algorithmic proof often fails (either due to the exponential memory requirement or the runtime, which increases exponentially).
Die Aufgabe der vorliegenden Erfindung besteht somit darin, ein Verfahren bereitzustellen, mit dem es möglich wird, ein Automatisierungsprogramm für ein Automatisierungssystem nach unerwünschtem Verhalten zu untersuchen. Darüber hinaus soll ein Engineeringsystem bereitgestellt werden, mit dem eine derartige Verifikation möglich ist. The object of the present invention is thus to provide a method with which it is possible to investigate an automation program for an automation system for undesired behavior. In addition, an engineering system is to be provided with which such a verification is possible.
Erfindungsgemäß wird dieses Verfahren gelöst durch ein Ver¬ fahren zum Verifizieren eines Automatisierungsprogramms für ein Automatisierungssystem durch According to the invention this method is achieved by a drive Ver ¬ for verifying an automation program by for an automation system
Ermitteln einer prädikatenlogischen ersten Formel des Automatisierungsprogramms mit einer Recheneinrichtung, Ermitteln einer prädikatenlogischen zweiten Formel von unerwünschtem Verhalten des Automatisierungssystems mit der Recheneinrichtung,  Determining a first-order logic first formula of the automation program with a computing device, determining a predicate-logical second formula of undesired behavior of the automation system with the computing device,
UND-Verknüpfen der ersten und zweiten Formel mit der Recheneinrichtung zu einer Gesamtformel und Prüfen mit einer Prüfeinrichtung, ob die Gesamtformel unter mindestens einer Bedingung wahr ist, ANDing the first and second formulas with the computing device into an overall formula and Check with a test device whether the overall formula is true under at least one condition,
wobei in which
zum Ermitteln der ersten Formel mit der Recheneinrichtung ein Graphenmodell von Instruktionen des Automatisierungs¬ programms herangezogen wird und for determining the first formula with the computing device, a graph model of instructions of the automation ¬ program is used and
für jeden Programmschritt in der ersten Formel nur dieje¬ nigen Instruktionen berücksichtigt werden, die anhand des Graphenmodells in dem jeweiligen Programmschritt überhaupt erreichbar sind. only Dieje ¬ Nigen instructions are considered for each program step in the first formula, which are actually reachable from the graph model in the respective program step.
Darüber hinaus wird erfindungsgemäß bereitgestellt ein In addition, the invention provides a
Engineeringssytem zum Verifizieren eines Automatisierungsprogramms für ein Automatisierungssystem mit Engineering system for verifying an automation program for an automation system with
einer Recheneinrichtung zum Ermitteln einer prädikatenlo- gischen ersten Formel des Automatisierungsprogramms, zum Ermitteln einer prädikatenlogischen zweiten Formel von unerwünschtem Verhalten des Automatisierungssystems, sowie zum UND-Verknüpfen der ersten und zweiten Formel zu einer Gesamtformel und  a computing device for determining a predicate-logical first formula of the automation program, for determining a predicate-logical second formula of undesired behavior of the automation system, and for ANDing the first and second formulas into an overall formula and
einer Prüfeinrichtung zum Prüfen, ob die Gesamtformel unter mindestens einer Bedingung wahr ist,  a test device for checking that the overall formula is true under at least one condition,
wobei in which
in der Recheneinrichtung ein Graphenmodell von Instruktionen des Automatisierungsprogramms zum Ermitteln der ersten Formel implementiert ist und  in the computing device, a graph model of instructions of the automation program for determining the first formula is implemented, and
die Recheneinrichtung so ausgebildet ist, dass für jeden Programmschritt in der ersten Formel nur diejenigen Instruktionen berücksichtigt werden, die anhand des  the computing device is designed so that only those instructions are taken into account for each program step in the first formula, based on the
Graphenmodells in dem jeweiligen Programmschritt überhaupt erreichbar sind.  Graphene model in the respective program step are available at all.
In vorteilhafter Weise ermöglicht die Erfindung es also, bei der Suche nach Bedingungen für unerwünschtes Verhalten des Automatisierungsprogramms bzw. des Automatisierungssystems, ein Graphenmodell zu nutzen, mit dem nur diejenigen Instruktionen analysiert werden, die in den einzelnen Ablaufschritten des Automatisierungsprogramms überhaupt erreicht werden. Mit dieser Feststellung der überhaupt möglichen Instruktionen wird die Anzahl der zu überprüfenden Instruktionen insbesondere bei Automatisierungsprogrammen drastisch reduziert. Der Grund hierfür liegt darin, dass Automatisierungsprogramme meist keine Schleifen oder Verzweigungen aufweisen, so dass in jedem Ablaufschritt nicht alle Instruktionen jedes Pro¬ grammzweigs überprüft werden müssen. Aufgrund der vorherr¬ schend zyklischen Ausführungsmodelle von SPS-Pgorammen sind vielmehr in jedem Ausführungsschritt meist nur eine oder sehr wenige Instruktionen zu überprüfen. In an advantageous manner, the invention thus makes it possible, in the search for conditions for undesired behavior of the automation program or of the automation system, to use a graph model with which only those instructions are analyzed which are actually achieved in the individual sequence steps of the automation program. With this determination of the possible instructions, the number of instructions to be checked is drastically reduced, in particular in the case of automation programs. The reason for this is that automation programs usually have no loops or branches, so that in each workflow step, not all instructions of each Pro ¬ must be checked program branch. On the contrary, due to the previ ¬ ously cyclical execution models of PLC programs, usually only one or very few instructions are to be checked in each execution step.
Beispielsweise kann eine der Instruktionen eine Motordrehzahl des Automatisierungssystems betreffen. Dadurch lässt sich überprüfen, ob das Automatisierungsprogramm das Automatisie- rungssystem in eine unerwünscht hohe Motordrehzahl steuert. For example, one of the instructions may relate to an engine speed of the automation system. This makes it possible to check whether the automation program controls the automation system to an undesirably high engine speed.
Alternativ oder zusätzlich kann eine der Instruktionen einen Winkel eines Stellers oder Gebers des Automatisierungssystems betreffen. Damit lässt sich beispielsweise überprüfen, ob ein Schwenkarm des Automatisierungssystems in einen verbotenen bzw. sicherheitsrelevanten Bereich schwenkt. Alternatively or additionally, one of the instructions may relate to an angle of a controller or encoder of the automation system. This makes it possible to check, for example, whether a swivel arm of the automation system pivots into a prohibited or safety-relevant area.
Vorzugsweise ist das Automatisierungsprogramm ein Programm für eine speicherprogrammierbare Steuerung. Wie oben erwähnt, sind bei derartigen SPS-Programmen in der Regel rein sequentielle Abläufe gegeben. Beispielsweise wird in einem ersten Schritt durch einen Sensor eine Motordrehzahl erfasst und in einem zweiten Schritt wird diese Motordrehzahl zur Steuerung einer anderen Komponente herangezogen. Bei derart sequentiel- len Abläufen, wenn also keine Schleifen vorliegen, kann von der erfindungsgemäßen Optimierung durch ein Graphenmodell der Instruktionen am meisten profitiert werden. Preferably, the automation program is a program for a programmable logic controller. As mentioned above, in such PLC programs are usually given purely sequential processes. For example, in one step, a sensor detects an engine speed, and in a second step, this engine speed is used to control another component. With such sequential processes, ie if there are no loops, the optimization according to the invention can be most benefited by a graph model of the instructions.
Besonders vorteilhaft ist, wenn für das Ermitteln der ersten Formel eine Pfadinformation zu jeder Instruktion des Automatisierungsprogramms ermittelt wird, und die Pfadinformation dabei die Menge von Schrittzahlen ist, in denen in dem Automatisierungsprogramm die jeweilige Instruktion erreichbar ist. Die Pfadinformation liefert damit für eine Instruktion die Information, in welchen Schritten diese Information erreicht wird. Umgekehrt kann aus den Pfadinformationen sofort darauf geschlossen werden, welche Instruktionen in einem gewissen Schritt erreicht werden können. Damit ergibt sich die Optimierung, dass nicht alle Instruktionen überprüft werden müssen . It is particularly advantageous if path information for each instruction of the automation program is determined for determining the first formula, and the path information is the set of step numbers in which the respective instruction can be reached in the automation program is. The path information thus provides for an instruction the information in which steps this information is reached. Conversely, it can be immediately deduced from the path information which instructions can be reached in a certain step. This results in the optimization that not all instructions must be checked.
Ein unerwünschtes Verhalten des Automatisierungssystems kann von einer Visualisierungseinrichtung visualisiert werden, wenn die Gesamtformel unter der mindestens einen Bedingung wahr ist. Mit der Überprüfung der Wahrheit der Gesamtformel kann also zielgerichtet darauf geschlossen werden, dass das Automatisierungsprogramm bzw. das Automatisierungssystem ein unerwünschtes Verhalten zeigt, welches sich dann visuell ei¬ nem Bediener vermitteln lässt, um das Automatisierungspro¬ gramm entsprechend zu korrigieren. Unwanted behavior of the automation system may be visualized by a visualization device if the overall formula is true under the at least one condition. By checking the truth of the overall formula can be targeted manner thereon so that the automation program and the automation system displays an undesirable behavior, which can then be visually ei ¬ nem operator negotiate to correct the Automatisierungspro ¬ program accordingly.
Die vorliegende Erfindung wird anhand der beigefügten Zeichnungen näher erläutert, in denen zeigen: The present invention will be further explained with reference to the accompanying drawings, in which:
FIG 1 ein Prinzip der automatischen Code-Verifikation für 1 shows a principle of the automatic code verification for
SPS-Programme ;  PLC programs;
FIG 2 eine Detailbeschreibung des formalen Verifikationsansatzes; 2 shows a detailed description of the formal verification approach;
FIG 3 ein Automatisierungsprogramm mit einer Schleife; 3 shows an automation program with a loop;
und  and
FIG 4 eine Reduktion der Beweisverpflichtung durch Einschränkung auf syntaktisch mögliche Programmpfade. 4 shows a reduction of the obligation of proof by limiting to syntactically possible program paths.
Die nachfolgend näher geschilderten Ausführungsbeispiele stellen bevorzugte Ausführungsformen der vorliegenden Erfindung dar. Ein Engineeringsystem zum Erstellen von Automatisierungsprogrammen kann dahingehend ausgebildet sein, dass es ein Veri¬ fikationstool bzw. Verifikationswerkzeug enthält. In dem Engineeringsystem kann dann eine automatische Code- Verifikation beispielsweise für ein SPS-Programm nach demThe embodiments described in more detail below represent preferred embodiments of the present invention. An engineering system for creating automation programs can be designed in such a way that it contains a Veri ¬ fikationstool or verification tool. In the engineering system can then be an automatic code verification, for example, for a PLC program after the
Schema von FIG 1 durchgeführt werden. Demzufolge wird mittels des Engineeringsystems ein Projekt bzw. Programm PRO bereit¬ gestellt. Dieses Programm PRO wird einer vollautomatischen VA Verifikation unterzogen. Dazu wird es dem Verifikationswerk- zeug VT zugeführt. Gleichzeitig wird dem Verifikationswerk¬ zeug VT ein gewünschtes bzw. erwartetes Verhalten EXB des Automatisierungsprogramms bzw. Automatisierungssystems zuge¬ führt. Das Verifikationswerkzeug ermittelt nun, ob das Pro¬ gramm PRO dem erwarteten Verhalten EXB entspricht. Wenn das der Fall ist, gibt das Verifikationswerkzeug VT die Informa¬ tion „korrekt" co aus. Andernfalls gibt es die Information „inkorrekt" inco aus. In letzterem Fall folgt eine entspre¬ chende Fehlervisualisierung EV durch eine Visualisierungseinrichtung. Die dargebotene Visualisierung kann ein Bediener nutzen, um eine Fehlerkorrektur EC durchzuführen. Scheme of FIG 1 are performed. Accordingly, a project or program PRO is provided ¬ means of the engineering system. This PRO program undergoes fully automated VA verification. For this purpose it is fed to the verification tool VT. At the same time a desired or expected behavior EXB of the automation program and the automation system verification work ¬ convincing VT is supplied ¬ leads. The verification tool now determines whether the Pro ¬ gram equivalent PRO expected behavior EXB. If that is the case, the verification tool VT is the Informa ¬ tion "correct" co from. Otherwise, it sends the "incorrect" inco out. In the latter case, a entspre ¬ sponding error visualization EV follows a visualization device. The presented visualization can be used by an operator to perform an error correction EC.
Das Verifikationswerkzeug VT prüft also vollautomatisch VA, ob die erwartete Eigenschaft EXB durch das zu untersuchende Programm PRO erfüllt wird. Im positiven Fall wurde mathema- tisch bewiesen, dass das Programm PRO die Eigenschaft EXB in allen Fällen erfüllt (d.h. das Ergebnis ist vollständig - im Gegensatz zu Testverfahren) . Im anderen Fall wird die Eigenschaft EXB verletzt und das Verifikationswerkzeug VT gene¬ riert vorzugsweise ein Gegenbeispiel CEX (vgl. FIG 2), das für den Entwickler als diagnostisches Feedback (z. B. in Form eines Debuggers) zur Verfügung gestellt wird, um ihm bei der Fehlersuche bzw. Fehlerkorrektur EC zu assistieren. The verification tool VT thus automatically checks VA whether the expected property EXB is fulfilled by the program PRO to be examined. In the positive case, it has been mathematically proven that the PRO program fulfills the EXB property in all cases (ie the result is complete - unlike testing procedures). Otherwise, the property will EXB injured and the verification tool VT gene ¬ preferably riert a counterexample CEX (see FIG. 2), which is provided for the developer as a diagnostic feedback (eg., In the form of a debugger) to him to assist with troubleshooting or error correction EC.
In FIG 2 ist der Kern des Verifikationsverfahrens detaillier- ter dargestellt. Konkret wird das AutomatisierungsprogrammFIG. 2 shows the core of the verification method in more detail. The automation program becomes concrete
PRO in einem Übersetzer TR zu einem Modell MOD übersetzt. In einem Formelgenerator FG wird das Modell MOD in ein symboli- sches Modell Ψ also eine prädikatenlogische erste Formel um¬ gesetzt. PRO translates into a model MOD in a translator TR. In a formula generator FG, the MOD model is represented in a symbolic So MOORISH model Ψ a predicate logic formula first set to ¬.
Das erwartete Verhalten EXB wird in eine prädikatenlogische zweite Formel ß durch ein weiteres Formalisierungswerkzeug FW umgesetzt. Der Formalisierungsgenerator FG negiert die zweite Formel ß zu -, ß . Der Formalisierungsgenerator FG gibt außerdem eine Prüftiefe k vor, die der Anzahl der Schritte ent¬ spricht, die durch das Automatisierungsprogramm ausgeführt werden. The expected behavior EXB is converted into a predicate-logical second formula β by a further formalization tool FW. The formalization generator FG negates the second formula β - β. The Formalisierungsgenerator FG also outputs a test depth k before talking ent ¬ the number of steps, which are executed by the automation program.
Ein sogenannter Solver SOL, der als Prüfeinrichtung dient, prüft für alle Schritte k, ob die prädikatenlogischen Formeln -i ß und Ψ einzeln bzw. ihre UND-Verknüpfung (Gesamtformel) unter mindestens einer Bedingung erfüllt sein können. Wenn dem nicht so ist, gibt der Solver SOL eine entsprechende In¬ formation USAT aus, was bedeutet, dass ein unerwünschtes Ver¬ halten in dem Automatisierungsprogramm in sämtlichen k A so-called solver SOL, which serves as a checking device, checks for all steps k whether the predicate logic formulas -iβ and Ψ individually or their AND operation (overall formula) can be satisfied under at least one condition. If this is not the case, the solver SOL outputs a corresponding information USAT, which means that an undesired behavior in the automation program in all k
Schritten nicht vorhanden ist. Andernfalls, wenn unter min- destens einer Bedingung der Solver SOL feststellt, dass die UND-Verknüpfung der beiden prädikatenlogischen Formeln -, ß und Ψ wahr ist, gibt er die Information SAT aus, welche be¬ deutet, dass in dem Automatisierungsprogramm unerwartetes Verhalten auftritt. Aufgrund dieser Information SAT wird das Gegenbeispiel CEX generiert, was zum Modifizieren des Pro¬ gramms PRO verwendet werden kann. Steps is not present. Otherwise, if least determines under min- a condition of the Solver SOL that the AND operation of the two predicate logic formulas -, ß, and Ψ is true, it displays the information satellite from which be ¬ indicated that occurs in the automation program unexpected behavior , Based on this information, the SAT counterexample CEX is generated, which can be used to modify the Pro ¬ program PRO.
Bei dieser Verifikation wird also die Semantik jeder Instruktion (d.h. die Art wie der Maschinenzustand durch Ausführen der Instruktion verändert wird) als prädikatenlogische Formel formalisiert. Die einzelnen Formeln werden dann mit der Negation der nachzuweisenden Eigenschaft -, ß konj ugiert und in den sogenannten SMT-Solver SOL gegeben, der nach erfüllenden Belegungen für die entstandene Gesamtformel sucht. Aufgrund der Negation der Eigenschaft beschreibt eine solche erfüllende Belegung (wenn sie existiert) eine Verletzung der zu erwartenden Eigenschaft (EXB) durch das Programm PRO. Im anderen Fall existiert keine erfüllende Belegung. Das bedeutet, dass die Eigenschaft EXB unter allen möglichen Programmausführungen gilt. In this verification, therefore, the semantics of each instruction (ie the way the machine state is changed by executing the instruction) is formalized as a predicate logic formula. The individual formulas are then conjugated with the negation of the property to be detected, and placed in the so-called SMT solver SOL, which searches for satisfying assignments for the resulting overall formula. Due to the negation of the property, such a satisfying occupancy (if it exists) describes a violation of the expected property (EXB) by the program PRO. In the other case, there is no satisfying occupancy. It means that the property EXB is valid among all possible program executions.
Um eine formale Verifikation umzusetzen, ist also die Seman- tik der Sprachelemente des zu prüfenden Programmfragments so¬ wie die zu prüfende Eigenschaft präzise zu formulieren. Beide Aktivitäten werden über ein möglichst automatisiert zu gene¬ rierendes Modell ß und Ψ mit einem Werkzeug (TR, FW und FG) umgesetzt. Im Allgemeinen wächst bei automatisierten Beweis- verfahren die Zeit- und Speicherplatzkomplexität für die Ve¬ rifikation des Modells exponentiell in der Anzahl der Modell¬ variablen (also z. B. der Programmvariablen) und der möglichen Programmverzweigungen. Das heißt, die benötigte Rechenzeit um das Modell gegen die spezifizierte Eigenschaft zu prüfen kann bereits für kleine Programmfragmente so groß sein, dass ein praktischer Einsatz nicht mehr möglich ist. Zusätzlich zur Laufzeit steigt im Allgemeinen der Speicherplatzbedarf ebenfalls exponentiell. Um diesen Anstieg an Re¬ chenzeit und Speicherplatzbedarf einzuschränken, wird erfin- dungsgemäß eine statische Voranalyse beispielsweise des SPS- Programms (im Folgenden „Pfadanalyse" genannt) durchgeführt, die die möglichen Programmpfade bestimmt. Wird diese Informa¬ tion genutzt, kann die eigentliche Verifikation unter Beibe¬ haltung der ursprünglichen Präzision erheblich schneller aus- geführt werden. Die vorliegende Erfindung adressiert diese Problemstellung, indem die Größe des Verifikationsmodells - und damit des Problems, mit dem der Solver konfrontiert wird - durch Einschränken auf die syntaktisch möglichen Programmpfade reduziert wird. To implement a formal verification, so the semantic policy of the language elements of the program fragment to be tested so ¬ to formulate how the property to be tested accurately. Both activities are automated to a possible ß ¬ gene rierendes model and Ψ with a tool (TR, FW and FG) implemented. In general, grows in automated evidence (ie, for. Example, the program variables) process the time and space complexity of the Ve ¬ rifikation the model exponential in the number of model ¬ variable and the possible program branches. This means that the calculation time required to test the model against the specified property can be so great even for small program fragments that practical use is no longer possible. In addition to runtime, disk space requirements generally increase exponentially. To limit this increase to Re ¬ computing time and storage requirements, inventions will dung as a static pre-analysis example of the PLC program (hereinafter, "path analysis" called) performed that determines the possible program paths If this Informa ¬ tion used., The actual verification can . be performed significantly faster off under Beibe ¬ attitude of the original precision the present invention addresses this problem by reducing the size of the verification model - and with which the solver is faced with the problem - is reduced by restricting the syntactically possible program paths.
In FIG 3 ist ein Automatisierungsprogramm in der Programmiersprache AWL abgebildet, das den größten gemeinsamen Teiler zweier Zahlen a und b berechnet und im ersten Akkumulator ablegt. Dabei symbolisiert ein Eingangspfeil EP den Start des Programms. Programmabschnitte sind mit l, 2, 3 und 4 be¬ zeichnet. Sprunganweisungen in den Zeilen 4 und 13 bilden eine Schleifenstruktur mit einer komplexen Anzahl von Schleifeniterationen. Nachfolgend wird eine Beweisverpflichtung für das Programm von FIG 3 ohne die erfindungsgemäße Pfadanalyse und Optimie¬ rung dargestellt:
Figure imgf000010_0001
FIG. 3 shows an automation program in the programming language AWL which calculates the largest common divisor of two numbers a and b and places it in the first accumulator. An input arrow EP symbolizes the start of the program. Program sections are labeled 1, 2, 3 and 4. Jump instructions on lines 4 and 13 form a loop structure with a complex number of loop iterations. The following is a proof obligation for the program of FIG.3 without the inventive path analysis and optimization ¬ tion is represented:
Figure imgf000010_0001
ψ2 = φ2,ΐΛφ2,2Λφ2,3Λφ2,4 ψ2 = φ2, ΐΛφ 2 , 2Λφ2,3Λφ 2 , 4
ψ3 = φ3,ΐΛφ3,2Λφ3,3Λφ3,4 ψ3 = φ3, ΐΛφ3,2Λφ3,3Λφ 3 , 4
ψ4 = φ4,ΐΛφ4ί2Λφ4ί3Λφ4ψ4 = φ4, ΐΛφ4 ί 2Λφ4 ί 3Λφ 4
Figure imgf000010_0002
Figure imgf000010_0002
Dabei bedeutet ψι einen Aufruf bzw. einen Schritt in dem Automatisierungsprogramm und φ±ιΐα eine Instruktion im i-ten Schritt im m-ten Programmabschnitt. Es ist zu erkennen, dass hier für die sämtlichen Schritte ψι sämtliche Instruktionen cpi,m berücksichtigt werden, so dass eine Matrix entsteht. Mit jedem Programmschritt und jedem Programmabschnitt wird die Matrix um eine Zeile vergrößert und damit die Beweisver¬ pflichtung entsprechend komplexer. In this case, ψι denotes a call or a step in the automation program and φ ± ιΐα an instruction in the ith step in the mth program section. It can be seen that all instructions cpi, m are taken into account here for the entire steps ψι, so that a matrix is created. With each step and each program section of the matrix is increased by one row and thus the Beweisver ¬ obligation correspondingly more complex.
In FIG 4 ist ein Graphenmodell der einzelnen Instruktionen cpi, φ2, Φ3 und φ4 dargestellt. Diese Instruktionen cpl bis φ4 sind wirkungsgleich mit den Programmabschnitten al bis a4 von FIG 3. Es wird hier jedoch die erfindungsgemäße Pfadanalyse und Optimierung angewandt. Dadurch ergeben sich die folgenden für die Verifikation benötigten, vereinfachten Formeln: FIG. 4 shows a graph model of the individual instructions cpi, φ 2 , φ3 and φ4. These instructions cpl to φ4 have the same effect as the program sections al to a4 of FIG. 3. However, the path analysis and optimization according to the invention are used here. This results in the following simplified formulas needed for verification:
Ψι°ρ"=φι,ι Ψι ° ρ "= φι, ι
Figure imgf000010_0003
Figure imgf000010_0003
Die erste Zeile dieser Formeln ergibt sich dadurch, dass im ersten Schritt i|riopt nur die Instruktion cpi erreicht werden kann. Im zweiten Schritt i|i2°pt wird entweder die Instruktion Φ2 oder die Instruktion 93 erreicht. Im dritten Schritt i|i3°pt wird entweder im Fall des Schleifendurchgangs ausgehend von Instruktion φ3 wieder die Instruktion cpi erreicht oder es wird ausgehend von der Instruktion 92 auf die Instruktion φ4 gesprungen. Im vierten Schritt i|i4°pt wird nach dem ersten Schleifendurchgang ausgehend von Instruktion cpi entweder auf Instruktion 92 oder Instruktion φ3 gesprungen. Eine andere Möglichkeit im vierten Schritt besteht nicht. Im fünften Schritt i|i5°pt wird ausgehend von Instruktion 92 im vierten Schritt auf Instruktion φ4 oder ausgehend von Instruktion φ3 wieder zurück auf Instruktion cpi gesprungen. Die Formeln kön- nen so fortgesetzt werden. The first line of these formulas results from the fact that in the first step i | ri opt only the instruction cpi can be achieved. In the second step i | i2 ° pt , either the instruction Φ2 or the instruction 93 is reached. In the third step i | i3 ° pt , either in the case of the loop passage starting from Instruction φ 3 again reaches the instruction cpi or it is jumped starting from the instruction 9 2 to the instruction φ 4 . In the fourth step i | i4 ° pt , after the first loop pass, starting from instruction cpi, either instruction 9 2 or instruction φ 3 is jumped. Another possibility in the fourth step is not. In the fifth step i | i5 ° pt , starting from instruction 9 2, the instruction jumps back to instruction φ 4 in the fourth step or back to instruction cpi on the basis of instruction φ 3 . The formulas can be continued in this way.
In dem obigen Beispiel wird die Größe der Formeln um den Faktor 2k verringert, wobei k die Anzahl der betrachteten Programmschritte bedeutet. Zu beachten ist, dass Steuerungspro- gramme im Allgemeinen in ihrem Ablauf viel weniger komplex sind. Insbesondere existieren allenfalls nur sehr einfache Schleifen, deren Iterationsanzahl meist konstant ist und nicht wie in FIG 3 dynamisch bestimmt ist. Je einfacher die zyklischen Programmpfade im Programm sind, desto größer ist die Reduktion der Größe und Komplexität der Beweisverpflichtung . In the above example, the size of the formulas is reduced by a factor of 2k, where k is the number of program steps considered. It should be noted that control programs are generally much less complex in their operation. In particular, only very simple loops exist whose iteration number is usually constant and is not dynamically determined as in FIG. The simpler the cyclic program paths in the program, the greater the reduction of the size and complexity of the evidence obligation.
Es sei explizit darauf hingewiesen, dass die genannte Proble¬ matik unabhängig von der jeweiligen Programmiersprache ist, insbesondere gilt sie unabhängig davon, ob die Verifikation im Umfeld einer SPS eingesetzt wird. Dennoch liegt ihr beson¬ derer Nutzen in der Automatisierungstechnik, da durch das zyklische Ausführungsmodell heutiger speicherprogrammierbarer Steuerungen und den sich daraus ergebenden Zeitanforderungen SPS-Programme einen sehr einfachen und i.A. azyklischen Kont- rollflussgraphen besitzen. It should be explicitly pointed out that the said Proble ¬ matics is independent of the particular programming language, in particular, it applies regardless of whether the verification environment in a PLC is used. Yet is their special ¬ those benefits in automation technology as by the cyclic execution model of today's programmable logic controllers and the fact possess rolling flow graph a very simple and iA acyclic Kont- the resulting time requirements PLC programs.
Sämtliche optimierten Schritte i|riopt, i|r2°pt, ψ30ρΐ-. werden zu ei¬ ner prädikatenlogischen ersten Formel Ψ „verundet" (d.h. UND- verknüpft) . Schließlich wird dann die prädikatenlogische ers¬ te Formel Ψ mit der prädikatenlogischen zweiten Formel -, ß verundet, so dass sich letztlich als Gesamtformel ergibt: ψ1°ΓΛΛψ2ΟΓΛΛψ3 ΟΓΛ...Λ^β Diese Gesamtformel wird in der Prüfeinrichtung bzw. in dem Solver SOL auf Bedingungen untersucht, bei denen sie wahr ist. Wenn dies der Fall sein sollte, liegt - wie oben erläu- tert - ein unerwünschtes Verhalten des Automatisierungspro¬ gramms vor. All optimized steps i | ri opt , i | r2 ° pt , ψ3 0ρΐ -. be "ANDed" to ei ¬ ner predicate logic first formula Ψ (ie AND linked) Finally, the predicate logic ers ¬ te formula Ψ is then reacted with the predicate logic second formula - ANDed ß so that ultimately results in the total formula. ψ 1 ° ΓΛ Λψ2 ΟΓΛ Λψ 3 ΟΓΛ ... Λ ^ β This overall formula is tested in the tester or solver SOL for conditions where it is true. If this is the case, is - as above erläu- tert - an undesirable behavior of the Automatisierungspro ¬ program before.
Kern der Pfadanalyse ist ein zweistufiges Vorgehen, ausge¬ führt auf einer Recheneinheit, wobei ein Modell in Form prä- dikatenlogischen Formeln vorliegt: Core of the path analysis is a two-step approach leads ¬ out on a processing unit, wherein pre- dikatenlogischen formulas, a model in the form:
1. Für jede Programminstruktion instr± wird geprüft, ob instr± in mindestens einem Programmpfad π nach einer gegebe¬ nen Zahl j von Schritten ausgeführt wird. Das Ergebnis dieser Prüfung wird als Analyse- bzw. Pfadinformationen AI± hinterlegt. Damit ist AI± die Menge der Schrittzahlen, in denen im zugrundeliegenden Programm die i-te Instruktion erreicht werden kann. Konkret bedeutet dies, dass
Figure imgf000012_0001
3, 5,..}, denn die erste Instruktion cpi wird beim ersten Schritt, nach einem Schleifendurchgang im dritten Schritt und einem weiteren
1. For each program instruction instr ± it is checked whether instr ± π in at least one program path after a gegebe ¬ NEN number j is performed by steps. The result of this check is stored as analysis or path information AI ±. Thus, AI ± is the amount of step numbers in which the ith instruction can be achieved in the underlying program. Specifically, this means that
Figure imgf000012_0001
3, 5, ..}, because the first instruction cpi becomes the first step, after a loop pass in the third step and another
Schleifendurchgang im fünften Schritt usw. erreicht. Darüber hinaus ist Al2={2, 4, 6,..}, denn die zweite Instruktion cp2 wird im zweiten Schritt, nach einem Schleifendurchgang im vierten Schritt, nach zwei Schleifendurchgängen im sechsten Schritt usw. erreicht. Für die weiteren Pfadinformationen AI± gilt ähnliches. Loop passage in the fifth step, etc. reached. In addition, Al 2 = {2, 4, 6, ..}, because the second instruction cp2 is reached in the second step, after a loop pass in the fourth step, after two loop passes in the sixth step, and so forth. The following path information AI ± is similar.
2. Die prädikatenlogische Formel, die die Programmsemantik im j-ten Schritt formalisiert, wird auf die Instruktionen instr± eingeschränkt, für die es einen Ausführungspfad π gibt, so dass instr± im j-ten Schritt ausgeführt wird. Dies bedeutet, dass alle Pfadinformationen AI± dahingehend untersucht wer¬ den, ob ein bestimmter Schritt ( Schrittzahl ) enthalten ist. Beispielsweise werden alle Pfadinformationen AI± nach der Zahl 5 (also Schritt 5) untersucht. Darin liegt die Optimie¬ rung bzw. Reduktion: Anstatt jeden Ausführungsschritt dadurch zu formalisieren, dass alle Programminstruktionen als möglich erachtet werden, kann die Menge der Kandidaten durch die Pfadanalyse drastisch eingeschränkt werden. Dadurch werden nur solche Instruktionen verworfen, die garantiert nicht im j-ten Schritt zur Ausführung kommen können. Mit der oben erläuterten Pfadanalyse werden bei azyklischen Kontrollflussgraphen polynominelle Reduktionen der Größe der Beweisverpflichtung erzielt (von quadratischer Matrix auf einen Vektor) . Das führt zu erheblichen Effizienzsteigerungen in der Verifikation. Testergebnisse, die eine Geschwindig- keitsverbesserung um den Faktor 10 und höher erreichen, konnten nachgewiesen werden. Die Verifikation von nicht-trivialen SPS-Programmen wird hierdurch überhaupt erst möglich. 2. The predicate logic formula that formalizes the program semantics in the jth step is restricted to the instructions instr ± for which there is an execution path π such that instr ± is performed in the jth step. This means that all the path information AI ± examined to determine who ¬ whether a particular step (step number) is included. For example, all path information AI ± after the number 5 (ie step 5) are examined. Therein lies the optimization ¬ tion or reduction: are to formalize Instead each execution step in that all program instructions considered possible, the quantity of candidates can be obtained by the Path analysis are drastically restricted. As a result, only such instructions are discarded that are guaranteed not to come in the j-th step to execute. With the path analysis explained above, polynomial reductions of the size of the proof commitment are achieved in acyclic control flow graphs (from square matrix to a vector). This leads to significant efficiency gains in verification. Test results that achieved a speed improvement by a factor of 10 or higher could be proven. The verification of non-trivial PLC programs becomes possible in the first place.
Statische Analysen sind aus dem Bereich des Compilerbaus in der Informatik bekannt. Die mit der Pfadanalyse berechnete Analyseinformation ist in der erfindungsgemäßen Art im Static analyzes are known from the field of compiler construction in computer science. The analysis information calculated with the path analysis is in the manner according to the invention in FIG
Compilerbau nicht einsetzbar, da dort keine Beschränkungen der betrachteten Instruktionszahl (wie beim Bounded Model Checking) existiert. Des Weiteren ist die vorgestellte Pfad- analyse für Bounded Model Checking beliebiger Programme zwar prinzipiell einsetzbar, jedoch ist sie dort im Allgemeinen ineffizient aufgrund komplexer Schleifen sowie Rekursionen. Compiler construction can not be used because there are no restrictions on the instruction number considered (as in bounded model checking). Furthermore, the presented path analysis for Bounded Model Checking of arbitrary programs can be used in principle, but is generally inefficient due to complex loops and recursions.
Auf dem Anwendungsgebiet im Bereich der SPS-Programmierung kann das Bounded Model Checking als Verfahren genutzt werden, da ein SPS aufgrund der EchtZeitanforderungen je Ausführungs¬ zyklus eine Oberschranke an ausführbaren Instruktionen erzwingt und ein zyklisches Modell besitzt. Hinzu kommt, dass SPS-Programme im Normalfall eine einfache und lineare Ablauf- struktur aufweisen. Daher ist die Pfadanalyse als Voranalyse für die Verifikation von SPS-Programmen ganz besonders geeignet. Generell kann die Pfadanalyse für alle einfachen Pro¬ gramme hohen Nutzen bringen. In einem konkreten Anwendungsbereich können Sicherheitsbausteine verifiziert werden, die zur sicheren Überwachung eines Gefahrenbereichs in Automatisierungsanlagen dienen. Damit kann verifiziert werden, dass die Sicherheitsbausteine z. B. auch gewährleisten, dass der Gefahrenbereich nicht durch eine Maschine oder Anlage tangiert wird. On the application in the field of PLC programming the Bounded Model Checking can be used as a process, as a PLC forces due to the real-time requirements per execution cycle ¬ an upper bound on executable instructions and has a cyclical model. In addition, PLC programs usually have a simple and linear sequence structure. Therefore, the path analysis as a preliminary analysis for the verification of PLC programs is particularly suitable. In general, the path analysis can bring great benefits for all simple programs . In a specific area of application, safety modules can be verified that serve to safely monitor a hazardous area in automation systems. This can be verified that the security modules z. B. also ensure that the danger zone is not affected by a machine or plant.
Bezugs zeichenliste Reference sign list
PRO Programm PRO program
EC Fehlerkorrektur  EC error correction
EV Fehlervisualisierung  EV error visualization
EXB erwartetes Verhalten  EXB expected behavior
VA vollautomatischen Verifikation VA fully automatic verification
VT VerifikationsWerkzeug VT verification tool
inco Information „inkorrekt" inco information "incorrect"
CO Information „korrekt"  CO information "correct"
MOD Modell  MOD model
ß prädikatenlogische Formel ß predicate logical formula
prädikatenlogische Formel predicate logic formula
Ψ prädikatenlogische Formel α,ι bis a4 Programmabschnitt Ψ predicate logic formula α, ι to a 4 program section
k Prüftiefe k test depth
FW FormalisierungsWerkzeug  FW formalization tool
FG Formalisierungsgenerator FG formalization generator
TR Übersetzer TR translator
SOL Solver  SOL solver
USAT Information  USAT information
SAT Information  SAT information
CEX Gegenbeispiel  CEX counterexample
EP Eingangspfeil  EP input arrow

Claims

Patentansprüche claims
1. Verfahren zum Verifizieren eines Automatisierungsprogramms für ein Automatisierungssystem durch A method for verifying an automation program for an automation system
Ermitteln einer prädikatenlogischen ersten Formel (Ψ) des Automatisierungsprogramms (PRO) mit einer Recheneinrich¬ tung (TR, FW, FG) , Determining a predicate logic first formula (Ψ) of the automation program (PRO) with a Recheneinrich ¬ tion (TR, FW, FG),
Ermitteln einer prädikatenlogischen zweiten Formel von unerwünschtem Verhalten des Automatisierungssystems mit der Recheneinrichtung (TR, FW, FG) ,  Determining a predicate-logical second formula of undesired behavior of the automation system with the computing device (TR, FW, FG),
UND-Verknüpfen der ersten und zweiten Formel mit der Recheneinrichtung (TR, FW, FG) zu einer Gesamtformel und Prüfen mit einer Prüfeinrichtung (SOL) , ob die Gesamtformel unter mindestens einer Bedingung wahr ist,  ANDing the first and second formulas with the computing device (TR, FW, FG) into an overall formula and testing with a test device (SOL), if the overall formula is true under at least one condition,
dadurch gekennzeichnet, dass characterized in that
zum Ermitteln der ersten Formel (Ψ) mit der Recheneinrichtung (TR, FW, FG) ein Graphenmodell von Instruktionen ( cpi bis cp4 ) des Automatisierungsprogramms (PRO) herangezogen wird und for determining the first formula (Ψ) with the computing device (TR, FW, FG) a graph model of instructions (cpi to cp 4 ) of the automation program (PRO) is used and
für jeden Programmschritt (ψι bis ψ4) in der ersten Formel (Ψ ) nur diejenigen Instruktionen ( cpi bis cp4 ) berücksichtigt werden, die anhand des Graphenmodells in dem jeweiligen Programmschritt (ψι bis ψ4) überhaupt erreichbar sind. for each program step (ψι to ψ 4 ) in the first formula (Ψ) only those instructions (cpi to cp 4 ) are taken into account, which are even reachable on the basis of the graph model in the respective program step (ψι to ψ 4 ).
2. Verfahren nach Anspruch 1, wobei eine der Instruktionen ( cpi bis cp4 ) eine Motordrehzahl des Automatisierungssystems betrifft . 2. The method of claim 1, wherein one of the instructions (cpi to cp 4 ) relates to an engine speed of the automation system.
3. Verfahren nach Anspruch 1 oder 2, wobei eine der Instruktionen ( cpi bis cp4 ) einen Winkel eines Stellers oder Gebers des Automatisierungssystems betrifft. 3. The method of claim 1 or 2, wherein one of the instructions (cpi to cp 4 ) relates to an angle of a controller or encoder of the automation system.
4. Verfahren nach einem der vorhergehenden Ansprüche, wobei das Automatisierungsprogramm ein Programm für eine speicherprogrammierbare Steuerung ist. 4. The method according to any one of the preceding claims, wherein the automation program is a program for a programmable logic controller.
5. Verfahren nach einem der vorhergehenden Ansprüche, wobei das Automatisierungsprogramm keine Schleifen aufweist. 5. The method according to any one of the preceding claims, wherein the automation program has no loops.
6. Verfahren nach einem der vorhergehenden Ansprüche, wobei für das Ermitteln der ersten Formel (Ψ) eine Pfadinformation (Ali) zu jeder Instruktion (cpi bis 94) des Automatisierungs- programms ermittelt wird, und die Pfadinformation (Ali) dabei die Menge von Schrittzahlen ist, in denen in dem Automatisierungsprogramm die jeweilige Instruktion (cpi bis 94) erreichbar ist. 6. The method according to any one of the preceding claims, wherein for the determination of the first formula (Ψ) a path information (Ali) for each instruction (cpi to 9 4 ) of the automation program is determined, and the path information (Ali) while the amount of Step numbers is in which the respective instruction (cpi to 9 4 ) can be reached in the automation program.
7. Verfahren nach einem der vorhergehenden Ansprüche, wobei ein unerwünschtes Verhalten des Automatisierungssystems, d.h. wenn die Gesamtformel unter der mindestens einen Bedingung wahr ist, von einer Visualisierungseinrichtung visualisiert wird . A method according to any one of the preceding claims, wherein undesirable behavior of the automation system, i. if the overall formula under the at least one condition is true is visualized by a visualization device.
8. Engineeringsystem zum Verifizieren eines Automatisierungsprogramms für ein Automatisierungssystem mit 8. Engineering system for verifying an automation program for an automation system with
einer Recheneinrichtung (TR, FW, FG) zum Ermitteln einer prädikatenlogischen ersten Formel (Ψ) des Automatisie- rungsprogramms , zum Ermitteln einer prädikatenlogischen zweiten Formel (-iß) von unerwünschtem Verhalten des Automatisierungssystems, sowie zum UND-Verknüpfen der ersten und zweiten Formel zu einer Gesamtformel und  a computing device (TR, FW, FG) for determining a predicate logic first formula (Ψ) of the automation program, for determining a predicate-logical second formula (-iss) of undesired behavior of the automation system, and for ANDing the first and second formulas an overall formula and
einer Prüfeinrichtung (SOL) zum Prüfen, ob die Gesamtfor- mel unter mindestens einer Bedingung wahr ist,  a checking device (SOL) for checking whether the overall formula is true under at least one condition,
dadurch gekennzeichnet, dass characterized in that
in der Recheneinrichtung (TR, FW, FG) ein Graphenmodell von Instruktionen (cpi bis 94) des Automatisierungsprogramms zum Ermitteln der ersten Formel (Ψ) implementiert ist und - die Recheneinrichtung (TR, FW, FG) so ausgebildet ist, in the computing device (TR, FW, FG) a graph model of instructions (cpi to 9 4 ) of the automation program for determining the first formula (Ψ) is implemented and - the computing device (TR, FW, FG) is designed
dass für jeden Programmschritt (ψι bis ψ4) in der ersten Formel (Ψ) nur diejenigen Instruktionen (cpi bis cp4) berücksichtigt werden, die anhand des Graphenmodells in dem je¬ weiligen Programmschritt (ψι bis ψ4) überhaupt erreichbar sind. that, for each program step (ψι to ψ 4) in the first formula (Ψ) are taken into account only those instructions (cpi to cp 4) in which each ¬ weiligen program step on the basis of the graph model (ψι to ψ 4) are actually reachable.
9. Engineeringsystem nach Anspruch 8, das eine Visualisierungseinrichtung aufweist, mit dem ein unerwünschtes Verhal- ten des Automatisierungssystems, d.h. wenn die Gesamtformel unter der mindestens einen Bedingung wahr ist, visualisierbar ist . 9. The engineering system according to claim 8, which has a visualization device with which an undesired behavior th of the automation system, ie if the overall formula under the at least one condition is true, can be visualized.
PCT/EP2014/055624 2014-03-20 2014-03-20 Method and engineering system for verifying an automation program WO2015139755A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/EP2014/055624 WO2015139755A1 (en) 2014-03-20 2014-03-20 Method and engineering system for verifying an automation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/EP2014/055624 WO2015139755A1 (en) 2014-03-20 2014-03-20 Method and engineering system for verifying an automation program

Publications (1)

Publication Number Publication Date
WO2015139755A1 true WO2015139755A1 (en) 2015-09-24

Family

ID=50424201

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/EP2014/055624 WO2015139755A1 (en) 2014-03-20 2014-03-20 Method and engineering system for verifying an automation program

Country Status (1)

Country Link
WO (1) WO2015139755A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11741375B2 (en) 2019-11-15 2023-08-29 International Business Machines Corporation Capturing the global structure of logical formulae with graph long short-term memory

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
ANSGAR FEHNKER ET AL: "Counterexample Guided Path Reduction for Static Program Analysis", 12 February 2010, CONCURRENCY, COMPOSITIONALITY, AND CORRECTNESS, SPRINGER BERLIN HEIDELBERG, BERLIN, HEIDELBERG, PAGE(S) 322 - 341, ISBN: 978-3-642-11511-0, XP019138143 *
PHILIPP KOCH: "Prädikatenlogik -Micromodels of Software", 30 May 2005 (2005-05-30), pages 1 - 11, XP055121398, Retrieved from the Internet <URL:http://www2.cs.uni-paderborn.de/cs/kindler/Lehre/SS05/Logik/PDF/Koch.pdf> [retrieved on 20140603] *
TORSTEN BRESSER: "Validierung und Verifikation (inkl. Testen, Model-Checking und Theorem Proving)", 1 January 2004 (2004-01-01), pages 1 - 24, XP055121395, Retrieved from the Internet <URL:http://www2.cs.uni-paderborn.de/cs/ag-schaefer/Lehre/Lehrveranstaltungen/Seminare/AEIzS/Abgaben/Ausarbeitung/TBresser.pdf> [retrieved on 20140603] *
ZIJIANG YANG ET AL: "Dynamic Path Reduction for Software Model Checking", 16 February 2009, INTEGRATED FORMAL METHODS, SPRINGER BERLIN HEIDELBERG, BERLIN, HEIDELBERG, PAGE(S) 322 - 336, ISBN: 978-3-642-00254-0, XP019114835 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11741375B2 (en) 2019-11-15 2023-08-29 International Business Machines Corporation Capturing the global structure of logical formulae with graph long short-term memory

Similar Documents

Publication Publication Date Title
EP0753168B1 (en) Process for automatic fault diagnosis
DE102020205539A1 (en) Method and device for testing a technical system
EP3709166B1 (en) Method and system for secure signal manipulation for testing integrated security functionalities
EP2447843B1 (en) Method for verifying an application program of an error-free memory-programmable control device and memory-programmable control device for carrying out the method
EP3446185B1 (en) Method and apparatus for designing a production process for producing a product composed of several part products
EP2513796B1 (en) Method for operating a processor
EP2483775A1 (en) Method and arrangement for installing and configuring a computer system
EP2496993B1 (en) Method for securing end-user program changes by means of formal contracts and program verification in automation technology
WO2015139755A1 (en) Method and engineering system for verifying an automation program
EP2902905B1 (en) Method for checking the processing of software
EP2864845B1 (en) Automated reconfiguration of a discrete event control loop
EP2037341B1 (en) Programming system
DE10158317B4 (en) Method for generating and executing a diversified program sequence
DE102009028871A1 (en) Method for testing memory e.g. RAM memory, of function testing system for switching off of electrical vehicle drive, involves executing memory testing routine after cycle of predetermined time intervals
EP3933593A1 (en) Method and computer program for testing a technical system
DE102020206321A1 (en) Method and device for testing a technical system
EP3173928B1 (en) Method and device for checking a component error tree
EP3779619A1 (en) Emerging risks of a technical system
EP3712720B1 (en) Method and device for controlling a technical system using an adaptive simplex architecture
AT511297B1 (en) Method for generating a model of a communication task
DE102010014720A1 (en) Method for verifying code of target program used for software for automotive electronics for engine, involves comparing output test variables corresponding to each program section of target program and program code
DE102008018680A1 (en) Method for supporting a safety-related system
EP3764185A1 (en) Method for testing a system
DE102006020478A1 (en) Security-related software application processing method for automation resolution, involves providing causation/execution-based programming procedure by using security-related programming system component
DE102020206323A1 (en) Method and device for testing a technical system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14714620

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14714620

Country of ref document: EP

Kind code of ref document: A1