FM-Assignment 1
FM-Assignment 1
of Computer & E m e r g i n g S c i e n c e s, I s l a m a b a d
Assignment 01
Semester: Spring 2025 (FM)
Course Instructors:
Ms. Nigar Azhar Butt, Dr. Isma ul Hassam, Ms. Laiba Imran
Sections: All
Instructions
• Read the instructions very carefully.
• Late assignments will not be accepted
• Plagiarism may result in zero marks in the whole assignments category (all
assignments) regardless of the percentage plagiarized.
• There will be no credit if the given requirements are changed.
• This is an individual assignment, meaning you must complete it on your own.
Submission Guidelines
Question 2:
For the following translate to Propositional Logic, and verify semantic entailment via
following:
a) Clearly describe the propositional atoms. Make sure the names of your propositional
atoms are understandable.
b) Translate premises.
c) Create the semantic entailment formula.
d) Create complete truth tables
e) Attach screenshots of SAT solver for validity and describe what the SAT solver is saying
if validity does not hold.
Scenario 1: Climate Model
Premise 1: If the climate model is accurate, the input data is reliable, and the
computational resources are sufficient, then the model will accurately predict future
climate patterns.
Premise 2: The model's predictions were inaccurate.
Premise 3: The input data is reliable.
Premise 4: The computational resources were sufficient.
Conclusion: Therefore, the climate model is inaccurate.
Scenario 5: Taxi
Premise 1: If the car has a flat tire or there is no gas, the driver will be late for the
appointment unless they take a taxi.
Premise 2: The driver was not late for the appointment.
Premise 3: The car had a flat tire.
Conclusion: Therefore, the driver took a taxi or there was gas.
Question 3:
Use propositional logic to model a real-world software system and verify semantic
entailment based on logical premises. Additionally, demonstrate a case where semantic
entailment does not hold due to inconsistencies or missing conditions.
a) Select a Real-World Software System
• Choose a real-life software application such as an e-commerce platform, banking
system, hospital management system, or cloud security system.
b) Define Logical Premises (5-6 Premises)
• Identify key rules, conditions, or constraints in the chosen system.
• Express these rules using propositional logic statements.
• Example (Online Banking System):
o Premise 1: "If a user enters the correct username and password, they can log
in." translates to (p→ q) where:
§ p = "User enters correct credentials"
§ q = "User can log in"
o Premise 2: "If a user is logged in, they can access their bank account." translates
to (q→r) where:
§ r = "User can access bank account"
c) Formulate a Logical Conclusion
• Derive a conclusion based on the premises:
o Conclusion: "A user enters the correct credentials, so. they can access their
bank account." (p→r)
d) Verify Semantic Entailment
• Use Limboole or a SAT solver to verify: {(p→q),(q→r)}⊨ (p→r)
• Attach screenshots of SAT solver.
e) Modify the Premises to Introduce an Inconsistency
• Create a scenario where the logical conclusion does not follow from the premises.
• Example (Banking System - Inconsistent Rules):
o Premise 1: "If a user enters the correct credentials, they can log in." (p→q)
o Premise 2: "If a user is logged in, they can access their bank account." (q→r)
o Premise 3 (Contradiction Introduced): "Some users may log in but not have
access to their bank account." (q∧¬r)
f) Formulate a Conclusion That Fails
• Proposed Conclusion: "All users who log in can access their bank account." (q→r)
• Contradiction: Premise 3 explicitly states that some users who log in do not get access
to their account.
g) Verify That Semantic Entailment Fails
• Use Limboole or a SAT solver to check:{(p→q),(q→r),(q∧¬r)}⊨(q→r)
• Attach screenshots of SAT solver for validity
Question 4:
For the following Role-based access Control scenarios, answer the following:
1. Provide Declarative Access rules corresponding to the tables in propositional logic.
Make sure the names of your propositional atoms are understandable.
2. Provide translations of constraint to propositional logic
3. Provide formula to prove validity of constraints in context of Role-based access
controls.
4. Identify valid and invalid constraints individually and give reasons. (Use SAT solver,
no need for truth tables)
5. Incase of invalid constraints identify if and how a specification can be added that
would make it valid without changing the role based access table.
Constraints:
• Doctors, nurses and lab technician must be able to access Lab results.
• Only doctors may access prescriptions.
• A person can be Nurse and Medical assistant.
• A person cannot be a receptionist and a lab technician.
• Lab technicians can only access lab results.
Constraints:
Constraints:
Best of Luck J