# Computational Accountability in MAS Organizations with ADOPT
## 5 Case Study: Accountability in the JaCaMo Framework
### Achieving Accountability
An observable property roleProposalRejected(proposer, role) is created;
* acceptProposalForRole(String proposer, String role): implements _accept_proposal(adopt_role(Ag, R))_, and allows the organization's owner to accept an agent's proposal. It creates an observable property roleProposalAccepted(proposer, role);
* declareAdoptionSuccess(String role, String group, String scheme): implements _inform(done (adopt_role(Ag, R)))_, and allows a role player to declare awareness of the powers given by scheme scheme, belonging to group group as a player of role R. An observable property powerAcquired(agent, role, group, scheme) is defined. The execution of this operation completes the role-adoption phase of ADOPT;
* declareAdoptionFailure(String role, String group, String scheme): implements _failure(done (adopt_role(Ag, R)))_, and allows an agent to inform the organization that its role-adoption process failed. An observable property powerAcquisitionFailed(agent, role, group, scheme) is defined. With respect to the goal-agreement phase of ADOPT, instead, the artifact provides operations to the agents for refusing a goal, for proposing themselves as goal achievers, for proposing provisions for it, for agreeing to pursue a goal when the provisions are accepted by the organization, and for declaring goal achievement or failure. At the same time, it allows the organization (i.e., the agent that is the organization's owner) to open a call for goal achievement, to accept or reject provisions proposed by the agents, and to declare that a given provision holds or not. In particular, the operations provided by the artifact are:  
* callForGoal(String addressee, String goal): implements _call_for_proposal(achieve(g))_ and allows the organization's owner to open a call for goal goal addressed to agent addressee, a pendingGoal(addressee, goal) observable property is defined;
* refuseGoal(String goal): implements ADOPT's _refuse(achieve(g))_ and _refuse(achieve(g,pro))_. With this operation, an agent that a goal is addressed to can refuse to achieve it. A refusedGoal(agent, goal) observable property is defined;* proposeProvision(String goal, String provision): realizes the _propose(achieve(g), prov)_ message. An agent can propose a provision provision for goal goal assigned to it. A pendingProvision (agent, goal, provision) observable property is created;
* acceptProvision(String proposer, String goal, String provision): implements _accept_proposal (achieve(g), prov)_ and allows the organization's owner to accept a provision provision proposed by agent proposer for goal goal. An observable property acceptedProvision(proposer, goal, provision) is defined;
* rejectProvision(String proposer, String goal, String provision): conversely, implements _reject_proposal(achieve(g), prov)_, and allows the organization's owner to reject the provision proposed by the agent for the goal. A rejectedProvision(proposer, goal, provision) property is defined;
* requestGoal(String addressee, String goal): implements _request(achieve(g,prov))_ in ADOPT. The organization's owner asks addressee to agree to achieve goal since the provisions proposed by it have been accepted. A requestedGoal(addressee, goal) property is created;
* agreeGoal(String goal): implements _agree(achieve(g, prov))_ and allows an agent to agree to achieve a given goal previously requested. An agreedGoal(agent, goal) property is defined;
* informProvision(String goal, String provision): implements _inform(done(prov))_. The organization's owner agent confirms that a provision provision related to a goal goal is currently holding. This operation defines an observable property holdingProvision (goal, provision);
* failureProvision(String provision): implements _failure(prov)_. The organization's owner agent declares that a provision provision related to a goal goal cannot hold. This operation defines an observable property failedProvision(provision). * informGoal(String goal): implements _inform(done(achieve(g,prov)))_. It allows an agent to confirm that a goal has been achieved.