Abstract
We present a graph grammar based type inference system for a totally graphic development language. NiMo (Nets in Motion) can be seen as a graphic equivalent to Haskell that acts as an on-line tracer and debugger. Programs are process networks that evolve giving total visibility of the execution state, and can be interactively completed, changed or stored at any step. In such a context, type inference must be incremental. During the net construction or modification only type safe connections are allowed. The user visualizes the type information evolution and, in case of conflict, can easily identify the causes. Though based on the same ideas, the type inference system has significant differences with its analogues in functional languages. Process types are a non-trivial generalization of functional types to handle multiple outputs and deferred arguments even in higher order parameters, partial application in any order and curried-uncurried coercion. Here we present the elements to model graphical inference, the notion of structural and non-structural equivalence of type graphs, and a graph unification and composition calculus for typing nets in an incremental way.
Similar content being viewed by others
Notes
The symbol ? is also used in gradually-typed \(\lambda \)-calculus standing for dynamic types [16].
Being both out-ports they cannot be connected but their TDs would be unified e.g. if they were connected as values of two list-items in a same list.
It can be seen as the equivalent to the Damas-Milner instantiation rule.
The right side cannot be obtained by overlapping as in Fig. 14. The screen-shot was obtained by first connecting the F-out ports of f and g to a pair of connected list-items (then deleted).
Because all them have at least one output connected.
Ordering is significant for ports of higher order parameters, which are clockwise applied, but not for a non-parameterised net. If it finally becomes a net-process (see Sect. 2.4) the user selects the open ports to be the parameters and results, and sets both orderings.
This rule applies also when connecting a vertical green-arrow; it is not a special case.
Since none of the connections closes the other ports.
References
AGG Home page: http://user.cs.tu-berlin.de/~gragra/agg/ (2009)
Clerici, S., Zoltan, C.: A graphic functional-dataflow language. In: Loidl, H.W. (ed.) Trends in Functional Programming, vol. 5, pp. 129–144. Intellect, Bristol (2004)
Clerici, S., Zoltan, C.: Graphical type inference. A graph grammar definition. Technical Report LSI-07-24-R, Department Llenguatges i Sistemes Informàtics, Universitat Politècnica de Catalunya. http://www.lsi.upc.edu/dept/techreps/llistat_detallat.php?id=970 (2007)
Clerici, S., Duch, A., Zoltan, C.: Implementing static synchronus sensor fields using NiMo. Technical Report LSI-09-13-R, Department Llenguatges i Sistemes Informàtics, Universitat Politècnica de Catalunya. http://www.lsi.upc.edu/dept/techreps/llistat_detallat.php?id=1052 (2009)
Clerici, S., Zoltan, C.: A dynamically customizable process-centered evaluation model. In: PPDP ’09: proceedings of the 11th ACM SIGPLAN conference on principles and practice of declarative programming, pp. 37–48. ACM, New York (2009)
Clerici, S., Zoltan, C.: Prestigiacomo G Nimotoons: a totally graphic workbench for program tuning and experimentation. Electr. Note Theor. Comput. Sci. 258(1), 93–107 (2009)
Erwig, M.: Visual type inference. J. Vis. Lang. Comput. 17(2), 161–186 (2006)
König, B.A.: general framework for types in graph rewriting. Acta Inform. 42(4), 349–388 (2005)
LabView Home page: http://www.ni.com/gettingstarted/labviewbasics/dataflow.htm (2012)
Lanaspre, B., Glaser, H.: Type inference in prograph. Technical Report DSSE-TR-95-3, Department of Electronics and Computer Science, University of Southampton (1995)
Lua Home Page: http://www.lua.org/ (2013)
Mcadam, B.J.: Generalising techniques for type debugging. In: Trinder, P., Michaelson, G., Loidl, H.W. (eds.) Trends in Functional Programming, pp. 49–57. Intellect, Bristol (2000)
NiMo Home Page: http://www.lsi.upc.edu/~nimo/Project (2012)
Resources: http://resources.businessobjects.com/labs/cal/gemcutter-techpaper (2009)
Rozenberg, G. (ed.): Handbook of Graph Grammars and Computing by Graph Transformations, vol. 1: Foundations. World Scientific, Singapore (1997)
Siek, J.G., Taha, W.: Gradual typing for functional languages. In: Scheme and Functional Programming, Workshop pp. 81–92 (2006)
Simões, H., Florido, M.: TypeTool—a type inference visualization tool. In: Proceedings of the 13th International Workshop on Functional and (Constraint) Logic Programming (2004)
System-I: http://types.bu.edu/modular/compositional/system-i/ (2012)
Turner, D.A.: Miranda: a non-strict functional language with polymorphic types. In: Proceeding of a Conference on Functional Programming Languages and Computer Architecture, pp. 1–16. Springer-Verlag New York Inc, New York (1985)
V-Rep Home Page: http://coppeliarobotics.com/ (2013)
Yang, J., Michaelson, G.: A visualisation of polymorphic type checking. J. Funct. Program. 10, 57–75 (2000)
Yang, J., Michaelson, G., Trinder, P., Wells, J.B.: Improved type error reporting. In: Proceedings of 12th International Workshop on Implementation of Functional Languages, pp. 71–86 (2000)
Acknowledgments
The authors would like to thank the anonymous reviewers for the detailed and helpful comments to improve the final version. Partially supported by “Generalitat de Catalunya” Project 2009SGR 1137(ALBCOM).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Clerici, S., Zoltan, C. & Prestigiacomo, G. Graphical and incremental type inference. A graph transformation approach. Higher-Order Symb Comput 26, 29–62 (2013). https://doi.org/10.1007/s10990-014-9104-8
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10990-014-9104-8