Re: variable analysis
Markus Triska <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Hi Jan, Jan Wielemaker <[email protected]> writes: > I guess we either need an library that can be called to optimize the > generated code or we need some way for term/goal expansion to tell the > compiler not to worry about this code. Ideas? One thing I noticed is that compiling: :- use_module(library(clpfd)). n_factorial(0, 1). n_factorial(N, F) :- N #> 0, N1 #= N - 1, F #= N * F1, n_factorial(N1, F1). yields: Warning: ... Test is always true: var(N1) However, compiling the expanded version (generated by listing/2) yields no warnings (6.5.0-105-g28da4ed). At least this should be consistent. All the best, Markus