File tree Expand file tree Collapse file tree 3 files changed +13
-27
lines changed Expand file tree Collapse file tree 3 files changed +13
-27
lines changed Original file line number Diff line number Diff line change 1
1
//! Numeric identifiers for variables and Boolean literals
2
- pub use imctk_lit:: { lit :: Lit , pol :: Pol , var :: Var } ;
2
+ pub use imctk_lit:: { Lit , Pol , Var } ;
Original file line number Diff line number Diff line change 1
1
//! Numeric identifiers for variables and Boolean literals
2
- #![ allow( missing_docs, dead_code) ] // FIXME prototyping
2
+ mod lit;
3
+ mod pol;
4
+ mod var;
3
5
4
- pub mod lit;
5
- pub mod pol;
6
- pub mod var;
6
+ pub use lit:: Lit ;
7
+ pub use pol:: { Negate , NegateInPlace , Pol } ;
8
+ pub use var:: Var ;
Original file line number Diff line number Diff line change @@ -156,33 +156,23 @@ impl ops::Not for &'_ Pol {
156
156
}
157
157
}
158
158
159
+ /// Subtrait of `ops::Not` and `ops::BitXor<Pol>` for types that support Boolean negation.
160
+ ///
161
+ /// Types that implement `Negate` and `Clone` should also implement `Negate` for references.
159
162
pub trait Negate :
160
163
Sized
161
164
+ ops:: Not < Output = <Self as Negate >:: Negated >
162
165
+ ops:: BitXor < Pol , Output = <Self as Negate >:: Negated >
163
166
{
164
167
// Not called Output as that's ambiguous with the supertrait's Output
168
+ /// The common output type when invoking the `!` or `^` operator.
165
169
type Negated ;
166
-
167
- #[ inline( always) ]
168
- fn negate ( self ) -> <Self as Negate >:: Negated
169
- where
170
- Self : Sized ,
171
- {
172
- !self
173
- }
174
-
175
- #[ inline( always) ]
176
- fn apply_pol ( self , pol : Pol ) -> <Self as Negate >:: Negated {
177
- self ^ pol
178
- }
179
170
}
180
171
172
+ /// Subtrait of `Negate` and `ops::BitXorAssign<Pol>` for types that support in-place Boolean negation.
181
173
pub trait NegateInPlace : Negate < Negated = Self > + ops:: BitXorAssign < Pol > {
174
+ /// Performs `ops::Not::not` in-place.
182
175
fn negate_in_place ( & mut self ) ;
183
- fn apply_pol_in_place ( & mut self , pol : Pol ) {
184
- * self ^= pol;
185
- }
186
176
}
187
177
188
178
impl ops:: BitXorAssign < Pol > for u64 {
@@ -196,15 +186,9 @@ impl Negate for u64 {
196
186
}
197
187
198
188
impl NegateInPlace for u64 {
199
- #[ inline( always) ]
200
189
fn negate_in_place ( & mut self ) {
201
190
* self = !* self ;
202
191
}
203
-
204
- #[ inline( always) ]
205
- fn apply_pol_in_place ( & mut self , pol : Pol ) {
206
- * self ^= 0 ^ pol;
207
- }
208
192
}
209
193
210
194
impl Negate for & u64 {
You can’t perform that action at this time.
0 commit comments