vak: (Default)
Serge Vakulenko ([personal profile] vak) wrote 2025-06-11 09:45 pm (UTC)

Починил я питоновскую версию, теперь не глючит.
$ ./minimize-boolean-function.py
2-variable input: [0, 1, 0, 1]
          result: B
3-variable input: [0, 1, 'X', 0, 1, 0, 'X', 1]
          result: AB + A~C + ~A~BC
3-variable input: [0, 1, 0, 1, 'X', 1, 'X', 0]
          result: ~AC + ~BC
4-variable input: [0, 1, 'X', 0, 1, 0, 0, 1, 'X', 0, 0, 1, 0, 1, 'X', 1]
          result: ABD + ACD + ~AB~C~D + ~A~B~CD + BCD
4-variable input: [1, 0, 'X', 0, 0, 1, 0, 'X', 0, 0, 1, 0, 'X', 0, 0, 1]
          result: ~ABD + ~A~B~D + BCD + ~BC~D
5-variable input: ['X', 0, 0, 1, 0, 0, 0, 0, 0, 1, 'X', 0, 0, 0, 0, 0, 0, 1, 0, 0, 'X', 0, 0, 0, 0, 1, 0, 0, 0, 0, 'X', 1]
          result: ABCD + A~C~DE + ~A~B~CDE + B~C~DE
8-variable input: ['X', 'X', 'X', 'X', 'X', 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
          result: ABCDEFGH + ~ABC~D~EF~G~H + ~A~B~C~D~FG~H

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org