EFFICIENT RUN-TIME TYPE CHECKING OF TYPED LOGIC PROGRAMS

被引:8
|
作者
DART, PW
ZOBEL, J
机构
[1] UNIV MELBOURNE,DEPT COMP SCI,PARKVILLE,VIC 3052,AUSTRALIA
[2] ROYAL MELBOURNE INST TECHNOL,DEPT COMP SCI,MELBOURNE,VIC 3001,AUSTRALIA
来源
JOURNAL OF LOGIC PROGRAMMING | 1992年 / 14卷 / 1-2期
关键词
D O I
10.1016/0743-1066(92)90046-6
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
This paper presents a new approach to the problem of guaranteeing that definite logic programs are free of type errors. Previously, two approaches to this problem have been considered. The first approach is static type checking, in which predicate types are inferred from the program and checked for self-consistency and for consistency with declared types. Static type checking, however, is in general incomplete, as it can neither only reject programs with type errors nor only accept programs which are type-error free. The second approach is dynamic type checking, in which types are checked against type declarations at run-time. Dynamic type checking, however, is prohibitively expensive. Our approach combines static and dynamic type checking so that, not only is completeness attained but the overhead of run-time type checking is substantially reduced. This is achieved by taking advantage of any redundancy between type declarations and types enforced by the program itself. Type checks are added to a clause only where redundancy cannot be shown to exist. In particular, only local variables ever need be type checked, and type checks on some variables may be shown redundant by use of type inference and analysis of type dependencies; to implement such analysis, we have developed new algorithms for intersecting and comparing types and for unifying types and terms. Hence, programs with declared types may be transformed into programs with a small number of explicit type checks. We argue that the overhead of the remaining type checks is generally small and is justified by the benefits of having effective type checking for logic programs.
引用
收藏
页码:31 / 69
页数:39
相关论文
共 50 条
  • [1] Run-time type checking for binary programs
    Burrows, M
    Freund, SN
    Wiener, JL
    [J]. COMPILER CONSTRUCTION, PROCEEDINGS, 2003, 2622 : 90 - 105
  • [2] Profiling for Run-Time Checking of Computational Properties and Performance Debugging in Logic Programs
    Mera, Edison
    Trigo, Teresa
    Lopez-Garcia, Pedro
    Hermenegildo, Manuel
    [J]. PRACTICAL ASPECTS OF DECLARATIVE LANGUAGES, 2011, 6539 : 38 - +
  • [3] Run-Time Efficient Probabilistic Model Checking
    Filieri, Antonio
    Ghezzi, Carlo
    Tamburrelli, Giordano
    [J]. 2011 33RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2011, : 341 - 350
  • [4] Run-time manipulation of programs in a statically-typed language
    Greiner, Sašo
    [J]. Informatica (Ljubljana), 2009, 33 (03) : 397 - 398
  • [5] Run-time profiling of functional logic programs
    Brassel, B
    Hanus, M
    Huch, F
    Silva, J
    Vidal, G
    [J]. LOGIC BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 2005, 3573 : 182 - 197
  • [6] Run-time Manipulation of Programs in a Statically-Typed Language
    Greiner, Saso
    [J]. INFORMATICA-JOURNAL OF COMPUTING AND INFORMATICS, 2009, 33 (03): : 397 - 398
  • [7] Global constraint checking at run-time
    Hein, Christian
    Ritter, Tom
    [J]. EIGHTH INTERNATIONAL SYMPOSIUM ON AUTONOMOUS DECENTRALIZED SYSTEMS, PROCEEDINGS, 2007, : 59 - +
  • [8] Run-Time Checking of Dynamic Properties
    Sokolsky, Oleg
    Sammapun, Usa
    Lee, Insup
    Kim, Jesung
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2006, 144 (04) : 91 - 108
  • [9] Architecture compliance checking at run-time
    Ganesan, Dharmalingam
    Keuler, Thorsten
    Nishimura, Yutaro
    [J]. INFORMATION AND SOFTWARE TECHNOLOGY, 2009, 51 (11) : 1586 - 1600
  • [10] Run-Time Assertion Checking with Enfasis
    Olmedo Aguirre, Jose Oscar
    Juarez Martinez, Ulises
    [J]. COMPUTACION Y SISTEMAS, 2010, 13 (03): : 273 - 294