Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counterexample for no_stack_with_bar_area_discrete_color hard constraint #87

Open
light-and-salt opened this issue Jun 24, 2019 · 8 comments

Comments

@light-and-salt
Copy link
Member

I have a counterexample for the no_stack_with_bar_area_discrete_color hard constraint :P

hard(no_stack_with_bar_area_discrete_color,E) :- mark(bar;area), channel(E,color), discrete(E), not stack(_).

Screen Shot 2019-06-23 at 6 59 54 PM

@domoritz
Copy link
Member

Adding stack doesn't hurt in this case, though, right?

I guess we can make an exception when the color field is the same as the categorical field.

@light-and-salt
Copy link
Member Author

Or we can make the rule a bit more specific like

hard(no_stack_with_bar_area_discrete_color,E) 
  :- mark(bar;area), channel(E,color), discrete(E), 
  field(E,F), field(EX,FX), field(EY, FY), F != FX, F != FY,
  not stack(_).

Hmm... this is a bit verbose...

@domoritz
Copy link
Member

I don't understand the rule. Also note that you usually want to use > instead of != To break symmetries.

@light-and-salt
Copy link
Member Author

F != FX, F != FY, is my ugly way of saying that the color field is not the same as the x field and it's also not the same as the y field

I guess I could revise the rule to make it a bit more readable:

hard(no_stack_with_bar_area_discrete_color,E) 
  :- mark(bar;area), channel(E,color), discrete(E), not redundant_color(E), not stack(_).

redundant_color(E) :- channel(E,color), field(E,F), field(EX,FX), F = FX.
redundant_color(E) :- channel(E,color), field(E,F), field(EY,FY), F = FY.

@domoritz
Copy link
Member

EX and EY are just encodings and you never say that they are the x or y encoding, though.

@light-and-salt
Copy link
Member Author

Right, so it should be

hard(no_stack_with_bar_area_discrete_color,E) 
  :- mark(bar;area), channel(E,color), discrete(E), not redundant_color(E), not stack(_).

redundant_color(E) :- channel(E,color), field(E,F), channel(EX, x), field(EX,FX), F = FX.
redundant_color(E) :- channel(E,color), field(E,F), channel(EY, y), field(EY,FY), F = FY.

@domoritz
Copy link
Member

This should be the same as this, right?

hard(no_stack_with_bar_area_discrete_color,E) 
  :- mark(bar;area), channel(E,color), discrete(E), field(E,F), field(EE,F) not channel(EE,x), not channel(EE,y), not stack(_).

@light-and-salt
Copy link
Member Author

yup! looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants