# US 2012/0260238 A1 · Efficient Automated Translation of Procedures in an Constraint-Based Programming Language Implemented with Notification and Callback

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

- Number: US 2012/0260238 A1
- Document ID: US20120260238A1
- Status: Published application
- Kind: A1
- Application number: 13/494,404
- Filed: 2012-06-12
- Published: 2012-10-11
- Earliest claimed: 2008-11-26
- Assignees: OptumSoft, Inc.
- Inventors: David R. Cheriton
- Web page: https://patentgrep.com/patent/US20120260238A1

## CPC

- G06F 9/4496: {Unification in logic programming}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method is provided for translating sets of constraint declarations to imperative code sequences based on defining an instantiatable object per set, inserting calls to a notification callback mechanism on state modification and defining calls in the constraint context as imperative code sequences that, in response to these callbacks, take actions to maintain these constraints. This notification and callback mechanism can also be employed in connection with external events, thereby providing for efficient implementation of event-sequenced imperative procedures in a constraint programming language.

## Claims

### Claim 1

A method for automatically translating input code to a computer executable imperative output representation, the method comprising:
providing an input source program expressed in a programming language that provides for specification of event-sequenced procedures, wherein said input source program includes one or more more event-sequenced procedures specified in accordance with said programming language;
automatically translating said input source program to said computer executable imperative output representation;
wherein said computer executable imperative output representation includes an imperative representation of said one or more event-sequenced procedures with notification and callback code for events, wherein the notification and callback code for events is realized as a listener pattern having callback interfaces associated with object types; and
providing said computer executable imperative output representation as an output.

### Claim 2 (depends on 1)

The method of claim 1, wherein said automatically translating said input source program to said computer executable imperative output representation comprises:
automatically translating said input source program to an intermediate imperative representation, wherein said intermediate imperative representation provides said imperative representation of said one or more event-sequenced procedures with notification and callback code for events; and
automatically translating said intermediate imperative representation to said computer executable imperative output representation.

### Claim 3 (depends on 2)

The method of claim 2:
wherein said programming language provides for declarative specification of constraints;
wherein said input source program includes one or more constraints; and
wherein said computer executable imperative output representation includes an imperative representation of said one or more constraints with notification and callback code for constraints.

### Claim 4 (depends on 1)

The method of claim 1:
wherein said programming language provides for declarative specification of constraints;
wherein said input source program includes one or more constraints; and
wherein said computer executable imperative output representation includes an imperative representation of said one or more constraints with notification and callback code for constraints.

### Claim 5 (depends on 1)

The method of claim 1, wherein said notification and callback code for events comprises callback subroutines for inputs to said event-sequenced procedures, wherein each of said callback subroutines comprises a switch statement having one or more case blocks, and wherein control flow is provided by setting case variables of said switch statements.

### Claim 6 (depends on 5)

The method of claim 5, wherein said control flow includes one or more constructs selected from the group consisting of: conditional wait, return, goto, statement label, and throwing an exception.

### Claim 7 (depends on 5)

The method of claim 5, further comprising combining adjacent case blocks having no external entry points other than the first statement of a first of said adjacent case blocks into a single case block.

### Claim 8 (depends on 1)

The method of claim 1, further comprising providing common code optimization for said notification and callback code for events.

### Claim 9 (depends on 1)

The method of claim 1, wherein a call to one of said event-sequenced procedures is translated to initiation of procedure execution and a conditional wait construct for procedure termination.

### Claim 10 (depends on 1)

The method of claim 1, wherein translation of a conditional wait construct includes providing an initial conditional check and providing for conditional checks driven by variable changes, and wherein if said initial conditional check is true, control transfers directly to the true branch of the conditional checks driven by variable changes.
