Implement haskell function to encode the logical constraints

Assignment Help Theory of Computation
Reference no: EM132979924

The logic of equality. Is it possible to assign values to the variables a, b, c, and d, so that the formula (a=b)∧(b=c)∧(c=d)∧¬(a=d) is true? How about the formula (a=c) ⇔ (¬(a=b)∨¬(b=c))? These are examples of satisfiability questions in the system of equality logic. A formula in equality logic includes a collection of variables, such as a, b, c, and d. These variables are related to one another by equalities, such as (a=b). Equalities are assembled into formulas using connectives, like the ones we are familiar with from propositional and predicate logic: ∧, ∨, ¬, ⇒, ⇔, and ⊕. An equality logic formula is satisfiable if there is some assignment of values to its variables that makes the formula evaluate to true, under the usual semantics of equality and the logical connectives.

Task overview. In this challenge, you will complete an implementation of a satisfiability decision procedure for equality logic formulas. The decision procedure will work as follows:
1. You will devise a way of modelling an equality logic formula as an equisatisfiable propositional logic formula, using the strategy below.
2. You will implement this modelling strategy as a Haskell function that translates equality logic formulas into propositional logic formulas, supported by some scaffolding code we provide. We break this step down into four implementation tasks, described below.
3. We provide a satisfiability algorithm for propositional logic, which will decide whether your propositional formula (and thus also the original equality logic formula) is satisfiable or not.

The strategy. The key to satisfying an equality logic formula in is knowing which variables to assign to the same values. If we know whether or not each pair of variables shares a value, we have all we need to evaluate the formula. If this information were to be encoded in propositional logic, what propositions might we use? To encode an equality logic formula in propositional logic is to use these propositions to capture the logical structure of the original formula, along with the special properties of the equality relation, in a single propositional formula. The four tasks below will guide you to capturing this strucure.

Task A. Using your propositional variables, implement a Haskell function to encode the logical constraints implied by an equality logic formula's connectives as a formula in propositional logic.

Task B. Equality is a reflexive relation: A variable always equals itself, so a formula like (a=a) is always true in equality logic. Using your propositional variables, implement a Haskell function to encode the constraints implied by this property as a formula in propositional logic.

Task C. Equality is also a symmetric relation: Equality can't be true in one ‘direction' and not the other. (a=b) and (b=a) are equivalent in equality logic. Using your propositional variables, implement a Haskell function to encode the constraints implied by this property as a formula in propositional logic. Hint: Depending on your propositional variables, this may be a short formula.

Task D. Finally, equality is a transitive relation: Equalities chain together. If we know (a=b) and (b=c), then we must have (a=c) too, even if this is not specified directly in an equality logic formula. Using your propositional variables, implement a Haskell function to encode the constraints implied by this property as a formula in propositional logic. Hint: For each individual group of three variables, consider all of the ways in which the transitive property could affect the formula.

Reference no: EM132979924

Questions Cloud

Explain what it means in terms of natural numbers : Provides a sequence of most general unifiers, one per resolution step, and when these are composed, in the order they were generated, you have a substitution
What is the profit or loss : Use the profit formula to determine whether Benjamin's Backpacks makes a profit or loss if it sells 10 backpacks. What is the profit or loss
Determine whether g is valid or not : Determine whether G is valid or not. Either provide a proof that uses resolution to show validity, or else specify an interpretation that makes G false
By how much share premium would increase on February : A corporation was organized in January 2016 with authorized capital of P10 par value ordinary shares. By how much share premium would increase on February
Implement haskell function to encode the logical constraints : Implement a Haskell function to encode the logical constraints implied by an equality logic formula's connectives as a formula in propositional logic
Design a circuit that is not minimal for a given function : Design such a circuit, using as few gates as possible. You can define any number of sub-circuits to help you reduce the gate count (simply give each a name)
Writing a haskell function : Writing a Haskell function that turns an arbitrary propositional formula into an equivalent one that uses only ? and f (plus any parentheses or propositional
Understanding of propositional logic : Understanding of propositional logic and first-order predicate logic, including their use in mechanised reasoning - Capture, as a single propositional formula
What is the asset turnover for the company : What is the Asset turnover for the company? Calculate the profit margin ratio of the company and comment on the profitability performance of the company.

Reviews

Write a Review

Theory of Computation Questions & Answers

  What does a hadamard gate do

Draw a simple quantum circuit with three qubits that returns 1111)> with certainty - What does a Hadamard gate do

  Describe the concept of the universal turing machine

What is the UTM? Describe the concept of the universal Turing machine. Explain how such a machine can be built.

  What is a compiler

What is a compiler? What are the differences between top down and bottom up parser (explain your answer by using appropriate example)

  We have two versions of tn above depending on whether we

question we have two versions of tn above depending on whether we use a constant c or not. explain why the two versions

  Show polynomial-time algorithm for gdp

Goal is to find expedition of maximum profit. Either show that there exists polynomial-time algorithm for GDP, or show that corresponding decision problem is NP-complete.

  FIT3139 Computational modelling and simulation Assignment

FIT3139 Computational modelling and simulation Assignment Help and Solution, Monash University - Assessment Writing Service

  Construct a syntax directed translation scheme

Construct a syntax-directed translation scheme that trans-lates arithmetic expressions from postfix notation into infix notation.

  Review of literature based on past and current work

Analyse what is expected of you. This includes careful reading of the assignment task as specified in the Subject Outline. The executive summary of the research

  Show that each word problem is a valid argument

If the interest rates drop then the housing market will improve. Either the federal discount rate will drop or construction will decrease. Interest rates will drop and utility prices will go down.

  Write down binary representation of decimal number

Calculate the sum of 2.6125 X 101 and 4.150390625 X 10-1 by hand, assuming A and B are stored in the 16-bit half precision described in exercise 3.27. Assume 1 guard, 1 round bit, and 1 sticky bit, and round to the nearest even. Show all steps.

  Construct a regular expression

Construct a regular expression the accepts the same language as the above NFA - cross product construction and also the powerset construction

  CSC 340 Programming Languages and Compilation Assignment

CSC 340 Programming Languages and Compilation Assignment Help and Solution, King Saud University - Assessment Writing Service

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd