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

Partition unit tests #91

Open
2 tasks
yuriy0 opened this issue Jun 20, 2017 · 0 comments
Open
2 tasks

Partition unit tests #91

yuriy0 opened this issue Jun 20, 2017 · 0 comments
Assignees

Comments

@yuriy0
Copy link

yuriy0 commented Jun 20, 2017

It is a relatively new and complicated part of the Hakaru simplification process, and almost all test cases contain piecewise and all piecewise will spend some (most) time as Partitions. It stands to reason that Partition could use some unit tests. In #85, we decided this would be a good way of ensuring certain nice properties which we would like on the Haskell side, as implementing Partition on the Haskell side is likely more trouble than it's worth.

  • A corpus of Partitions representative of the typical Partitions that are seen while simplifying Hakaru programs is needed. Collecting such a corpus from the test cases should be straightforward. We should collect both those Partitions which are unsimplified and simplified. This should probably include some sums of Partitions and products of Partitions with scalars.
  • The properties which we want to hold need to be identified. Each property should apply to every Partition in the corpus; potentially, a property may hold on a given unsimplified Partition only after it has been simplified. The properties already known:
    • PWToPartition @ PartitionToPW is the identity
    • PartitionToPW @ PWToPartition is the identity (this is somewhat less necessary)
    • Partition:-Simpl is idempotent
    • x->Partition:-Simpl(x,do_solve) is idempotent
    • (x->PWToPartition(x,do_solve)) @ PartitionToPW is idempotent
    • PartitionToPW @ (x->PWToPartition(x,do_solve)) is idempotent

It's unclear if we want these properties to hold up to list semantics (i.e. propositional equality) or up to SamePartition (which gives set semantics to Partitions).

@yuriy0 yuriy0 self-assigned this Jun 20, 2017
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

1 participant