JESS: [EXTERNAL] Ordered facts question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JESS: [EXTERNAL] Ordered facts question

Grant Rettke
Hi,

I'm working on

5.4. Ordered facts

in

file:///C:/x86/Jess71p2/docs/memory.html

with Jess "Jess Version 7.1p2 11/5/2008"

where there is an example

Jess> (number (value 6))

I expected the ordered fact "number" to get created on-demand but instead got:

Jess reported an error in routine Funcall.execute
        while executing (number (value 6)).
  Message: Undefined function number.
  Program text: ( number ( value 6 ) )  at line 1.

What am I doing wrong?

Best wishes,

Grant

--
((λ (x) (x x)) (λ (x) (x x)))
http://www.wisdomandwonder.com/
ACM, AMA, COG, IEEE



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: JESS: [EXTERNAL] Ordered facts question

Friedman-Hill, Ernest
You can't type a fact directly at the prompt. You can add a fact to
working memory using the (assert) function (as shown in section 5.2) or
you can use the (deffacts) construct to create a group of facts that will
then be added to working memory on reset events (as in section 5.5) .

As a general rule, in the HTML manual, the light red blocks show
interactive sessions with Jess -- things you can type directly at the
prompt -- while the green ones do not. The red ones show the actual
"Jess>" prompt; the "number" fact you typed in below is from a green
block, and is meant to indicate how the fact data structures look.  There
are also violet-colored blocks: those are compilable Java code.
 
I'm actually rather proud of what the Jess test suite does to verify the
manual. The dialogs in the red blocks are actually parsed from the XML
source of the manual and verified: if one of the red blocks says that Jess
gives a particular response to a given input, that is actually verified in
the test suite. Likewise, the code in the violet blocks is compiled, and
if output is shown in the manual, the output is verified correct. The
green boxes are the escape mechanism: they can contain pretty much
anything, and no validation is done on them.


On 10/11/12 4:43 PM, "Grant Rettke" <[hidden email]> wrote:

>Hi,
>
>I'm working on
>
>5.4. Ordered facts
>
>in
>
>file:///C:/x86/Jess71p2/docs/memory.html
>
>with Jess "Jess Version 7.1p2 11/5/2008"
>
>where there is an example
>
>Jess> (number (value 6))
>
>I expected the ordered fact "number" to get created on-demand but instead
>got:
>
>Jess reported an error in routine Funcall.execute
> while executing (number (value 6)).
>  Message: Undefined function number.
>  Program text: ( number ( value 6 ) )  at line 1.
>
>What am I doing wrong?
>
>Best wishes,
>
>Grant
>
>--
>((λ (x) (x x)) (λ (x) (x x)))
>http://www.wisdomandwonder.com/
>ACM, AMA, COG, IEEE
>
>
>
>--------------------------------------------------------------------
>To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
>in the BODY of a message to [hidden email], NOT to the list
>(use your own address!) List problems? Notify [hidden email].
>--------------------------------------------------------------------



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------