Skip to content

Commit 27d50b6

Browse files
authored
nullary and unary ands and ors (#96)
* nullary and unary ands and ors * fix
1 parent bdab0ff commit 27d50b6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

cvc5_pythonic_api/cvc5_pythonic.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,15 @@ def And(*args):
17541754
>>> P = BoolVector('p', 5)
17551755
>>> And(P)
17561756
And(p__0, p__1, p__2, p__3, p__4)
1757+
>>> And()
1758+
True
1759+
>>> And(p)
1760+
p
17571761
"""
1762+
if len(args) == 0:
1763+
return True
1764+
if len(args) == 1 and type(args[0]) is not list:
1765+
return args[0]
17581766
return _nary_kind_builder(Kind.AND, *args)
17591767

17601768

@@ -1769,7 +1777,15 @@ def Or(*args):
17691777
>>> P = BoolVector('p', 5)
17701778
>>> Or(P)
17711779
Or(p__0, p__1, p__2, p__3, p__4)
1780+
>>> Or()
1781+
False
1782+
>>> Or(p)
1783+
p
17721784
"""
1785+
if len(args) == 0:
1786+
return False
1787+
if len(args) == 1 and type(args[0]) is not list:
1788+
return args[0]
17731789
return _nary_kind_builder(Kind.OR, *args)
17741790

17751791

0 commit comments

Comments
 (0)