Skip to content

Non monotonic behavior of the pattern matcher with present clauses #2886

@ngeiswei

Description

@ngeiswei

Problem description

I have a query, containing only present clauses, that correctly succeeds. However the presence of an another atom in the atomspace makes it fails.

How to reproduce

Run the following scheme code:

(use-modules (opencog))
(use-modules (opencog exec))

;; Query
(define query
  (let* (
     ;; Constants
     (R (Predicate "R"))
     (A (Execution (Schema "A")))
     ;; Variables
     (P (Variable "$P"))
     (Q (Variable "$Q"))
     ;; Clauses
     (P↝Q (Quote
            (Implication
              (Unquote P)
              (Unquote Q))))
     (Q∧A (And Q A))
     (Q∧A↝R (Implication
              Q∧A
              R)))
    ;; Query
    (Get
      (VariableSet P Q)
      (Present P↝Q Q∧A↝R))))

;; KB

;; Culprit
(Implication
  (And
    (Predicate "Qbis") ; Culprit
    (Execution (Schema "A"))
  )
  (Predicate "R"))

;; Premises
(Implication
  (Predicate "P")
  (Predicate "Q"))
(Implication
  (And
    (Predicate "Q")
    (Execution (Schema "A"))
  )
  (Predicate "R"))

;; PM
(define results (cog-execute! query))

It, incorrectly, returns nothing.

Remove the culprit atom and then it works.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions