Large scale applications of logic programming requires flexible module mechanisms for program construction and organization. Logic programming language, such as Prolog, lacks encapsulation and data abstraction because both predicates and function symbols are global in first-order logic.
In this thesis, Modular Prolog, based on the standard second-order logic, is designed and implemented. The syntax of Modular Prolog is defined by introducing predicate variables and its semantics is shown by proposing transformation rule.
The transformation rule, with two assumptions, transforms module programs into first-order programs without changing their semantics. Transformation rules are implemented in the preprocessor. In Modular Prolog module system, the second-order representation of module is well-integrated with the underlying relational semantics of first-order logic program.
The concept "module" of Modular Prolog provides a powerful modularity and the runtime efficiency by program transformation.