COP: a Simple Way to Integrate Programming and Declarative Programming
Ruben Gonzalez Rubio · 1995
This paper proposes how to integrate two languages, C++ and Prolog, into one. The resulting language is COP(C++ Or Prolog). The motivation behind this work was to offer in one language two programming styles in order to simplify program writing. For example, an application programmer can use the COP language when it is necessary to program in a procedural or object-oriented way (C++) and also with rules (Prolog). Our feeling is that a programmer could benefit from our approach because he or she has the choice to use a programming style adapted to the application needs. In this article we present the COP language. In COP, we try to respect the syntax. the semantics and the philosophies of C++ and Prolog. We define how the two languages can work together. Our approach is to add some features allowing C-- to call Prolog goals. We give all the details that a COP programmer must know in order to use the language, that was possible because we kept our design as simple as we could. This research was partially supported by YSERC.