Rule matching problem with exists and test

  • vranoch
    vranoch
    2013-12-14

    Thanks a lot Gary, I will test it. I do not know the nature of this problem but did You also consider other similar constructions (e.g. nesting these constructions - (exists (exists )), etc.)? For example the following construction also does not work correctly without Your latest fix. With outermost (exists ) it does not fire at all whereas without it it fires two times. Consider also this, please.

    Thanks Vranoch

    (defrule if_exists ""
    (exists
    (SAD G ?ix1 GX01 ?var1)
    (test (eq ?var1 "CN"))
    (and
    (exists (SAD G ?ix1 GCH ?ix2 GCH03 ?var2)
    (test (eq ?var2 "B00"))
    )
    )
    )
    =>
    ; (printout t "Found item " ?ix1 crlf)
    (printout t "Found item " crlf)
    )