IP Library › Granted Patent US 7,086,040
Granted Patent B2
US 7,086,040 · App. 09/773,211 · Granted Aug 1, 2006

Method for array shape inferencing for a class of functions in MATLAB

Assignee: Northwestern University
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,086,040
App. No.
09/773,211
Granted
Aug 1, 2006
Kind
B2
Abstract

A method for inferring the shape and dimension of arrays for high-level, array-based languages such as MATLAB is presented. The method uses the algebraic properties that underlie MATLAB's shape semantics and infers the shape that the program expression assumes. In one embodiment, a shape-tuple of the result of a program expression is inferred by creating a shape-tuple expression comprising the shape-tuples of the operands and the shape-tuple operator.

Claims (28)

1. A computer-implemented method for inferring, prior to run-time, an array shape of a result of a program expression of a high-level array-based language, the method comprising:

arranging an extent for each array dimension of each operand of the program expression of the high-level array-based language when the size of at least one of said each operand is unknown into an input shape-tuple of said each operand;

identifying a program operator associated with said each operand in the program expression;

mapping the program operator to an associated shape-tuple operator, wherein the shape-tuple operator is based upon the shape semantics of the program operator; and,

inferring, prior to run-time, an array shape-tuple of the result of the program expression by creating a shape-tuple expression comprising the input shape-tuple of said each operand and the shape-tuple operator.

2. The computer implemented method of claim 1 , wherein inferring, prior to run-time, the array shape-tuple of the result of the program expression by creating the shape-tuple expression comprising the input shape-tuple of said each operand and the shape-tuple operator comprises the steps of:

determining a rank of the resulting shape-tuple; and,

promoting the input shape-tuple of said each operand to an appropriate rank.

3. The computer implemented method of claim 2 , wherein determining the rank of the resulting shape-tuple comprises the steps of:

determining a rank of the input shape-tuple of said each operand;

identifying an operator corresponding to said each operand; and

determining the rank of the shape-tuple of the result of the program expression according to the operator and the rank of the input shape-tuple of said each operand.

4. The computer-implemented method of claim 2 , wherein promoting the input shape-tuple of said each operand to the appropriate rank comprises the steps of:

comparing the rank of the shape-tuple of the result of the program expression to the rank of the input shape-tuple of said each operand;

responsive to the rank of the shape-tuple of the result of the program expression being greater than the rank of the input shape-tuple of said each operand, expanding the input shape-tuple of said each operand to correspond with the rank of the shape-tuple of the result of the program expression; and,

appending trailing extents of the expanded input shape-tuple of said each operand with an appropriate value.

5. The computer-implemented method of claim 4 , further comprising:

responsive to the rank of the shape-tuple of the result of the program expression being less than the rank of the input shape-tuple of said each operand, truncating the input shape-tuple of said each operand corresponding with the rank of the shape-tuple of the result of the program expression.

6. The computer-implemented method of claim 1 , wherein the step of mapping the program operator to the associated shape-tuple operator comprises:

looking up, in a table, the shape-tuple operator corresponding to the program operator.

7. The computer-implemented method of claim 1 , further comprising the step of calculating a shape predicate for the shape-tuple of the result of the program expression.

8. The computer-implemented method of claim 1 , further comprising the steps of:

performing an array conformability check at run-time for a first program expression; and

applying a result of the array conformability check to a second program expression.

9. The computer-implemented method of claim 8 , further comprising the step of:

determining a relationship among the first program expression and the second program expression.

10. The computer-implemented method of claim 1 , further comprising the step of:

preallocating storage for said each operand whose size is statically unknown, based upon the input shape-tuple of said each operand in a loop.

Assignments (2)
CONFIRMATORY LICENSE Recorded Feb 22, 2002
From: NORTHWESTERN UNIVERSITY
To: AIR FORCE, UNITED STATES
Reel/Frame 012635/0484 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 30, 2001
From: JOISHA, PRAMOD G.; BANARJEE, PRITHVIRAJ; SHENOY, NAGARAJ
To: NORTHWESTERN UNIVERSITY
Reel/Frame 011513/0437 →
Continuity (1)
Related Publication 20040019881A1 · Jan 29, 2004