IP Library Granted Patent US 9,633,078
Granted Patent B1
US 9,633,078 · App. 15/282,474 · Granted Apr 25, 2017

Generating identifiers for tuples of recursively defined relations

Inventors: Alexander Eyers-Taylor (Oxford, GB); Max Schaefer (Oxford, GB)
Assignee: Semmle Limited
G06F17/30513G06F17/30321G06F17/30421
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 9,633,078
App. No.
15/282,474
Granted
Apr 25, 2017
Kind
B1
Abstract

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for generating identifiers for tuples of recursively defined relations. One of the methods includes selecting one or more of the recursively defined relations to evaluate. Respective keys are computed for each tuple of any new tuples computed during recursive evaluation. For each key that occurs in a cache of keys, obtaining a tuple for the key from the cache and adding the obtained tuple to a new relation. For each key that does not occur in the cache of keys, generating a new identifier for the key, and adding, to a new relation for each key of each tuple of any keys that do not occur in the cache of keys for a relation, a new tuple comprising (1) elements of the tuple and (2) the new identifier for the key.

Claims (59)

1. A computer-implemented method comprising:

receiving a request to compute identifiers for tuples of one or more recursively defined relations; and

performing the following operations until no new tuples are generated for any of the one or more recursively defined relations:

selecting one or more of the recursively defined relations to evaluate,

performing one or more iterations of recursive evaluation for each of the selected one or more relations,

computing respective keys for each tuple of any new tuples, wherein each key for each tuple is computed using each element of one or more elements of the tuple,

determining, for each key computed for each new tuple, whether the key occurs in a respective cache of keys for a relation of the tuple,

for each key that occurs in the cache of keys, obtaining a tuple for the key from the cache and adding the obtained tuple to a new relation;

for each key that does not occur in the cache of keys, generating a new identifier for the key, adding, to a new relation for each key of each tuple of any keys that do not occur in the cache of keys for a relation, a new tuple comprising (1) elements of the tuple and (2) the new identifier for the key, and adding each key for each new tuple that does not occur in the cache of keys for the relation of the tuple to the cache of keys for the relation.

2. The method of claim 1 , wherein a first recursively defined relation depends on a second recursively defined relation.

3. The method of claim 1 , wherein selecting one or more of the recursively defined relations to evaluate comprises selecting multiple recursively defined relations to evaluate.

4. The method of claim 1 , wherein evaluation of a first recursively defined relation results in additional tuples for a second recursively defined relation.

5. The method of claim 1 , wherein computing respective keys for each tuple of any new tuples comprises computing a same key for all tuples that have equivalent elements.

6. The method of claim 1 , wherein computing respective keys for each tuple of any new tuples comprises computing different keys for any pairs of tuples that have at least one different element.

7. The method of claim 1 , wherein a first recursively defined relation has tuples with N elements, and wherein the new relation for the first recursively defined relation has tuples with N+1 elements.

8. The method of claim 1 , wherein the one or more recursively defined relations define alternative subtypes of an algebraic data type for a database query language.

9. The method of claim 1 , further comprising:

maintaining a different respective cache for all tuples having a same arity.

10. The method of claim 1 , further comprising:

maintaining a different respective cache for each of one or more representation types of tuples, wherein each representation type for a tuple represents individual types of elements of the tuple.

11. The method of claim 1 , wherein receiving the request to compute identifiers for tuples of one or more recursively defined relations comprises receiving an expression in a database query language having an algebraic data type with one or more recursively defined alternative subtypes.

12. A system comprising:

one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising:

receiving a request to compute identifiers for tuples of one or more recursively defined relations; and

performing the following operations until no new tuples are generated for any of the one or more recursively defined relations:

selecting one or more of the recursively defined relations to evaluate,

performing one or more iterations of recursive evaluation for each of the selected one or more relations,

computing respective keys for each tuple of any new tuples, wherein each key for each tuple is computed using each element of one or more elements of the tuple,

determining, for each key computed for each new tuple, whether the key occurs in a respective cache of keys for a relation of the tuple,

for each key that occurs in the cache of keys, obtaining a tuple for the key from the cache and adding the obtained tuple to a new relation;

