Efficient automated translation of procedures in constraint-based language

A technology of automatic translation and constraint programming, applied in the field of automatic translation, can solve the inefficiency of the pure declarative programming model and other problems

Active Publication Date: 2011-10-26
OPTUMSOFT
View PDF3 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, these approaches do not appear to address the inherent inefficiencies of a purely declarative programming model

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Efficient automated translation of procedures in constraint-based language
  • Efficient automated translation of procedures in constraint-based language
  • Efficient automated translation of procedures in constraint-based language

Examples

Experimental program
Comparison scheme
Effect test

example 7

[0128] Example 7 shows how to optimize constraint implementation by providing state—in this case oldPart—in the context associated with the constraint set. In the case of other constraints, such as those specifying that the output be an approximation of the first derivative of the input, the constraint set may require additional states in order to perform the required computation.

[0129] In case of an input specified as a collection, the corresponding internal representation may use the reactor class as the entry type of the collection, including the "next" pointer and key fields required for the collection implementation. That is, reactor classes are used instead of "entry" structures used to implement non-intrusive collection data structures such as hash tables, trees, and linked lists, saving space and additional code compared to using separate entry objects.

[0130] In one embodiment, the internal representation may include a constructor procedure for a constraint set t...

example 1

[0132] The second constraint in Example 1 will be triggered by a change in the reported total. This constraint can be implemented with a similar structure, with a reactor for the report total data member as well as the billing "avgPrice" data member. Thus, an update to the total results in a call to the reactor, which causes the "cost" data member in the report to be recalculated by the implementation of the "onTotal" function.

[0133] As an optimization, an embodiment may implement this constraint set to determine that updating report->total must also update report->cost, and report->total must not be updated by other means. Thus, implementations can dispense with a separate reactor for report->cost driven by changes to report->total, and simply update report cost, as shown in the extended version of "onPart" in Example 8 That maintains part of the function that reports totals.

[0134]

[0135] Here, the last line of the function implementation directly updates the rep...

example 10

[0162] Example 10 Imperative code triggered by an update of total

[0163] --------------------------------------------------

[0164] In one embodiment, the translator can be programmed with knowledge of recognizing and being able to generate expressions for the requirement cases of multi-way constraints, thereby generating errors on input processing when multi-way constraints that cannot be handled are specified. The programmer then needs to implement constraints using a combination of more fundamental constraints and / or imperative programming (if applicable). Since the translator can be programmed to recognize what it can handle (and thus also what it cannot handle), the translator does not produce executions that are incorrect implementations of the specified constraints. Furthermore, since the main purpose herein is to improve the simplicity of imperative programming by adding constraints rather than eliminating all expressive means except constraints, the advantages of ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

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.

Description

technical field [0001] The present invention relates to automatic translation of computer languages. Background technique [0002] In the development of computer technology, various programming paradigms have been developed. Two of these paradigms are imperative programming and declarative programming. Imperative programming entails providing step-by-step imperative instructions (eg set equal to 2, increment c, call procedure f()) that the programmer combines to solve the problem of interest. Declarative programming requires providing top-level information (such as a set of logical constraints to be enforced), often specified in a way that more transparently relates to the problem of interest. Imperative programming tends to provide improved execution performance, but imperative programs can be very complex and difficult to develop and maintain. Declarative programs tend to be relatively easy to develop and maintain, but declarative programming also tends to provide relat...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
CPCG06F9/4496
Inventor D·R·谢里登
Owner OPTUMSOFT
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products