Closed t184256 closed 3 years ago
Rationale for the counterproposal:
True or
/ False and
or True
and and False
should do the same to maintain commutativityX and True
is X
and X or False
is X
in boolean logicTrue and X
is X
and False or X
is X
holds true even outside of boolean logic (e.g. with Python's short-circuiting evaluator)CannotDecide
taints every other operation with CannotDecide
to err on the safe side (and to have a clear safe side)HI, I can imagine, also some command line option what will do some tweaking of some default values.
I can imagine, some fallback syntax, eg.
when you will have e.g. filter: X and Y or Z
, I can imagine some syntax like
filter: X[True] and Y[False] or dist <= centos-8[False]
, what will use this default value if variable is not defined.filter: X:=True Y:=False dist:=centos-9 X and Y or dist <= centos-8
or this will assign some default value to variables if they are not defined, and then logic formulas will be same.What will add very powerful tooling. and will be nice
@jscotka Thanks for the idea, lets discuss it there and leave this issue just for CannotDecide problem
This is documented:
But it's absolutely counterintuitive.
Consequential weird things:
distro < rhel-8 and distro < fedora-33
:True
forfedora-32
,False
forfedora-99
distro < rhel-8 or distro < fedora-33
:True
forfedora-32
,False
forfedora-99
Counter-proposal:
CannotDecide and True
=True and CannotDecide
=CannotDecide
CannotDecide and False
=False and CannotDecide
=False
CannotDecide or True
=True or CannotDecide
=True
CannotDecide or False
=False or CannotDecide
=CannotDecide