A practical analysis of non-termination in large logic programs

被引:7
|
作者
Liang, Senlin [1 ]
Kifer, Michael [1 ]
机构
[1] SUNY Stony Brook, Dept Comp Sci, Stony Brook, NY USA
基金
美国国家科学基金会;
关键词
terminyzer; termination and non-termination analysis; logic programming; PROVING TERMINATION; PROLOG;
D O I
10.1017/S1471068413000446
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
A large body of work has been dedicated to termination analysis of logic programs but relatively little has been done to analyze non-termination. In our opinion, explaining non-termination is a much more important task because it can dramatically improve a user's ability to effectively debug large, complex logic programs without having to abide by punishing syntactic restrictions. Non-termination analysis examines program execution history when the program is suspected to not terminate and informs the programmer about the exact reasons for this behavior. In Liang and Kifer (2013), we studied the problem of non-termination in tabled logic engines with subgoal abstraction, such as XSB, and proposed a suite of algorithms for non-termination analysis, called Terminyzer. These algorithms analyze forest logging traces and output sequences of tabled subgoal calls that are the likely causes of non-terminating cycles. However, this feedback was hard to use in practice: the same subgoal could occur in multiple rule heads and in even more places in rule bodies, so Terminyzer left too much tedious, sometimes combinatorially large amount of work for the user to do manually. Here we propose a new suite of algorithms, Terminyzer(+), which closes this usability gap. Terminyzer+ can detect not only sequences of subgoals that cause non-termination, but, importantly, the exact rules where they occur and the rule sequences that get fired in a cyclic manner, thus causing non-termination. This makes Terminyzer(+) suitable as a back-end for user-friendly graphical interfaces on top of Terminyzer(+), which can greatly simplify the debugging process. Terminyzer(+) back-ends exist for the SILK system as well as for the open-source Flora-2 system. A graphical interface has been developed for SILK and is currently underway for Flora-2. We also report experimental studies, which confirm the effectiveness of Terminyzer(+) on a host of large real-world knowledge bases. All tests used in this paper are available online.(1) In addition, we make a step towards automatic remediation of non-terminating programs by proposing an algorithm that heuristically fixes some causes of misbehavior. Furthermore, unlike Terminyzer, Terminyzer(+) does not require the underlying logic engine to support subgoal abstraction, although it can make use of it.
引用
收藏
页码:705 / 719
页数:15
相关论文
共 50 条
  • [41] HipTNT plus : A Termination and Non-termination Analyzer by Second-Order Abduction
    Le, Ton Chanh
    Ta, Quang-Trung
    Chin, Wei-Ngan
    [J]. TOOLS AND ALGORITHMS FOR THE CONSTRUCTION AND ANALYSIS OF SYSTEMS, TACAS 2017, PT II, 2017, 10206 : 370 - 374
  • [42] Automated termination analysis for logic programs by term rewriting
    Schneider-Kamp, Peter
    Giesl, Juergen
    Serebrenik, Alexander
    Thiemann, Rene
    [J]. LOGIC-BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 2007, 4407 : 177 - +
  • [43] A General Framework for Automatic Termination Analysis of Logic Programs
    Nachum Dershowitz
    Naomi Lindenstrauss
    Yehoshua Sagiv
    Alexander Serebrenik
    [J]. Applicable Algebra in Engineering, Communication and Computing, 2001, 12 : 117 - 156
  • [44] Termination analysis of logic programs based on dependency graphs
    Nguyen, Manh Thang
    Giesl, Juergen
    Schneider-Kamp, Peter
    De Schreye, Danny
    [J]. LOGIC-BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 2008, 4915 : 8 - +
  • [45] Polynomial interpretations as a basis for termination analysis of logic programs
    Nguyen, MT
    De Schreye, D
    [J]. LOGIC PROGRAMMING, PROCEEDINGS, 2005, 3668 : 311 - 325
  • [46] Reuse of results in termination analysis of typed logic programs
    Bruynooghe, M
    Codish, M
    Genaim, S
    Vanhoof, W
    [J]. STATIC ANALYSIS, PROCEEDINGS, 2002, 2477 : 477 - 492
  • [47] Constraint-based termination analysis of logic programs
    Decorte, S
    De Schreye, D
    Vandecasteele, H
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1999, 21 (06): : 1137 - 1195
  • [48] A general framework for automatic termination analysis of logic programs
    Dershowitz, N
    Lindenstrauss, N
    Sagiv, Y
    Serebrenik, A
    [J]. APPLICABLE ALGEBRA IN ENGINEERING COMMUNICATION AND COMPUTING, 2001, 12 (1-2) : 117 - 156
  • [49] ∃-Universal termination of logic programs
    Ruggieri, S
    [J]. THEORETICAL COMPUTER SCIENCE, 2001, 254 (1-2) : 273 - 296
  • [50] TUTORIAL ON TERMINATION OF LOGIC PROGRAMS
    DESCHREYE, D
    VERSCHAETSE, K
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1992, 649 : 70 - 88