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

OPNF should always generate the same number of legal and input propositions #27

Open
samschreiber opened this issue Nov 3, 2013 · 0 comments
Assignees
Labels

Comments

@samschreiber
Copy link
Member

Generated propositional networks for games should have the same number of legal propositions ("move X is legal for player Y") and input propositions ("player Y chose move X"). It's internally inconsistent to have a legal proposition with no corresponding input proposition, since a player could choose that move and the propnet wouldn't be able to simulate it; and it's pointless to have an input proposition with no corresponding legal proposition, since the input proposition could never be set.

On the game "checkersonabarrelnokings" on the "games.ggp.org/stanford" repository, OPNF generates significantly more legal propositions than input propositions. This can be observed with the following code snippet:

PropNet p = OptimizingPropNetFactory.create(new CloudGameRepository("games.ggp.org/stanford").getGame("checkersonabarrelnokings").getRules());
System.out.println(p.getLegalPropositions().get(p.getRoles().get(0)).size());
System.out.println(p.getLegalPropositions().get(p.getRoles().get(1)).size());
System.out.println(p.getInputPropositions().keySet().size());

For most games (connect four, english draughts) the first two numbers added together equal the third number. For this game, the first two numbers added together are nearly double the third number.

Sorting the above results shows differences of this form:

( legal black ( jump 1 1 3 3 ) )
( legal black ( jump 1 1 3 7 ) )
( legal black ( jump 1 3 3 1 ) )
( legal black ( jump 1 3 3 5 ) )
( legal black ( jump 1 5 3 3 ) )
( legal black ( jump 1 5 3 7 ) )
( legal black ( jump 1 7 3 1 ) )
( legal black ( jump 1 7 3 5 ) )

vs.

( does black ( jump 1 1 3 3 ) )
( does black ( jump 1 3 3 5 ) )
( does black ( jump 1 5 3 7 ) )
( does black ( jump 1 7 3 1 ) )

OPNF is creating extra legal propositions, but it's not creating extra input propositions because the input propositions are specified via "input" rules. We should remove the extra legal propositions, or fix the issue that's causing OPNF to generate extra legal propositions in the first place.

@ghost ghost assigned AlexLandau Nov 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants