File tree Expand file tree Collapse file tree 5 files changed +46
-0
lines changed Expand file tree Collapse file tree 5 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -663,6 +663,12 @@ def __or__(
663
663
) -> 'Operator' :
664
664
r"""Disjunction `self \/ other`."""
665
665
666
+ def __xor__ (
667
+ self ,
668
+ other
669
+ ) -> 'Operator' :
670
+ r"""Exclusive or `self + other`."""
671
+
666
672
def implies (
667
673
self ,
668
674
other
Original file line number Diff line number Diff line change @@ -812,6 +812,13 @@ def __or__(
812
812
) -> _Ref :
813
813
return self ._apply ('or' , other )
814
814
815
+ def __xor__ (
816
+ self ,
817
+ other :
818
+ _Ref
819
+ ) -> _Ref :
820
+ return self ._apply ('xor' , other )
821
+
815
822
def implies (
816
823
self ,
817
824
other :
Original file line number Diff line number Diff line change @@ -451,3 +451,11 @@ cdef class Function:
451
451
) -> Function:
452
452
r = buddy.bdd_or(self .node, other.node)
453
453
return Function(r )
454
+
455
+ def __xor__(
456
+ self ,
457
+ other:
458
+ Function
459
+ ) -> Function:
460
+ r = buddy.bdd_xor(self .node, other.node)
461
+ return Function(r )
Original file line number Diff line number Diff line change @@ -3126,6 +3126,19 @@ cdef class Function:
3126
3126
self .manager, self .node, other.node)
3127
3127
return wrap(self.bdd , r )
3128
3128
3129
+ def __xor__(
3130
+ self:
3131
+ Function ,
3132
+ other:
3133
+ Function
3134
+ ) -> Function:
3135
+ if self.manager != other.manager:
3136
+ raise ValueError(
3137
+ '`self.manager != other.manager`')
3138
+ r = Cudd_bddXor(
3139
+ self .manager, self .node, other.node)
3140
+ return wrap(self.bdd , r )
3141
+
3129
3142
def implies(
3130
3143
self:
3131
3144
Function ,
Original file line number Diff line number Diff line change @@ -1036,3 +1036,15 @@ cdef class Function:
1036
1036
sy.LACE_ME_WRAP
1037
1037
r = sy.sylvan_or(self .node, other.node)
1038
1038
return wrap(self.bdd , r )
1039
+
1040
+ def __xor__(
1041
+ self:
1042
+ Function ,
1043
+ other:
1044
+ Function
1045
+ ) -> Function:
1046
+ if self.bdd is not other.bdd:
1047
+ raise ValueError((self , other ))
1048
+ sy.LACE_ME_WRAP
1049
+ r = sy.sylvan_xor(self .node, other.node)
1050
+ return wrap(self.bdd , r )
You can’t perform that action at this time.
0 commit comments