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 条
  • [1] Non-termination Analysis of Logic Programs Using Types
    Voets, Dean
    De Schreye, Danny
    [J]. LOGIC-BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 2011, 6564 : 133 - 148
  • [2] Research Summary: Non-termination Analysis of Logic Programs
    Voets, Dean
    [J]. LOGIC PROGRAMMING, 2009, 5649 : 553 - 554
  • [3] Non-termination analysis of logic programs with integer arithmetics
    Voets, Dean
    De Schreye, Danny
    [J]. THEORY AND PRACTICE OF LOGIC PROGRAMMING, 2011, 11 : 521 - 536
  • [4] A New Approach to Non-termination Analysis of Logic Programs
    Voets, Dean
    De Schreye, Danny
    [J]. LOGIC PROGRAMMING, 2009, 5649 : 220 - 234
  • [5] Non-termination inference for constraint logic programs
    Payet, E
    Mesnard, F
    [J]. STATIC ANALYSIS, PROCEEDINGS, 2004, 3148 : 377 - +
  • [6] A non-termination criterion for binary constraint logic programs
    Payet, Etienne
    Mesnard, Fred
    [J]. THEORY AND PRACTICE OF LOGIC PROGRAMMING, 2009, 9 : 145 - 164
  • [7] Non-Termination Analysis of Linear Loop Programs with Conditionals
    Bi, Zhongqin
    Shan, Meijing
    Wu, Bin
    [J]. PROCEEDINGS OF THE 2008 ADVANCED SOFTWARE ENGINEERING & ITS APPLICATIONS, 2008, : 159 - 164
  • [8] Witness to non-termination of linear programs
    Li, Yi
    [J]. THEORETICAL COMPUTER SCIENCE, 2017, 681 : 75 - 100
  • [9] Non-termination checking for imperative programs
    Velroyen, Helga
    Rummer, Philipp
    [J]. TESTS AND PROOFS, 2008, 4966 : 154 - +
  • [10] Formalizing non-termination of recursive programs
    Kahle, R
    Studer, T
    [J]. JOURNAL OF LOGIC AND ALGEBRAIC PROGRAMMING, 2001, 49 (1-2): : 1 - 14