Suoritettu

scala programming language

I have done this solution but required some changes as mentioned below

you have

def isFormula(e: Expr): Boolean =

e match {

case Lit(x) = > x == 0 II x = = 1

case Var(x) => true

case Two("&&", -' e1, e2) = > isFormula(e1) &&

isFormula(e2)

case Three("//", -' e1, e2) = > isFormula(e1) &&

isFormula(e2)

}

but this is not proper Scala syntax and the case Three is totally wrong as

there are no expressions with 3 operands. The One case is missing too.

it should be something like

def isFormula(e: Expr): Boolean =

e match {

case Lit(x) => x == 0 || x == 1

case Var(x) => true

case Two("&&", op, e1, e2) => isFormula(e1) && isFormula(e2)

case Two("//", op, e1, e2) => isFormula(e1) && isFormula(e2)

}

So try to add the One case to this and add to the Two cases also the ‘implies' and ‘equiv’.

In the isTautology you have

def isTautology(e: Expr): Option[Boolean] = {

// First of all, check that e represents a formula. If not, then

// no meaningful analysis can be applied, so return None.

if (!isFormula(e))

None

// At this point e must be a logical expression so the following

// code will determine whether or not it represents a tautology.

e match {

case Lit(x) = > x != 0 II x != 1

case Var(x) => true

case Two("&&", -' e1, e2) = > !isFormula(e1) &&

!isFormula(e2)

case Three("//", -' e1, e2) = > !isFormula(e1) &&

!isFormula(e2)

}

}

but of course this doesn’t make any sense at all as you just pasted

a bit of the isFormula into it and put in a negation in the operands.

So try first to make the isFormula working.

I need this solution within 1 days.

Taidot: Scala, Java

Näytä lisää: point sale solution software programming language, programming count days, programming language logo flash, job programming language kathamandu, pic lcd programming language, typing programming language, logo block programming language download, find programming job using softwareag natural programming language, trading platforms programming language, best programming language cisco ios hack, oscommerce programming language, betfair programming language, centsports programming language, scala programming language, programming language syntax, pascal programming language syntax, syntax of ada programming language, syntax of a programming language, programming language syntax comparison, racket programming language syntax

Tietoa työnantajasta:
( 0 arvostelua ) India

Projektin tunnus: #28960684

Myönnetty käyttäjälle:

maround95

Hi I can help you with this. I've done a lot of functional programming and I love it. I'd like to know about this more.

£50 GBP 1 päivässä
(1 arvostelu)
1.2

3 freelanceria on tarjonnut keskimäärin £109 tähän työhön

nmogilip

Hi, I am a certified developer, Used Scala for most of my applications and deployed successfully with in the timeframe. Please let’s discuss and discuss more on problems which you are facing. Thank you, Naresh

£222 GBP 7 päivässä
(7 arvostelua)
4.2
kendracherii

Hello successful buyer My name is Ana I have go through your request and its fully understand I do your work perfectly And I will deliver your work within 24 hours Kindly contact me for more discussion on this proj Lisää

£56 GBP 2 päivässä
(0 arvostelua)
0.0