Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Prolog declarative database Exercise 2: Arbiter Arbiter is a mechanism for allocating resources eciently in concurrent systems. The purpose of this exercise is to model
Prolog declarative database
Exercise 2: Arbiter
Arbiter is a mechanism for allocating resources eciently in concurrent systems. The purpose of this exercise is to model an arbiter which allocates resources to two processes P and Q in such a way that every process eventually gets the requested resource. The following constraints apply for resource sharing between processes:
R is a nite set of resources.
for r R there exists tr N, denoting the maximum utilization time.
a process can request the arbiter for any resource in R.
arbiter will accept all requests from P and Q.
every resource requested by a process should be allocated to it by the arbiter.
a process which received a resource r at time t must return it to the arbiter before time t + tr.
Here is the EFSM specication for the system:
Simulation and assignment
Use Prolog program to translate the specification into a declarative database, and define the following rules:
1. Rule get_events succeeds by obtaining a collection of state, event pairs where event is a legal event on state.
2. Rule get_actions succeeds by obtaining a collection of all actions that the system can perform.
3. Rule path reads a state and succeeds by obtaining a collection of state-event pairs that can lead from the initial state to the given state. For simplicity, do not consider nested states, i.e. the rule applies to a single level of abstraction.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started