for each key that does not occur in the cache of keys, generating a new identifier for the key, adding, to a new relation for each key of each tuple of any keys that do not occur in the cache of keys for a relation, a new tuple comprising (1) elements of the tuple and (2) the new identifier for the key, and adding each key for each new tuple that does not occur in the cache of keys for the relation of the tuple to the cache of keys for the relation.

13. The system of claim 12 , wherein a first recursively defined relation depends on a second recursively defined relation.

14. The system of claim 12 , wherein selecting one or more of the recursively defined relations to evaluate comprises selecting multiple recursively defined relations to evaluate.

15. The system of claim 12 , wherein evaluation of a first recursively defined relation results in additional tuples for a second recursively defined relation.

16. The system of claim 12 , wherein computing respective keys for each tuple of any new tuples comprises computing a same key for all tuples that have equivalent elements.

17. The system of claim 12 , wherein computing respective keys for each tuple of any new tuples comprises computing different keys for any pairs of tuples that have at least one different element.

18. The system of claim 12 , wherein a first recursively defined relation has tuples with N elements, and wherein the new relation for the first recursively defined relation has tuples with N+1 elements.

19. The system of claim 12 , wherein the one or more recursively defined relations define alternative subtypes of an algebraic data type for a database query language.

20. The system of claim 12 , wherein the operations further comprise:

maintaining a different respective cache for all tuples having a same arity.

21. The system of claim 12 , wherein the operations further comprise:

maintaining a different respective cache for each of one or more representation types of tuples, wherein each representation type for a tuple represents individual types of elements of the tuple.

22. The system of claim 12 , wherein receiving the request to compute identifiers for tuples of one or more recursively defined relations comprises receiving an expression in a database query language having an algebraic data type with one or more recursively defined alternative subtypes.

23. A computer program product, encoded on one or more non-transitory computer storage media, comprising instructions that when executed by one or more computers cause the one or more computers to perform operations comprising:

receiving a request to compute identifiers for tuples of one or more recursively defined relations; and

performing the following operations until no new tuples are generated for any of the one or more recursively defined relations:

selecting one or more of the recursively defined relations to evaluate,

performing one or more iterations of recursive evaluation for each of the selected one or more relations,

computing respective keys for each tuple of any new tuples, wherein each key for each tuple is computed using each element of one or more elements of the tuple,

determining, for each key computed for each new tuple, whether the key occurs in a respective cache of keys for a relation of the tuple,

for each key that occurs in the cache of keys, obtaining a tuple for the key from the cache and adding the obtained tuple to a new relation;

for each key that does not occur in the cache of keys, generating a new identifier for the key, adding, to a new relation for each key of each tuple of any keys that do not occur in the cache of keys for a relation, a new tuple comprising (1) elements of the tuple and (2) the new identifier for the key, and adding each key for each new tuple that does not occur in the cache of keys for the relation of the tuple to the cache of keys for the relation.

24. The computer program product of claim 23 , wherein a first recursively defined relation depends on a second recursively defined relation.

25. The computer program product of claim 23 , wherein selecting one or more of the recursively defined relations to evaluate comprises selecting multiple recursively defined relations to evaluate.

26. The computer program product of claim 23 , wherein evaluation of a first recursively defined relation results in additional tuples for a second recursively defined relation.

27. The computer program product of claim 23 , wherein computing respective keys for each tuple of any new tuples comprises computing a same key for all tuples that have equivalent elements.

28. The computer program product of claim 23 , wherein computing respective keys for each tuple of any new tuples comprises computing different keys for any pairs of tuples that have at least one different element.

29. The computer program product of claim 23 , wherein a first recursively defined relation has tuples with N elements, and wherein the new relation for the first recursively defined relation has tuples with N+1 elements.

30. The computer program product of claim 23 , wherein the one or more recursively defined relations define alternative subtypes of an algebraic data type for a database query language.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 27, 2020
From: GITHUB SOFTWARE UK LTD.
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 051710/0252 →
CHANGE OF NAME Recorded Dec 11, 2019
From: SEMMLE LTD.
To: GITHUB SOFTWARE UK LTD.
Reel/Frame 052027/0912 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 19, 2017
From: EYERS-TAYLOR, ALEXANDER; SCHAEFER, MAX
To: SEMMLE LIMITED
Reel/Frame 041016/0893 →