boolean_simplifier 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,3 +18,4 @@ require "boolean_simplifier/rule/distributivity"
18
18
  require "boolean_simplifier/rule/double_negation"
19
19
  require "boolean_simplifier/rule/idempotence"
20
20
  require "boolean_simplifier/rule/identity"
21
+ require "boolean_simplifier/rule/negation_of_boolean"
@@ -1,6 +1,6 @@
1
1
  module BooleanSimplifier
2
2
  def version
3
- "1.0.0"
3
+ "1.0.1"
4
4
  end
5
5
 
6
6
  def simplify(string)
@@ -0,0 +1,16 @@
1
+ module NegationOfBoolean
2
+ def simplify(expr)
3
+ if expr.class == Negation
4
+ if expr.parts[0] == true
5
+ return false
6
+ elsif expr.parts[0] == false
7
+ return true
8
+ end
9
+ end
10
+
11
+ expr
12
+ end
13
+
14
+ extend self
15
+ Rule.collection << self
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boolean_simplifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -82,6 +82,7 @@ files:
82
82
  - lib/boolean_simplifier/rule/double_negation.rb
83
83
  - lib/boolean_simplifier/rule/idempotence.rb
84
84
  - lib/boolean_simplifier/rule/identity.rb
85
+ - lib/boolean_simplifier/rule/negation_of_boolean.rb
85
86
  - lib/boolean_simplifier/rule.rb
86
87
  - lib/boolean_simplifier.rb
87
88
  homepage: https://github.com/tuzz/boolean_simplifier