Type error checker for type-free or polymorphic computer language
First Claim
1. A system for detecting a run-time type error in a program prior to running the program whose source code being written in a programming language with imperative constructs and parametric polymorphic procedures, comprising:
- an intermediate form translator for translating said source code including imperative constructs and the parametric polymorphic procedures into intermediate form representations;
type representations having predetermined types including a locking type constructor and an unlocking type constructor, said locking type constructors locking said predetermined types for defining predetermined locked types so as to ultimately prevent run-time type errors associated with mutuality in relation to said imperative constructs, said unlocking type constructors unlocking said predetermined locked types; and
a type checker in response to said intermediate form representations and the type representations for checking whether said predetermined locked types are free of substitution with an exact type so that said program will be free of said run-time type error, said exact type excluding a type equal to and more general than said predetermined locked types.
1 Assignment
0 Petitions
Accused Products
Abstract
A system and method for a run-time type error in a program prior to running the program whose source code is written in a programming language with imperative constructs and polymorphic procedures is disclosed. To accomplish the above type error checking, the source code is translated into intermediate form representations by an intermediate form translator. In addition to the intermediate form representations, type representations which include predetermined types such as a locking type constructor and an unlocking type constructor are utilized in detecting the run-time type error. When both intermediate form representations and the type representations are used and the source code is determined to have no run-time type error prior to running the program according to the current invention, it is guaranteed that the program will run without any run-time type error.
-
Citations
65 Claims
-
1. A system for detecting a run-time type error in a program prior to running the program whose source code being written in a programming language with imperative constructs and parametric polymorphic procedures, comprising:
-
an intermediate form translator for translating said source code including imperative constructs and the parametric polymorphic procedures into intermediate form representations; type representations having predetermined types including a locking type constructor and an unlocking type constructor, said locking type constructors locking said predetermined types for defining predetermined locked types so as to ultimately prevent run-time type errors associated with mutuality in relation to said imperative constructs, said unlocking type constructors unlocking said predetermined locked types; and a type checker in response to said intermediate form representations and the type representations for checking whether said predetermined locked types are free of substitution with an exact type so that said program will be free of said run-time type error, said exact type excluding a type equal to and more general than said predetermined locked types. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)
-
-
33. A method of detecting a run-time type error in a program prior to running the program whose source code being written in a programming language with imperative constructs and parametric polymorphic procedures, comprising the steps of:
-
a. providing type representations hating predetermined types including a locking type constructor and an unlocking type constructor, said locking type constructors locking said predetermined types for preventing run-time type error associated with mutuality in relation to said imperative constructs, said unlocking type constructors unlocking said predetermined locked types; b. translating said source code including imperative constructs and the parametric polymorphic procedures into intermediate form representations; and c. determining in response to said intermediate form representations and said type representations whether said predetermined locked types are free of substitution with an exact type so that said program will be free of said run-time type error. - View Dependent Claims (34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65)
-
Specification