Abstract
We present the theory of context relations. Context relations are a method for incremental semantic analysis in language-specific editors, which is able to handle incomplete program fragments. The algorithm is generated from the definition of a language's static semantics and is based on inference rules and order-sorted unification. The paper presents the underlying mathematical theory, optimal incremental analysis algorithms, handling of user-defined polymorphism and overloading, and implementation issues. It is intended as the concluding report on a by now mature concept, which has successfully been used to generate efficient incremental type inferencers for languages like ADA and Fortran 8x.
Similar content being viewed by others
References
Reference manual for the ADA programming language. Department of Defense, ANSI-MIL-STD 1815A, 1983
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: principles, techniques and tools. Reading, MA: Addison-Wesley 1986
Ait-Kaci, H., Nasr, R.: Integrating logic and functional programming. Lisp Sym. Comput.2(1), 51–90 (1989)
Bahlke, R., Snelting, G.: The PSG system: From formal language definitions to interactive programming environments. ACM Trans. Program. Lang. Syst.8(4), 547–576 (1986)
Borras, P., Clément, D., Despeyroux, Th., Incerpi, J., Kahn, G., Lang, B., Pascual, V.: CENTAUR: The system. In: Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environents, vol. 13(5) of SIGSOFT Software Engineering Notes, pp. 14–24, Boston, November 1988.
Boyer, R.S., Moore, J.S.: The sharing of structure in theorem-proving programs. Math. Intell.7, 101–116 (1972)
Clément, D., Despeyroux, J., Despeyroux, T., Kahn, G.: A simple applicative language: Mini-ML. In: Proceedings of the 1986 ACM conference on LISP and functional programming, pp. 13–27 (1986)
Cohen, J.: Constraint logic programming languages. Commun. ACM33(7), 52–68 (1990)
Damas, L., Milner, R.: Principal type schemes for functional programs. In: Conference record of the 9th annual ACM symposium on principles of programming languages, pp. 207–212, January 1982
Despereux, T.: Executable specification of static semantics. In: Kahn, G. (ed) Semantics of data types (Lect. Notes Comput. Sci., vol. 173, pp. 215–233). Berlin Heidelberg New York: Springer 1984
Fages, F.: Associative-commutative unification. In: Shostak, R.E. (ed.) 7th International conference on automated deduction (Lect. Notes Comput. Sci., vol. 170, pp. 194–208). Berlin Heidelberg New York: Springer 1984
Grosch, F.J., Snelting, G.: Interence-based overloading resolution for ADA. In: Deransart, P. (ed.) 2nd Conf. on programming language implementation and logic programming (Lect. Notes Comput. Sci., vol. 456, pp. 30–44). Berlin Heidelberg New York: Springer 1990
Henhapl, W.: Context conditions in program fragments. Technical Report PU-R1/80, TH Darmstadt, Praktische Informatik, D-6100 Darmstadt, 1980
Hoover, R.: Incremental graph evaluation. PhD thesis, Cornell University, Computer Science Department 1987
Huet, G.: A unification algorithm for typed λ-calculus. Theor. Comput. Sci.1, 27–57 (1975)
Hussmann, H.: Unification in conditional-equational theories. In: Caviness, B.F. (ed.) Proc. EUROCAL 1985 (Lect. Notes Comput. Sci., vol. 204, pp. 543–553). Berlin Heidelberg New York: Springer 1985
Jaffar, J., Lassez, J-L.: Constraint logic programming. In: Conferene record of the 14th annual ACM symposium on principles of programming languages, pp. 111–119. Munich, West Germany, January 1987
Johnson, G. Fisher, Ch.: Non-syntactic attribute flow in language-based editors. In: Conference record of the 9th annual ACM symposium on principles of programming languages, pp. 185–195, January 1982
Jones, C.: Systematic software development using VDM. Englewood Cliffs, NJ: Prentice-Hall 1986
Kaes, S.: Parametic overloading in polymorphic programming languages. In: Ganzinger, H. (ed.) ESOP'88, 2nd European symposium on programming (Lect. Notes Comput. Sci., vol. 300, pp. 131–144). Berlin Heidelberg New York: Springer 1988
Kahn, G.: Natural semantics. In: Brandenburg, F. (ed) STACS 1987 (Lect. Notes Comput. Sci., vol. 247). Berlin Heidelberg New York: Springer 1987
Kastens, U.: Ordered attribute grammars. Acta Inf.13(3), 229–256 (1980)
Kay, M.: Unification grammar. Technical report, Xerox Palo Alto Research Center 1983
Maier, D.: The theory of relational databases. Oxford New York: Computer Science Press 1983
Martin, U., Nipkow, T.: Boolean unification-the story so far. J. Symb. Comput.7, 275–293 (1989)
Meseguer, J., Goguen, J., Smolka, G.: Order-sorted unification. J. Symb. Comput. (to appear)
Milner, R.: A theory of type polymorphism in programming. J. Comput. Syst. Sci.17(3), 348–375 (1978)
Nikhil, R.: Practical polymorphism. In: Jouannaud, J.P. (ed.) Functional programming languages and computer architecture (Lect. Notes Comput. Sci., vol 201, pp. 319–333). Berlin Heidelberg New York: Springer 1985
Reps, T.: Optimal-time incremental semantic analysis for syntax-directed editors. In: Conference record of the 9th annual ACM symposium on principles of programming languages, pp. 169–176, 1982
Schek, H., Scholl, M.: The relational model with relation-valued attributes. Inf. Syst.11(2), 137–147 (1986)
Schmidt-Schauß, M.: Computational aspects of an order-sorted logic with term declarations (Lect. Notes Comput. Sci., vol. 395). Berlin Heidelberg New York: Springer 1989
Schroeder, U., Schütz, D.: Incremental name resolution for programming environments. Master's thesis, TH Darmstadt, Praktische Informatik, December 1987 (in German)
Shieber, S.: An introduction to unification-based approaches to grammar. Chicago, IL: University of Chicago Press 1986
Smolka, G.: A feature logic with subsorts. Technical Report LILOG report 33. IBM Stuttgart, 1988
Snelting, G.: Inkrementelle semantische Analyse in unvollständigen Programmfragmenten. PhD Thesis, TH Darmstadt, Facbereich Informatik, March 1986 (in German)
Snelting, G., Bahlke, R.: PSG: A theory-based environment generator. In: Proc. International Conference on System Development Environments & Factories, pp. 131–140. London: Pitnam 1990
Toyn, I., Dix, A., Runciman, C.: Performance polymorphism. In: Kahn, G. (ed) Functional programming languages and computer architecture (Lect. Notes Comput. Sci., vol. 274, pp. 325–346). Berlin Heidelberg New York: Springer 1987
Wadler, Ph., Blott, S.: How to make ad-hoc polymorphism less ad-hoc. In: Conference Record of the 16th annual ACM symposium on principles of programming languages, pp. 60–76, January 1989
Walther, Ch.: Many-sorted unification. J. ACM35(1), 1–17 (1988)
Yeh, D.: On incremental evaluation of ordered attribute grammars. BIT23, 308–320 (1983)
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Snelting, G. The calculus of context relations. Acta Informatica 28, 411–445 (1991). https://doi.org/10.1007/BF01178581
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF01178581