Re: Unexpected error

"Pierpaolo BERNARDI" <[email protected]> Sat, 22 Jul 2006 20:17:20 +0200
Newsgroups gmane.lisp.allegro
Message-ID <op.tc3rq6q78t8izc@eraora>
Hello,

apparently, even with the latest patch, prolog still fails at random times.

Below there's a source file and an interaction transcript.

(Express edition, updated today)

HTH

== bugr.cl ==

(defpackage provapro
   (:use :cl :prolog))

(in-package :provapro)

(<-- (fa-rete ?l ?r ?v)
      (append ?l1 ?l2 ?l)
      (not (== ?l1 ()))
      (not (== ?l2 ()))
      (fa-rete ?l1 ?r1 ?v1)
      (fa-rete ?l2 ?r2 ?v2)
      (or (and (= ?r (ser ?r1 ?r2))
	      (is ?v (+ ?v1 ?v2)))
	 (and (= ?r (par ?r1 ?r2))
	      (is ?v (/ (+ (/ ?v1) (/ ?v2)))))))
(<- (fa-rete (?q) ?q ?q))

(defun ohm (resistori &optional (val-min 1d300))
   (let ((rete-min))
     (prolog (lisp ?lista resistori)
             (and (fa-rete ?lista ?rete ?valore)
                  (lisp* (let ((val (abs (- ?valore pi))))
                           (when (< val val-min)
                             (setf val-min val
                                   rete-min ?rete))))))
     (values val-min rete-min)))

(defun test ()
   (time
    (let ((perm '(1 2 3 4 5 6 7 8 9 10)))
      (print perm)
      (multiple-value-bind (meglio rete) (ohm perm)
        (print meglio)
        (pprint rete)))))

== end of bugr.cl ==

Transcript:

CL-USER(1):
;;; Note: The emacs-mule external-format, used to transmit
;;;       international (non-ascii) characters for the emacs-lisp
;;;       interface, is not being loaded due to lack of heap space in
;;;       this Lisp session.
CL-USER(2): :cl ../prolog/bugr
;;; Compiling file ..\prolog\bugr.cl
; Autoloading for package "PROLOG":
; Fast loading c:\Program Files\acl80-express\code\PROLOG.002
;;; Writing fasl file ..\prolog\bugr.fasl
;;; Fasl write complete
; Fast loading
;    c:\Documents and Settings\pierpaolo\My Documents\prolog\bugr.fasl
CL-USER(3): (in-package :provapro)
#<The PROVAPRO package>
PROVAPRO(4): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,108 msec user, 78 msec system
; cpu time (gc)     767 msec user, 0 msec system
; cpu time (total)  8,875 msec user, 78 msec system
; real time  15,438 msec
; space allocation:
;  67,285,961 cons cells, 542,541,384 other bytes, 4,152 static bytes
PROVAPRO(5): (test)

(1 2 3 4 5 6 7 8 9 10)
Error: `#<Printer Error, obj=#x20cb54ba: `599' is not of the expected type `LIST'>'
        is not of the expected type `NUMBER'
   [condition type: TYPE-ERROR]

Restart actions (select using :continue):
  0: Return to Top Level (an "abort" restart).
  1: Abort entirely from this (lisp) process.
[1] PROVAPRO(6): :res
PROVAPRO(7): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,412 msec user, 16 msec system
; cpu time (gc)     1,010 msec user, 0 msec system
; cpu time (total)  9,422 msec user, 16 msec system
; real time  15,172 msec
; space allocation:
;  67,212,309 cons cells, 542,150,160 other bytes, 0 static bytes
PROVAPRO(8): (test)

(1 2 3 4 5 6 7 8 9 10)
Error: `#<Printer Error, obj=#x208e455a: `#5\?' is not of the expected type `LIST'>'
        is not of the expected type `NUMBER'
   [condition type: TYPE-ERROR]

Restart actions (select using :continue):
  0: Return to Top Level (an "abort" restart).
  1: Abort entirely from this (lisp) process.
[1] PROVAPRO(9): :res
PROVAPRO(10): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,135 msec user, 31 msec system
; cpu time (gc)     802 msec user, 0 msec system
; cpu time (total)  8,937 msec user, 31 msec system
; real time  15,407 msec
; space allocation:
;  67,212,309 cons cells, 542,150,160 other bytes, 0 static bytes
PROVAPRO(11): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,331 msec user, 16 msec system
; cpu time (gc)     763 msec user, 0 msec system
; cpu time (total)  9,094 msec user, 16 msec system
; real time  15,469 msec
; space allocation:
;  67,212,311 cons cells, 542,148,096 other bytes, 0 static bytes
PROVAPRO(12): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,191 msec user, 31 msec system
; cpu time (gc)     653 msec user, 0 msec system
; cpu time (total)  8,844 msec user, 31 msec system
; real time  15,437 msec
; space allocation:
;  67,212,312 cons cells, 542,148,096 other bytes, 0 static bytes
PROVAPRO(13): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 7,918 msec user, 47 msec system
; cpu time (gc)     816 msec user, 0 msec system
; cpu time (total)  8,734 msec user, 47 msec system
; real time  15,687 msec
; space allocation:
;  67,212,315 cons cells, 542,148,096 other bytes, 0 static bytes
PROVAPRO(14): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,013 msec user, 31 msec system
; cpu time (gc)     862 msec user, 0 msec system
; cpu time (total)  8,875 msec user, 31 msec system
; real time  15,531 msec
; space allocation:
;  67,212,311 cons cells, 542,148,096 other bytes, 0 static bytes
PROVAPRO(15): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,029 msec user, 62 msec system
; cpu time (gc)     705 msec user, 0 msec system
; cpu time (total)  8,734 msec user, 62 msec system
; real time  15,657 msec
; space allocation:
;  67,212,311 cons cells, -3,752,819,200 other bytes, 0 static bytes
PROVAPRO(16): (test)

(1 2 3 4 5 6 7 8 9 10)
Error: `#<Printer Error, obj=#x20cb323a: `97482' is not of the expected type `LIST'>'
        is not of the expected type `NUMBER'
   [condition type: TYPE-ERROR]

Restart actions (select using :continue):
  0: Return to Top Level (an "abort" restart).
  1: Abort entirely from this (lisp) process.
[1] PROVAPRO(17): :res
PROVAPRO(18): (lisp-implementation-version)
"8.0 [Windows] (Jul 22, 2006 16:44)"
PROVAPRO(19):