File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ defmodule Crux.Formula do
113113 @ spec from_expression ( Expression . t ( variable ) ) :: t ( variable ) when variable: term ( )
114114 def from_expression ( expression ) do
115115 expression
116- # Expand Booleans so that they do not become variables
117- |> Expression . run ( & & 1 )
116+ |> Expression . balance ( )
117+ |> Expression . simplify ( )
118118 |> case do
119119 true ->
120120 @ simple_true
Original file line number Diff line number Diff line change @@ -23,20 +23,20 @@ defmodule Crux.FormulaTest do
2323
2424 assert % Formula {
2525 cnf: [
26- # :a or not :c
27- [ 1 , - 2 ] ,
28- # not :b or not :c
29- [ - 3 , - 2 ] ,
3026 # :a or :d
31- [ 1 , 4 ] ,
27+ [ 1 , 2 ] ,
3228 # not :b or :d
33- [ - 3 , 4 ]
29+ [ - 3 , 2 ] ,
30+ # :a or not :c
31+ [ 1 , - 4 ] ,
32+ # not :b or not :c
33+ [ - 3 , - 4 ]
3434 ] ,
3535 bindings: % {
3636 1 => :a ,
37- 2 => :c ,
37+ 2 => :d ,
3838 3 => :b ,
39- 4 => :d
39+ 4 => :c
4040 }
4141 } = result
4242 end
You can’t perform that action at this time.
0 commit comments