Assignment 01: Boolean expressions --> Preprocessor

nadolskyy
Windoof-User
Windoof-User
Beiträge: 24
Registriert: 9. Jul 2010 01:30

Assignment 01: Boolean expressions --> Preprocessor

Beitrag von nadolskyy »

I am not sure that understand this task:
the tree must be just free of Any Imp or BiImp, but what is with all other cases?
E.g. case T() should return an BE. Could somebody explain me this task (what should be implemented here and how should like the result in terms of BE)?

nadolskyy
Windoof-User
Windoof-User
Beiträge: 24
Registriert: 9. Jul 2010 01:30

Re: Assignment 01: Boolean expressions --> Preprocessor

Beitrag von nadolskyy »

it’s clear now, I didn’t make intern preprocessing of expressions... :D

DanielAW
Erstie
Erstie
Beiträge: 11
Registriert: 17. Nov 2014 22:47

Re: Assignment 01: Boolean expressions --> Preprocessor

Beitrag von DanielAW »

Hi,

I still got problems in understanding the task. Can someone please explain how to solve implications?
I think just the replacement of logical values like this is not intended?:
  • T, T -> T
  • T, F -> F
  • F, T -> T
  • F, F -> T
When I look at the test example, how do I get from Imp(t, f) to Or(Not(t), f)?

I would realy appreciate some hints here.

Greetings, Daniel

nadolskyy
Windoof-User
Windoof-User
Beiträge: 24
Registriert: 9. Jul 2010 01:30

Re: Assignment 01: Boolean expressions --> Preprocessor

Beitrag von nadolskyy »

It's how the truth table for Imp looks like (I also thought in the beginning how to implement this values from table), but preprocessor should just make expressions free of any Imp or BiImp (Or, Not, And can be inside an expression also after preprocessing step). I understood it so (hope it's correct), once it happened, the task was easy to solve.

DanielAW
Erstie
Erstie
Beiträge: 11
Registriert: 17. Nov 2014 22:47

Re: Assignment 01: Boolean expressions --> Preprocessor

Beitrag von DanielAW »

Hi,

thanks for the explanation! I solved it now too, finally ...

ds72tuqu
Erstie
Erstie
Beiträge: 11
Registriert: 14. Okt 2014 19:31

Re: Assignment 01: Boolean expressions --> Preprocessor

Beitrag von ds72tuqu »

Guys,
Can you please explain, Like
1. if as input I give imp(t,f) it will resolve to expression Or(Not(t), f), if i give imp(imp(t,f),f) or imp(imp(t,and(t,f)),f) it will just substitute imp using equivalent expression
will it not deduct the expressions and come to the result value as t or f?
2. what if And(Imp(t,f),f) is given as input it will expand the tree as And(Or(Not(t), f),f) or after expanding it will deduce to f also?

Talaron
Mausschubser
Mausschubser
Beiträge: 85
Registriert: 26. Apr 2012 11:34

Re: Assignment 01: Boolean expressions --> Preprocessor

Beitrag von Talaron »

Your examples are correct: The preprocessor should not interpret expressions, but just prepare them so you could put the result into the interpreter from the previous task afterwards. So it should just replace for example And(Imp(t,f),f) by And(Or(Not(t), f),f), but not evaluate the resulting value.

Please also look at the test cases if you are unsure. I think they show pretty precisely what to do (and future tasks will also have you look at them if the specification is not 100% exact).

Antworten

Zurück zu „Archiv“