Skip to content

Instantly share code, notes, and snippets.

@thelissimus
Created January 13, 2026 13:49
Show Gist options
  • Select an option

  • Save thelissimus/1f668717e403d7e2ee2016ae4e95e8de to your computer and use it in GitHub Desktop.

Select an option

Save thelissimus/1f668717e403d7e2ee2016ae4e95e8de to your computer and use it in GitHub Desktop.
enum Person { Alice, Bob, Rafa }
enum Language { English, Ithkuil }
one sig Room {
people : set Person
}
fun speaks : Person -> Language {
Alice -> English +
Alice -> Ithkuil +
Bob -> English
}
pred canSpeak[p : Person, l : Language] {
l in speaks[p]
}
assert everybodySpeaksEnglish {
all p : Room.people | canSpeak[p, English]
}
assert notEverybodySpeaksEnglish {
some p : Room.people | not canSpeak[p, English]
}
fact { Room.people = Alice + Bob + Rafa }
check everybodySpeaksEnglish
-- Counterexample found. Assertion is invalid.
check notEverybodySpeaksEnglish
-- No counterexample found. Assertion may be valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment