Menu

CLIPSWIN : Sequence expansion not working OR problem with (+)

Help
2013-05-28
2013-05-29
  • Christine DG

    Christine DG - 2013-05-28

    In http://clipsrules.sourceforge.net/documentation/v624/bpg.htm :

    12.18.1 Sequence Expansion and Rules

    The following rules illustrate appropriate use of sequence expansion on the LHS of rules.

    (defrule good-rule-1
    (pattern $?x&:(> (length$ ?x) 1))
    (another-pattern $?y&:(> (length$ ?y) 1))
    (test (> (+ $?x) (+ $?y)))
    =>)

    But In CLIPSWIN 6.3, I(ve got the error :

    [ARGACCES4] Function + expected at least 2 argument(s)

     
  • Gary Riley

    Gary Riley - 2013-05-28
    CLIPS> 
    (defrule good-rule-1
    (pattern $?x&:(> (length$ ?x) 1))
    (another-pattern $?y&:(> (length$ ?y) 1))
    (test (> (+ $?x) (+ $?y)))
    =>)
    [ARGACCES4] Function + expected at least 2 argument(s)
    
    ERROR:
    (defrule MAIN::good-rule-1
       (pattern $?x&:(> (length$ ?x) 1))
       (another-pattern $?y&:(> (length$ ?y) 1))
       (test (> (+ $?x)
    CLIPS> (set-sequence-operator-recognition TRUE)
    FALSE
    CLIPS> 
    (defrule good-rule-1
    (pattern $?x&:(> (length$ ?x) 1))
    (another-pattern $?y&:(> (length$ ?y) 1))
    (test (> (+ $?x) (+ $?y)))
    =>)
    CLIPS> (assert (pattern 7 8 9))
    <Fact-1>
    CLIPS> (assert (another-pattern 1 5))
    <Fact-2>
    CLIPS> (agenda)
    0      good-rule-1: f-1,f-2
    For a total of 1 activation.
    CLIPS> 
    
     
  • Christine DG

    Christine DG - 2013-05-29

    COOL !!!
    Thank you

     

Log in to post a comment.