Abstract
This paper describes experiments done with a static type analyser to transform pure logic definitions (the so-called logic descriptions [7]) into executable Prolog procedures. The presented static analyser can be used in a final transformation component of a logic program synthesis system such as the systems described in [8, 18]. The paper recalls the notion of a logic description and discusses how type information can be used to relate the logic description to its intended meaning. Then the analyser and the underlying notions of type, and abstract substitution are presented. It is explained how type and mode information can be combined to derive Prolog procedures that are correct wrt given directionalities. The type analyser is able to derive procedures producing correct and well typed results, by finding correct permutations of literals in clauses. Practicality of the analyser is illustrated on three examples. It is shown that: (1) there are several (more or less clever) ways to combine type and mode information to help the analyser finding solutions, (2) explicit type checking can be avoided most of the time at run-time, (3) the analyser is able to find multidirectional procedures in many cases, (4) no share constraints are useful to find more solutions when restricted uses are chosen for the procedures (allowing for elaborate optimizations). The analyser is also useful to combine pure and impure logic procedures as it allows to reuse any Prolog procedure provided that it is given a behaviour.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.