0

I'm having quite a lot of troubles with Event-B..

I'd like to make a relation from a group of client to a client number each

I have a relation of that type :

cli(PERSON) = NAT1 (Person is a finite set)

and in an event I have a subset of person

where group <: PERSON

and I'd like to affect to the cli relation what I'd write intuitively :

! x . x : group | cli(x) = numcli

Am I modelling it the right way? Is there any method to get the affectation I'd like to get?

stkent
  • 19,772
  • 14
  • 85
  • 111
Dr.L
  • 3
  • 2
  • There are several things that are not clear to me: Should cli map a group of persons to a number or map a person to a number? And what is `numcli`? Do you want to assign to each member of group the same number `numcli`? Maybe you can try to express what you want to specify in natural language? – danielp Apr 26 '15 at 12:41
  • Thanks for you answer ! The numcli that I want to map to client are all differents.. for each client of the group. Sorry for bad english, it's surely the main reason why i'm having troubles to make me understood.. :/ – Dr.L May 04 '15 at 11:52
  • Can you explain what do you want to achieve with `cli` and the action that updates `cli`? E.g. "`cli` maps each person known to the system to a distinct number." or "I have a group of persons (with some restrictions) and I want to assign each person in the group a new number in `cli`". Without more info, any answer would be just guessing. – danielp May 05 '15 at 19:04
  • I think i'll explain another parrallel situation : I've got a set of persons and i want in a event to put all the person of this set in another subset. – Dr.L May 11 '15 at 14:57

1 Answers1

0

I'm a little bit guessing what you want to achieve: cli maps a person to a number:

VARIABLES
  cli
INVARIANTS
  cli : PERSON +-> NAT1

You want an event (let's call it ev) that assigns to a group of persons (called group) the same number:

ev = ANY
  group, numcli
WHERE
  group <: PERSON
  numcli : NAT1
THEN
  cli := cli <+ (group**{numcli})
END

group ** {numcli} is a set of pairs (a relation) where the first element is an element of group and the second is numcli. The operator <+ (relational override) removes all elements from cli where the first element if one of its right operand and adds the right operand. I.e. mappings of group in cli are replaced or added to a mapping to numcli.

danielp
  • 1,179
  • 11
  • 26
  • Ok, I've found out where i had a problem ! I was writing {} around group**{numcli} instead of "()" ! thanks alots ! – Dr.L May 11 '15 at 15:29