Skip to content

FreeLink variable order depends on variable names, not just atom structure #1677

@ngeiswei

Description

@ngeiswei

The variable order returned by FreeLink (FreeLink::get_vars() for C++, cog-free-variables for Scheme) depends on the variable names, not just the atom structure. For instance

 scheme@(guile-user)> (cog-free-variables (And (Variable "$X") (Variable "$G")))
$6 = ((VariableNode "$G")
 (VariableNode "$X")
)
scheme@(guile-user)> (cog-free-variables (And (Variable "$X") (Variable "$Y")))
$7 = ((VariableNode "$X")
 (VariableNode "$Y")
)

I don't know if that's a bug, probably not, but it should at least be added as a warning in the pertinent documentations https://wiki.opencog.org/w/FreeLink https://wiki.opencog.org/wikihome/index.php/Scheme#cog-free-variables

Metadata

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