next up previous
Next: List Up: Syntax of KL1 Previous: Syntax of KL1

Variable

In logic programming languages, variables are real ``variable'' in terms of mathematics. Meanwhile, so called variables in procedural languages like C are not real variable but certain addresses in memory space. We should note this difference. For example, in KL1, expression

X = X + 1

is impossible because this is absolutely illogical. Variables in logic programming are never overwritten. Therefore, during recursive call KL1 may consume a lot of memory space. To avoid such situation, an accumulator should be used (e.g., see Sterling and Shapiro, 1994).



Satoshi OOta
1999-03-06