Skip to content

Variable name ordering affects resulting MGU 'complexity' #1

@robertkleffner

Description

@robertkleffner

Lovely project, I am using it to confirm whether there is a bug in my own implementation of Boolean unification. Thank you!

I see some odd results depending on the ordering of variables in an equation. The equations are structurally the same, I just switched around which variable was which.

For instance, in both a = b || c and a = c || b, the following MGU is generated:

a --> b ∨ c
b --> b
c --> c

This is a pretty and comfortable-to-look-at MGU with a low intimidation factor.

When I input c = a || b however, I get the following MGU in the web portal:

a --> c ∧ (a ∨ ¬b)
b --> b ∧ c
c --> c

This one is much less intuitive despite being the same initial equation (at least for me) and seems like it could be a source of further complexity during unification-based type inference for Boolean types. The former MGU keeps the complexity of generated types lower.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions