Skip to content

Question about duplication semantics #798

Closed
@nasser

Description

What are the semantics of "duplicate" assertions? If I assert e.g. (is ball red) multiple times I get multiple results when I match on it, which indicates that the individual atoms are not "interned" or deduplicated in any way -- they are fully distinct. But when I remove-atom just once, they all disappear, which would indicate a kind of interning/deduplication.

(is ball red)
(is ball red)
(is ball red)
(is ball red)
(is ball red)

! (match &self (is ball $color) $color)

! (remove-atom &self (is ball red))

! (match &self (is ball $color) $color)
[red, red, red, red, red]
[()]
[]

Can you clarify what is happening?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions