[Community Puzzle] Propositions in Frege’s ideography

https://www.codingame.com/training/medium/propositions-in-freges-ideography

Send your feedback or ask for help here!

Created by @nicola1,validated by @Niako,@anon355613 and @lhm.
If you have any issues, feel free to ping them.

What is A NOR B ?

1 Like

It’s NOT (A OR B) but you don’t need it to code a solution, eventually for debugging.

Thanks I meant more the Ascii art behind A NOR B but I found a bug in my code.

For others : it is like NOT (A OR NOT NOT B)

+---- A

  '-+ B
3 Likes

Phew! Parsing is interesting.

One of these days, I’m going to convince myself it’s ok to use recursion for codingame puzzles rather that explicitly managing a stack in an iterative loop…

I used recursion without parsing.

For those who have passed all test cases and could not get 100%, I found ORDER matters!
Always print false case first.

like XOR case:
correct:
A False B True
A True B False
A True B True

wrong: (WEIRD)
A True B True
A True B False
A False B True

1 Like

It’s written in the statement (lexicographical order)!

Thanks for the cool puzzle. I have two questions though.

  1. “A implies B” gives me: " Expected: A True B False"

How can that be? Shouldn’t A and B always be the same value? Maybe this shows my lack of knowledge in formal logic but I am confused.

  1. “(C and B) implies A is not a tautology” gives me:
    Found: “A False B False C False”
    Expected: “A False B True C True”

Why does “False, True, True” come before “False, False, False”? Shouldn’t it be lexicographical ordered?

Thanks in advance for an answer, I am quite the newbie here and am quite proud to have come so far in the solution. :slight_smile:

Because [(False and False) implies False] is True.

Hello there,

“A implies B” means “not A or B”, you can also see that this way : “not (A and not B)”. It means you can’t have A=True and B=False.
But the situation A=False and B=True is okay.
For example “(Raining) implies (Clouds)” is still True even if this situation is possible :
A. it is not raining (A=False) and
B. there are clouds (B=True).

1 Like

Now I see my error. I treated the implication like an operation. If A is True then b is true. Whereas in reality you need to take the whole statement and look at the truth value.

If I had read the statement better. Especially the sentence “If it is not a tautology, write down each case for which the statement is False”. I would have seen it. thanks a lot. I guess this will probably also solve the sorting issue.

Thanks for the help.

1 Like

Great puzzle! The parsing part is as fun as the logic part, I loved it!

By the way, always sending “TAUTOLOGY” validates 66% of the puzzle, and the unresolved validators have very descriptive names, so I was able to hard code it on a second try.

This should be in the test set. Otherwise difficult to resolve having 100% tests.

1 Like

There’s something i don’t understand with the validators, my code is all green in IDE but fail validator 3, 8 and 9
I tried the A NOR B
±- A
'- B
my answer : A True B False

I also tried (C implies B) implies A
----- A
'— B
'- C
my answer: A False B True C True

I can’t see where i’m doing it wrong.

NOT (A OR B) is False when A is True or when B is True.
You missed two cases.

3 Likes

Ok, i have now achieved the 100% and i thank you for this puzzle.
My mistake was assuming it was only waiting one line answer (i know that i didn’t read well the waiting output)
However i think that adding a test with multiple failed statement should be a good idea to prepare for validators.

“Without parsing”? You listed “parsing” as one of the skills! :face_with_raised_eyebrow:

FWIW: I didn’t really parse, either…More like transcoding–to a Python expression for use with eval().

I’d publish, but the forced evaluation screens don’t work in Firefox Beta, and I don’t feel like switching to Edge (which does work, here anyway.)

Without parsing the logical expression, but of course I needed to parse the ASCII.

I’ve got 88% with last one failed. Can you please provide test string, so I can test in IDE? Thanks!

The one I am failing: [(C and B) implies A] implies [(C implies B) implies A] is not a tautology