Refinement types in Jolie

Автор: Tchitchigin Alexander, Safina Larisa, Elwakil Mohamed, Mazzara Manuel, Montesi Fabrizio, Rivera Victor

Журнал: Труды Института системного программирования РАН @trudy-isp-ran

Статья в выпуске: 2 т.28, 2016 года.

Бесплатный доступ

Jolie is the first language for microservices and it is currently dynamically type checked. This paper considers the opportunity to integrate dynamic and static type checking with the introduction of refinement types, verified via an SMT solver. The integration of the two aspects allows a scenario where the static verification of internal services and the dynamic verification of (potentially malicious) external services cooperate in order to reduce testing effort and enhance security. Refinement types are well-known technique for numeric, array and algebraic data types. They rely on corresponding SMT-theories. Recently SMT solvers got support for a theory of strings and regular expressions. In the paper, we describe possible application of the theory to string refinement types. We use Jolie programming language to illustrate feasibility and usefulness of such extension. First, because Jolie already has syntax extension to support string refinements. We build on top of that extension to provide static type checking. Second, because in the realm of microservices the need for improved checking of string data is much higher as most of external communication goes through text-based protocols. We present simplified but real-world example from the domain of web-development. We intentionally introduce a bug in the example demonstrating how easily it can slip a conventional type system. Proposed solution is feasible, as it do not accept program with the bug. Complete solution will need enhancements in precision and error reporting.

Еще

Microservices, jolie, refinement types, smt, sat, z3

Короткий адрес: https://sciup.org/14916344

IDR: 14916344   |   DOI: 10.15514/ISPRAS-2016-28(2)-2

Список литературы Refinement types in Jolie

  • EU Project SENSORIA. Accessed April 2016. http://www.sensoria-ist.eu/.
  • Gist of SMT constraints for the example. Accessed April 2016. https://gist.github.com/gabriel-fallen/a04c33860e2157201fa8.
  • Jolie Programming Language. Accessed April 2016. http://www.jolie-lang.org/.
  • WS-BPEL OASIS Web Services Business Process Execution Language. accessed April 2016. http://docs.oasis-open.org/wsbpel/2.0/wsbpel-specification-draft.html.
  • Power Query formula reference. Technical Report, August 2015.
  • Microsoft Research. Accessed April 2016. Z3. https://github.com/Z3Prover/z3.
  • Jesper Bengtson, Karthikeyan Bhargavan, C´edric Fournet, Andrew D. Gordon, and Sergio Maffeis. Refinement types for secure implementations. ACM Trans. Program. Lang. Syst., 33(2):8:1-8:45, February 2011.
  • Gavin M. Bierman, Andrew D. Gordon, C˘at˘alin Hrit¸cu, and David Langworthy. Semantic subtyping with an SMT solver. In Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, ICFP ’10, pages 105-116, New York, NY, USA, 2010. ACM.
  • Marco Carbone and Fabrizio Montesi. Deadlock-freedom-by-design: multiparty asynchronous global programming. In POPL, pages 263-274, 2013.
  • Leonardo De Moura and Nikolaj Bjørner. Z3: An efficient SMT solver. In Proc. of 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, TACAS’08/ETAPS’08, pages 337-340, Berlin, Heidelberg, 2008. Springer-Verlag.
  • David Detlefs, Greg Nelson, and James B. Saxe. Simplify: A theorem prover for program checking. J. ACM, 52(3):365-473, May 2005.
  • Joshua Dunfield. A unified system of type refinements. PhD thesis, Air Force Research Laboratory, 2007.
  • Cormac Flanagan. Hybrid type checking. In Conference Record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’06, pages 245-256, New York, NY, USA, 2006. ACM.
  • Tim Freeman and Frank Pfenning. Refinement types for ML. SIGPLAN Not., 26(6):268-277, May 1991.
  • Claudio Guidi, Ivan Lanese, Fabrizio Montesi, and Gianluigi Zavattaro. Dynamic error handling in service oriented applications. Fundam. Inform., 95(1):73-102, 2009.
  • Claudio Guidi, Roberto Lucchi, Gianluigi Zavattaro, Nadia Busi, and Roberto Gorrieri. Sock: a calculus for service oriented computing. In ICSOC, volume 4294 of LNCS, pages 327-338. Springer, 2006.
  • Kenneth Knowles, Aaron Tomb, Jessica Gronski, Stephen N Freund, and Cormac Flanagan. Sage: Unified hybrid checking for first-class types, general refinement types, and dynamic (extended report), 2006.
  • James Lewis and Martin Fowler. Microservices: a definition of this new architectural term. Accessed April 2016. http://martinfowler.com/articles/microservices.htm.
  • Roberto Lucchi and Manuel Mazzara. A pi-calculus based semantics for WS-BPEL. J. Log. Algebr. Program., 70(1):96-118, 2007.
  • Manuel Mazzara, Faisal Abouzaid, Nicola Dragoni, and Anirban Bhattacharyya. Toward design, modelling and analysis of dynamic workflow reconfigurations -A process algebra perspective. In Web Services and Formal Methods -8th International Workshop, WS-FM, pages 64-78, 2011.
  • Robin Milner, Joachim Parrow, and David Walker. A calculus of mobile processes, I and II. Information and Computation, 100(1):1-40,41-77, September 1992.
  • Fabrizio Montesi. JOLIE: a Service-oriented Programming Language. Master’s thesis, University of Bologna, 2010.
  • Fabrizio Montesi. Process-aware web programming with Jolie. In Proceedings of the 28th Annual ACM Symposium on Applied Computing, SAC ’13, pages 761-763, New York, NY, USA, 2013. ACM.
  • Fabrizio Montesi and Marco Carbone. Programming Services with Correlation Sets. In Proc. of Service-Oriented Computing -9th International Conference, ICSOC, pages 125-141, 2011.
  • Fabrizio Montesi, Claudio Guidi, and Gianluigi Zavattaro. Service-oriented programming with jolie. In Web Services Foundations, pages 81-107. 2014.
  • J. M. Nielsen. A Type System for the Jolie Language. Master’s thesis, Technical University of Denmark, 2013.
  • Mila Dalla Preda, Saverio Giallorenzo, Ivan Lanese, Jacopo Mauro, and Maurizio Gabbrielli. AIOCJ: A choreographic framework for safe adaptive distributed applications. In Software Language Engineering -7th International Conference, SLE 2014, V¨aster˚as, Sweden, September 15-16, 2014. Proceedings, pages 161-170, 2014.
  • Larisa Safina, Manuel Mazzara, Fabrizio Montesi, and Victor Rivera. Data-driven workflows for microservices (genericity in jolie). In Proc. of The 30th IEEE International Conference on Advanced Information Networking and Applications (AINA), 2016.
Еще
Статья научная