0

So I have the following:

some sig Person {
    friends : set Person
}

fact TransitiveForThree {
    one p1, p2, p3 : Person {
        p1 in p2.friends && p2 in p3.friends => p1 in p3.friends
    }
}

The idea is that I want there to exist a set of 3 people where they are all friends with each other. However I would like it to be that, there exists a set with at least 3 or more people who are all friends. Can someone explain how to do that with Alloy?

SirGoose
  • 131
  • 1
  • 2
  • 7

2 Answers2

0
fact three_friends {some disj p, q, r : Person | p+q+r -> p+q+r in friends}

Untried! It does force the three Persons in the clique to be friends with themselves. You will need to set the scope to contain at least 3 Person.

user1513683
  • 419
  • 2
  • 4
0
sig Person {friends: set Person}
run {some s: set Person | #s >= 3 and s->s in friends}
Daniel Jackson
  • 2,738
  • 12
  • 5