core.unify

Handle sets correctly

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    unify 0.5.5

Description

Currently unify allows using sets as expressions and just uses them as sequences, which, depending on the order of items, causes the unification to fail or succeed:

(unify #{ '[aa a] '[bb b] } ; =seq=> [bb b] [aa a]
       #{ '[?a a] '[?b b] } ; =seq=> [?b b] [?a a]
) ; => {?a aa, ?b bb}
(unify #{  '[a a]  '[b b] } ; =seq=> [a a] [b b]
       #{ '[?a a] '[?b b] } ; =seq=> [?b b] [?a a]
) ; => nil, expected {?a a, ?b b}

Unify should either handle sets (not sure if the algorithm allows for that easily) or throw an IllegalArgumentException when passed a set, but not silently seq it and behave unpredictably like that.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: