From: rif
Subject: Trying to get screamer working
Date: 
Message-ID: <wj08yd4vy9t.fsf@five-percent-nation.mit.edu>
I'm trying to get screamer working (under CMUCL 19a, from 2004-04).

I downloaded it from Siskind's website, and AFAICT one simply calls
compile-file on screamer.lisp, then loads the resulting fasl file.
Out of the box, the compile fails with an error:

 Compiling DEFSTRUCT-COMPILE-TIME (VARIABLE (PRINT-FUNCTION PRINT-VARIABLE) (PREDICATE VARIABLE?) (CONSTRUCTOR MAKE-VARIABLE-INTERNAL)):
; Byte Compiling Top-Level Form:
; Byte Compiling Top-Level Form:
;
 
; Error: (during macroexpansion)
;
; Attempt to modify the locked package COMMON-LISP, by defining type BOOLEAN


Looking in screamer.lisp, I noticed there was a 
(deftype boolean () '(member t nil))

and also noted that this seems to be built in to CMUCL, so I
conditionalized it out (it was already conditionalized out for
allegro-v4.2).  After this it compiled and loaded fine, but trying to
use any screamer functions (such as a-subset-of, as defined in one of
the papers) gives me an error:

Error in function SCREAMER::SCREAMER-ERROR:
   A-BOOLEAN is a nondeterministic function. As such, it must be called only
from a nondeterministic context.
There are eight types of nondeterministic contexts: the body of a
function defined with DEFUN, the body of a call to the FOR-EFFECTS
macro, the first argument of a call to the ONE-VALUE macro, the body of
a call to the POSSIBLY? macro, the body of a call to the NECESSARILY?
macro, the body of a call to the ALL-VALUES macro, the second argument
of a call to the ITH-VALUE macro and the body of a call to the
PRINT-VALUES macro. Note that, the default forms of &OPTIONAL and &KEY
arguments and the initialization forms of &AUX variables, are always
deterministic contexts even though they may appear inside a DEFUN.
   [Condition of type SIMPLE-ERROR]


Any idea how to fix this?  Is there a different place I should be
getting a "CMU"-ized screamer from?

As always, any help is appreciated.

Cheers,

rif

From: Gorbag
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <5vTNc.540$d4.205@bos-service2.ext.ray.com>
"rif" <···@mit.edu> wrote in message
····················@five-percent-nation.mit.edu...
>
> I'm trying to get screamer working (under CMUCL 19a, from 2004-04).

It's been a few years since I've used SCREAMER (and I was using Allegro at
the time), but as I recall, you need to be in-package in some screamer-aware
package (so you pick up his redefiniton of, e.g., defun) and you can't call
things from top level, you have to have a form wrapping the call, such as

(defun foo ()
  (a-boolean ...))

This lets his macros wrap a-boolean with the code needed to make it
backtrack. You're not using the CL:defun form here, but the SCREAMER:defun
form.

Good luck,
Gorbag
From: rif
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <wj0n01jvq8h.fsf@five-percent-nation.mit.edu>
> It's been a few years since I've used SCREAMER (and I was using Allegro at
> the time), but as I recall, you need to be in-package in some screamer-aware
> package (so you pick up his redefiniton of, e.g., defun) and you can't call
> things from top level, you have to have a form wrapping the call, such as
> 
> (defun foo ()
>   (a-boolean ...))
> 
> This lets his macros wrap a-boolean with the code needed to make it
> backtrack. You're not using the CL:defun form here, but the SCREAMER:defun
> form.

Ah, thanks.  A combination of this and using the verison of screamer
in clocc got me going.

Cheers,

rif
From: norman werner
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <b301fb47.0407291030.166ddac4@posting.google.com>
> 
> Ah, thanks.  A combination of this and using the verison of screamer
> in clocc got me going.
> 

Apropos,
has anyone ever used screamer successfully - i tried it severall times.
everything except the most trivial and basic failed. 
Is it just me, is screamer hard or is it plain out evil?


Norman
From: Fred Gilham
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <u765864i5p.fsf@snapdragon.csl.sri.com>
> Apropos, has anyone ever used screamer successfully - i tried it
> severall times.  everything except the most trivial and basic
> failed.  Is it just me, is screamer hard or is it plain out evil?

Well, the author of Screamer managed to use it.  There's a program he
wrote called Abigail which is pretty impressive, and it uses
Screamer.

(If anyone wants to try Abigail out, it requires CLIM.  It *almost*
works with McCLIM.)

-- 
Fred Gilham                                         ······@csl.sri.com
The opponents of income taxation in 1912 said that we would see the
day when taxes would extract 25% of people's income. Such Cassandras
were ridiculed.                                        -- Gary North
From: Christian Pietsch
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <cebrk3$6lifd$1@hades.rz.uni-saarland.de>
norman werner wrote in <····························@posting.google.com>:
> Apropos,
> has anyone ever used screamer successfully

Certainly. Screamer is neither a toy nor an ivory tower creation.
It reliably adds nondeterminism to a Common Lisp implementation so
that Lisp can embrace another programming paradigm, constraint-based
programming.

I've been using and hacking a natural language generator that makes
heavy use of Screamer in its microplanning component. Screamer has
proved to be a reliable workhorse there. This nat. lang. generator has
been used in a number of complex prototypes such as a nearly real-time
speech translation system.

> - i tried it severall times.
> everything except the most trivial and basic failed. 

For a nice little hands-on introduction, see
http://radio.weblogs.com/0102385/2003/03/12.html#a309
You better download the version that comes with CLOCC though.

> Is it just me, is screamer hard or is it plain out evil?

Chris Double says in the above-mentioned blog entry, ``I'd heard of
Screamer but had always thought it to be a very difficult product
which would be hard to port. In fact, it was almost trivial.''
And then he gives some sample code to start with.

I'm willing to admit that I never wrote a Screamer application from
scratch, so some of the more experienced Lisp enthusiasts here might
have more useful hints for you. At any rate I can testify that Jeffrey
Mark Siskind (aka Qobi, the the creator of Screamer) it not the only
person who ever used it.

Keep trying!
Christian

-- 
  Christian Pietsch
  http://www.interling.de
From: norman werner
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <b301fb47.0407300433.55c33981@posting.google.com>
> Certainly. Screamer is neither a toy nor an ivory tower creation.
> It reliably adds nondeterminism to a Common Lisp implementation so
> that Lisp can embrace another programming paradigm, constraint-based
> programming.

After several fruitless attempts - I finally found that the
nondeterministic basis of 'either and 'fail does exactly and reliable
what i thought it would do. But funny - you mention constraint-based
programming. In the end i just gave up on this and wrote some adhoc
implementation for immediate needs
myself.

> For a nice little hands-on introduction, see
> http://radio.weblogs.com/0102385/2003/03/12.html#a309

thanks for the link.


> I'm willing to admit that I never wrote a Screamer application from
> scratch, so some of the more experienced Lisp enthusiasts here might
> have more useful hints for you. At any rate I can testify that Jeffrey
> Mark Siskind (aka Qobi, the the creator of Screamer) it not the only
> person who ever used it.
> 
> Keep trying!

thanks to the reputation of Siskind I constantly think that problem
sits in front of screen. So I try it again at irregular intervalls.
Maybe next time ...



Norman
From: Rene de Visser
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <cedfts$r0i$1@news1.wdf.sap-ag.de>
I would suggest working through the provided examples, a number of
which are short and work without problems.

For the one screamer app I've written I just followed the examples and found
it quite straight forward,
the problems I had were later with search strategies and performance tuning
(I think that the doc
I had was out of date with the program)

Rene.

"norman werner" <·············@student.uni-magdeburg.de> wrote in message
·································@posting.google.com...
> > Certainly. Screamer is neither a toy nor an ivory tower creation.
> > It reliably adds nondeterminism to a Common Lisp implementation so
> > that Lisp can embrace another programming paradigm, constraint-based
> > programming.
>
> After several fruitless attempts - I finally found that the
> nondeterministic basis of 'either and 'fail does exactly and reliable
> what i thought it would do. But funny - you mention constraint-based
> programming. In the end i just gave up on this and wrote some adhoc
> implementation for immediate needs
> myself.
>
> > For a nice little hands-on introduction, see
> > http://radio.weblogs.com/0102385/2003/03/12.html#a309
>
> thanks for the link.
>
>
> > I'm willing to admit that I never wrote a Screamer application from
> > scratch, so some of the more experienced Lisp enthusiasts here might
> > have more useful hints for you. At any rate I can testify that Jeffrey
> > Mark Siskind (aka Qobi, the the creator of Screamer) it not the only
> > person who ever used it.
> >
> > Keep trying!
>
> thanks to the reputation of Siskind I constantly think that problem
> sits in front of screen. So I try it again at irregular intervalls.
> Maybe next time ...
>
>
>
> Norman
From: Joe Marshall
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <1xit4p37.fsf@ccs.neu.edu>
·············@student.uni-magdeburg.de (norman werner) writes:

>> 
>> Ah, thanks.  A combination of this and using the verison of screamer
>> in clocc got me going.
>> 
>
> Apropos,
> has anyone ever used screamer successfully - i tried it severall times.
> everything except the most trivial and basic failed. 
> Is it just me, is screamer hard or is it plain out evil?

I've used it on Lispworks.
From: norman werner
Subject: Re: Trying to get screamer working
Date: 
Message-ID: <b301fb47.0407291032.7600fcd8@posting.google.com>
rif <···@mit.edu> wrote in message news:<···············@five-percent-nation.mit.edu>...
> I'm trying to get screamer working (under CMUCL 19a, from 2004-04).
> 
> I downloaded it from Siskind's website, and AFAICT one simply calls
> compile-file on screamer.lisp, then loads the resulting fasl file.
> Out of the box, the compile fails with an error:
> 
>  Compiling DEFSTRUCT-COMPILE-TIME (VARIABLE (PRINT-FUNCTION PRINT-VARIABLE) (PREDICATE VARIABLE?) (CONSTRUCTOR MAKE-VARIABLE-INTERNAL)):
> ; Byte Compiling Top-Level Form:
> ; Byte Compiling Top-Level Form:
> ;
>  
> ; Error: (during macroexpansion)
> ;
> ; Attempt to modify the locked package COMMON-LISP, by defining type BOOLEAN
> 
> 
> Looking in screamer.lisp, I noticed there was a 
> (deftype boolean () '(member t nil))
> 
> and also noted that this seems to be built in to CMUCL, so I
> conditionalized it out (it was already conditionalized out for
> allegro-v4.2).  After this it compiled and loaded fine, but trying to
> use any screamer functions (such as a-subset-of, as defined in one of
> the papers) gives me an error:
> 
> Error in function SCREAMER::SCREAMER-ERROR:
>    A-BOOLEAN is a nondeterministic function. As such, it must be called only
> from a nondeterministic context.
> There are eight types of nondeterministic contexts: the body of a
> function defined with DEFUN, the body of a call to the FOR-EFFECTS
> macro, the first argument of a call to the ONE-VALUE macro, the body of
> a call to the POSSIBLY? macro, the body of a call to the NECESSARILY?
> macro, the body of a call to the ALL-VALUES macro, the second argument
> of a call to the ITH-VALUE macro and the body of a call to the
> PRINT-VALUES macro. Note that, the default forms of &OPTIONAL and &KEY
> arguments and the initialization forms of &AUX variables, are always
> deterministic contexts even though they may appear inside a DEFUN.


you have to wrap any nondeterministic stuff into 
(screamer:all-values
  ...
  )

(screamer:one-value
  ....
  )

or one of the other magic forms.
see screamer-documentation for details


Norman