added constraint

This commit is contained in:
Lukian 2025-01-17 14:14:36 +01:00
parent ebac675b3b
commit a4fc5e5fe8
2 changed files with 84 additions and 79 deletions

View file

@ -41,7 +41,12 @@ end
class Flotte
operations
ajouterBateau(bateau: Bateau)
ajouterBateau(bateau: Bateau)
constraints
inv: bateaux->select(b: Bateau | b.type = TypeBateau::Torpilleur)->size() = 1
inv: bateaux->select(b: Bateau | b.type = TypeBateau::Contre_Torpilleur)->size() = 2
inv: bateaux->select(b: Bateau | b.type = TypeBateau::Croiseur)->size() = 1
inv: bateaux->select(b: Bateau | b.type = TypeBateau::Porte_Avions)->size() = 1
end
class Coup