Created
August 10, 2013 13:42
-
-
Save MHenderson/6200476 to your computer and use it in GitHub Desktop.
Essence' description of PSSSODLS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language ESSENCE' 1.0 | |
given n : int | |
letting Indices be domain int(0..n-1) | |
letting Symbols be domain int(0..n-1) | |
letting symbol_sum be (n*(n-1)/2) | |
find P: matrix indexed by [Indices, Indices] of Symbols | |
such that | |
$ all rows have to be different | |
forAll row : Indices . | |
allDiff(P[row,..]), | |
$ all columns have to be different | |
forAll col : Indices . | |
allDiff(P[..,col]), | |
$ pandiagonality constraints | |
forAll w : Indices . | |
(sum i: Indices . | |
P[i, (i + w) % n]) = symbol_sum /\ | |
(sum i: Indices . | |
P[i, (w - i) % n]) = symbol_sum , | |
$ strongly-symmetric constraints | |
forAll i,j : Indices . | |
P[i, j] + P[n - 1 - i, n - 1 - j] = n - 1, | |
$ orthogonality constraints | |
forAll i,j,k,l : Indices . | |
i<k \/ j<l -> P[i,j] != P[k,l] \/ P[j,i] != P[l,k] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language ESSENCE' 1.0 | |
letting n be 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment