Академический Документы
Профессиональный Документы
Культура Документы
Keehang Kwon
Dept. of Computer Engineering, DongA University
Busan 604-714, Korea
khkwon@dau.ac.kr
Abstract: Prolog have traditionally lacked de- the programmer to express these looping tasks.
vices for the looping tasks. This limitation can To be specific, a sequential-conjunctive-
T
be addressed by using a fragment of Japaridze’s recurrence goal is of the form G where G is
computability logic. We propose SeqProlog, an a goal. Executing this goal has the following in-
extension to Prolog with sequential recurrence tended semantics: execute G repeatedly. All ex-
T
goal formulas. SeqProlog extends Prolog by al- ecutions must succeed for executing G to suc-
T
lowing goals of the form G where G is a goal. ceed.
These goals allow us to specify the looping tasks. On the other hand, a sequential-conjunctive
keywords: Prolog, loop, computability logic goal, introduced in [3], is of the form G1 ∩ G2
where G1 , G2 are goals. Executing this goal has
the following intended semantics: execute both
1 Introduction G1 and G2 in sequence. Both executions must
succeed for executing G1 ∩ G2 to succeed.
The while-loop constructs have been popular in In this paper we present the syntax and se-
imperative languages. Despite its wide use, the mantics of this extended language, show some
while-loop constructs cannot be specified in logic examples of its use.
programming based on classical logic or linear The remainder of this paper is structured as
logic. For example, it is very awkward to specify follows. We describe SeqProlog based on a first-
the following task in Prolog: repeatedly read a order sequential Horn clauses in the next sec-
number N , output the factorial of N until some tion. In Section 3, we present some examples of
negative number is read. SeqProlog. Section 4 concludes the paper.
Dealing with the looping tasks in Prolog is
typically done via the use of recursion in the in-
struction set. One major drawback with these 2 The Language
attempts is that the semantics of the instruction
The language we use is an expanded version
set becomes awkward and complicated. This
of Horn clauses with sequential-conjunctive-
limitation can be overcome only by a new seman-
recurrence goals. It is described by G- and D-
tics for logical formulas, i.e., using Japaridze’s
formulas given by the syntax rules below:
Computability Logic(CL)[2]. CL is a beauti-
ful semantic platform for reinterpreting logic as G ::= A | G ∧ G | G ∨ G | ∃x G | G ∩ G |
a theory of tasks. Formulas in CL stand for T
G
instructions that can carry out some computa-
tional tasks. D ::= A | G ⊃ A | ∀x D | D ∧ D
This paper proposes SeqProlog, an extension
of Prolog with sequential recurrence operators
in goal formulas. Traditionally, Prolog has the In the rules above, A represents an atomic
problem of expressing the while-loop tasks. The formula. A D-formula is called a sequential Horn
class of sequential recurrence operators enables clause.
121
Keehang Kwon, Int. J. Comp. Tech. Appl., Vol 2 (1), 121-123 ISSN : 2229-6093
122
Keehang Kwon, Int. J. Comp. Tech. Appl., Vol 2 (1), 121-123 ISSN : 2229-6093
123