# US 2004/0025149 A1 · Relating to software

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2004/0025149 A1
- Document ID: US20040025149A1
- Status: Published application
- Kind: A1
- Application number: 10/396,430
- Filed: 2003-03-26
- Published: 2004-02-05
- Earliest claimed: 2002-03-27
- Assignees: Hewlett-Packard Development Company, L.P.
- Inventors: Dominique Dumont
- Web page: https://patentgrep.com/patent/US20040025149A1

## CPC

- G06F 9/4498: {Finite state machines}
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The present invention provides a method of executing a software program which has a plurality of predetermined states, and can change from one state to another state by executing a function associated with each state. The method comprises determining a preferred execution path comprising a plurality of states linking the current state to an intended target state. The preferred execution path is followed by executing, for each state in the path, a function associated with that state. If it is determined that a deviation has occurred from the calculated preferred path the preferred execution path is recalculated. By enabling the definition of a software program in a declarative way instead of the usual programmatic approach this advantageously the helps the modeling of software systems, especially for complex systems or where the systems have several execution paths. Subsequently, implementation of such systems can be achieved rapidly and with ease. Furthermore, maintenance, amendment and enhancement of the program code is also made easier.

## Claims

### Claim 1

A method of executing a software program having a plurality of predetermined states, and wherein the software program can change from one state to another state by executing a function associated with each state, comprising:
determining a preferred execution path comprising a plurality of states linking the current state to an intended target state;
following the preferred execution path by executing, for each state in the path, a function associated with that state; and
re-determining the preferred execution path when it is determined that a deviation has occurred from the preferred path.

### Claim 2 (depends on 1)

The method of claim 1, wherein the preferred execution path is the path from the current state to the target state calculated using the Floyd-Warshall all-pairs shortest path algorithm.

### Claim 3 (depends on 1)

The method of claim 1, wherein the step of determining further comprises determining a function associated with each of the states in the preferred path execution of which can lead to the software program changing from the current state to the next state in the preferred path.

### Claim 4 (depends on 3)

The method of claim 3, wherein the step of determining further comprises determining a list of results expected as a result of the execution of each of the functions, wherein the state to which the software program changes as a result of execution of the function is dependent on the result of the function.

### Claim 5 (depends on 1)

The method of claim 1, wherein the step of determining the preferred execution path further comprises referencing a predefined definition of the relationship between the different states, functions and return results from the functions.

### Claim 6 (depends on 5)

The method of claim 5, wherein the predefined definition further comprises weighting coefficients which are taken into account when calculating the preferred path.

### Claim 7 (depends on 1)

The method of claim 1, further comprising monitoring the number of times a loop of program states is entered, and stopping the program operation when the number of times exceeds a predefined number, thereby preventing endless loops from being entered.

### Claim 8 (depends on 1)

The method of claim 1, wherein each program state may be exited by executing one of a plurality of functions.

### Claim 9 (depends on 1)

A software program operating in accordance with the method of claim 1.

### Claim 10

A software program comprising:
a definition portion for defining a number of states in which the software program may enter;
a function associated with each of the states;
and associated linkage information indicating the state to which the software program should enter according to the result of an executed function; and
a control logic for controlling the program flow of the software program such that the state of the program changes from a current state to a target state, by:
calculating a preferred path from the current state to the target state; executing functions associated with each step of the path along the preferred path, to thereby arrive at the target state; and
recalculating the preferred path when it is determined that a deviation has occurred from the calculated preferred path.

### Claim 11

A method of executing a software program having a plurality of predetermined states, and wherein the software program can change from one state to another state by executing a function associated with each state, comprising:
determining a preferred execution path comprising a plurality of states linking the current state to an intended target state;
identifying a function associated with each of the states in the preferred path execution of which can lead to the software program changing from the current state to the next state in the preferred path;
following the preferred execution path by executing, for each state in the path, a function associated with that state;
re-determining the preferred execution path when it is determined that a deviation has occurred from the calculated preferred path.

### Claim 12

A method of executing a software program having a plurality of predetermined states, and wherein the software program can change from one state to another state by executing a function associated with each state, comprising:
determining, through use of the Floyd-Warshall all-pairs shortest path algorithm, a preferred execution path comprising a plurality of states linking the current state to an intended target state;
identifying a function associated with each of the states in the preferred path execution of which can lead to the software program changing from the current state to the next state in the preferred path;
following the preferred execution path by executing, for each state in the path, a function associated with that state;
re-determining the preferred execution path when it is determined that a deviation has occurred from the calculated preferred path.

### Claim 13

A method of executing a software program having a plurality of predetermined states, and wherein the software program can change from one state to another state by executing a function associated with each state, comprising:
determining a preferred execution path comprising a plurality of states linking the current state to an intended target state, wherein the determined path is associated with a list of results expected as a result of the execution of each of the functions;
identifying a function associated with each of the states in the preferred path execution of which can lead to the software program changing from the current state to the next state in the preferred path dependent on the result of the function;
following the preferred execution path by executing, for each state in the path, a function associated with that state;
re-determining the preferred execution path when it is determined that a deviation has occurred from the detemined preferred path.
