Premium Partner

FMFP

FormalMethodsAndFunctionalProgramming

FormalMethodsAndFunctionalProgramming

Nicht sichtbar

Nicht sichtbar

Kartei Details

Karten 31
Sprache English
Kategorie Informatik
Stufe Universität
Erstellt / Aktualisiert 03.06.2013 / 23.02.2018
Lizenzierung Kein Urheberrechtsschutz (CC0)
Weblink
https://card2brain.ch/box/fmfp
Einbinden
<iframe src="https://card2brain.ch/box/fmfp/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>

Haskel command for absolutvalue of x

(abs x)

REPLACE the following Haskel command with the let syntax:

gcdInt:: Int->int->Int

gcdInt x y = gcdiv (abs x) (abs y)

gcdInt :: Int->Int->Int

gcdInt x y

 let (x',y') = (if x>= 0 then x else -x, if y >= 0 then y else -y)

 in gcdiv x' y'

absolut value of a complex number (a +ib)

conj value of a complex number (a+ib)

multiplication of complex numbers (a+ib)(c+ib)

sqrt(a^2 + b^2)

a-ib

(ac+bd)+i(ad+cb)

Evaluation Rules for Haskel

from outside to inside

from left to right

Order the symboles according to strongness

(strong to week)

-> , /\ , V, ¬

¬,/\,V,->

Is -> right or left associaltive?

right

Is /\ and V right or left-associative?

left

We define A <-> B as (A->B)/\(B->A). Provide suitable introduction and elimination rules for <->.

see image