logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Darshan MaheshwariEducation
(/5)

920 Answers

Hire Me
expert
Tracey UllmanAccounting
(5/5)

614 Answers

Hire Me
expert
Kimberley ChenCriminology
(5/5)

669 Answers

Hire Me
expert
Liam PattersonEnglish
(5/5)

957 Answers

Hire Me
Others
(5/5)

This practical is aimed at designing and implementing automated reasoning solutions.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

1 Objective

This practical is aimed at designing and implementing automated reasoning solutions.

 

1.1 Competencies

Develop experience in programming in Prolog

Develop experience in modelling a logic problem

Develop experience in using an automated reasoning engine

 

2 Practical Requirements

You are required to implement the following exercises using GNU Prolog1. Please see Section

3.1 for information on how to structure the submission. Additional notes:

Each exercise specifies a problem and asks you to write a set of clauses with a specific head, please adhere to these instructions.

Please also note you are free to add any additional subclause to achieve the require- ments, and you can reuse already written clauses as subclauses for other requirements.

Each solution should be implemented in a different file called respectively ‘ex1.pl’,‘ex2.pl’, ‘ex3.pl’, etc.

Two queries are expected to be written per required clause. These queries should be placed by completing a correspondent test file ‘ex1test.pl, ‘ex2test.pl’,‘ex3test.pl’, etc. See instructions in Section 3.2 on how to prepare these files.

1GNU Prolog, http://www.gprolog.org, also available on the lab machines.

 

2.1 Exercise 1 - Software Requirements Audit Trails

We are tasked to design a system that holds information regarding software development, from objectives, requirements, development of components, to functionalities, so that it is eas- ier for a software engineer to query requirements and dependencies when developing a piece of software. The system will facilitate analysis of audit trails and should be able to respond to explanations as to why a specific functionality was developed and what objectives it serves. You are required to model a simplified version of the problem as follows:

 

The development of a piece of software is motivated by a set of objectives. Each objec- tive can be broken down into software requirements, where each requirement may depend on one or more objectives. Each requirement may be addressed by a number of components. Each component may depend on one or more requirements. Components can be atomic (a single component) or may be compound, which means that a component may have one or more subcomponents, which in turn may be atomic or compound. No component A can be a subcomponent of a component B, if B is already a subcomponent of A; in other words there are no cycles in the component relationships. A single functionality depends on a single atomic component in the system. Each functionality has also an associated priority number, which is a positive integer where the lower values indicate the higher priority for development (eg. 1 has absolute high priority, 100 has low priority).

 

For example, assume the following objectives, requirements, components and functionalities:

Objective obj: develop a calculator app

Requirement rq: the user must be able to enter the formula to be calculated through an interface

Component cp1: calculator interface

Component cp2: plus button

Component cp3: addition calculator

Functionality ft1: visualise a plus on the interface when pressed, with priority 1

Functionality ft2: calculates the result of the addition, with priority 2

With the above definitions, rq is a requirement depending on obj, which in turn is fulfilled by (at least) two components: a compound component cp1, and an atomic component cp3. cp2 is a subcomponent of cp1. The functionalities ft1 and ft2 depend on the atomic components cp2 and cp3 respectively.

 

For this task you are required to:

A. Provide sufficient facts to illustrate elements and relationships in this scenario

B. Complete the following Prolog clauses to fulfil each of following requirements

C. Provide two queries per requirement to demonstrate their usage Clauses:

1. haveSameObj(R1,R2):-... checks whether two different requirements R1 and R2 have

been formulated for the same objective.

 

2. belongsTo(A,B):-... checks whether the relationship where A depends on B is true, where each variable A,B can be either an objective, a requirement, a component or a functionality.

3. shareDevelop(F1,F2):-... checks whether two functionalities F1,F2 have a common objective, a common component or a common requirement.

4. printAllCom(O):-... prints all components fulfilling an objective O, one per line, re- gardless of whether they are compound or atomic. It is ok to print duplicates.

5. isCompound(C):-... determines whether a component C is compound.

6. printAllAtomic(R):-... prints all atomic components that are dependent on a require- ment R.

7. hasPriorityCom(C1,C2):-... checks whether an atomic component C1 has higher pri- ority over another atomic component C2 on the basis of the functionalities they implement.

8. hasHigherPriority(F,N):-... checks whether a functionality F has higher or equal priority than a given number N.

You are free to use hypothetical values for this exercise (e.g. obj,rq, …).

 

2.2 Exercise 2 - Logic Trees & Truth Values

In this exercise, we intend to develop an automated truth calculator for propositional logic that helps compute a truth value of a propositional formula. We assume that our input formula only contains operators , , , which we refer to with the following constants and, or, imp, not respectively. Our system assumes that a formula has already been parsed, and a binary tree representing it has been stored in the knowledge base. In particular, nodes of the tree are facts with the structure node(ID,P,LC,RC) representing the following information: ID identifies the node, e.g.  ix; P  is an element representing either a i) proposition if the node is a leaf or ii) an operator ∧, ∨, →, ¬ if this is an internal node; LC and RC are pointers to its two children, e.g., il,ir. Note that ‘void’ can be used if the child of the node is not present, and for operator we assume that the left-hand side child is void.

An example tree is provided in Figure 1 representing the formula ((R ∨ Q) ∧ (¬P )).

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme