Skip to content

Commit c3655dd

Browse files
authored
Merge pull request #4649 from JacquesCarette/BoolBinaryOp
Get rid of some unused boolean binary operation
2 parents 02733db + 7e9e9b1 commit c3655dd

File tree

20 files changed

+13
-81
lines changed

20 files changed

+13
-81
lines changed

code/drasil-code/lib/Data/Drasil/ExternalLibraries/ODELibraries.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,6 @@ modifiedODESyst sufx info = map replaceDepVar (odeSyst info)
646646
replaceDepVar (UnaryOpVN u e) = UnaryOpVN u $ replaceDepVar e
647647
replaceDepVar (ArithBinaryOp b e1 e2) = ArithBinaryOp b
648648
(replaceDepVar e1) (replaceDepVar e2)
649-
replaceDepVar (BoolBinaryOp b e1 e2) = BoolBinaryOp b
650-
(replaceDepVar e1) (replaceDepVar e2)
651649
replaceDepVar (EqBinaryOp b e1 e2) = EqBinaryOp b
652650
(replaceDepVar e1) (replaceDepVar e2)
653651
replaceDepVar (LABinaryOp b e1 e2) = LABinaryOp b

code/drasil-code/lib/Language/Drasil/Code/Imperative/Import.hs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Data.List ((\\), intersect)
1818
import Drasil.Code.CodeExpr (sy, ($<), ($>), ($<=), ($>=), ($&&), in')
1919
import qualified Drasil.Code.CodeExpr.Development as S (CodeExpr(..))
2020
import Drasil.Code.CodeExpr.Development (CodeExpr(..), ArithBinOp(..),
21-
AssocArithOper(..), AssocBoolOper(..), AssocConcatOper(..), BoolBinOp(..), EqBinOp(..),
21+
AssocArithOper(..), AssocBoolOper(..), AssocConcatOper(..), EqBinOp(..),
2222
LABinOp(..), OrdBinOp(..), UFunc(..), UFuncB(..), UFuncVV(..), UFuncVN(..),
2323
VVNBinOp(..), VVVBinOp(..), NVVBinOp(..), ESSBinOp(..), ESBBinOp(..))
2424
import Drasil.Database (UID, HasUID(..))
@@ -345,7 +345,6 @@ convExpr (ArithBinaryOp Frac (Lit (Int a)) (Lit (Int b))) = do -- hack to deal w
345345
getLiteral _ = error "convExpr: Rational space matched to invalid CodeType; should be Double or Float"
346346
return $ getLiteral sm
347347
convExpr (ArithBinaryOp o a b) = liftM2 (arithBfunc o) (convExpr a) (convExpr b)
348-
convExpr (BoolBinaryOp o a b) = liftM2 (boolBfunc o) (convExpr a) (convExpr b)
349348
convExpr (LABinaryOp o a b) = liftM2 (laBfunc o) (convExpr a) (convExpr b)
350349
convExpr (EqBinaryOp o a b) = liftM2 (eqBfunc o) (convExpr a) (convExpr b)
351350
convExpr (OrdBinaryOp o a b) = liftM2 (ordBfunc o) (convExpr a) (convExpr b)
@@ -459,11 +458,6 @@ arithBfunc Pow = (#^)
459458
arithBfunc Subt = (#-)
460459
arithBfunc Frac = (#/)
461460

462-
-- Maps a 'BoolBinOp' to it's corresponding GOOL binary function.
463-
boolBfunc :: BoolBinOp -> (SValue r -> SValue r -> SValue r)
464-
boolBfunc Impl = error "convExpr :=>"
465-
boolBfunc Iff = error "convExpr :<=>"
466-
467461
-- Maps an 'EqBinOp' to it's corresponding GOOL binary function.
468462
eqBfunc :: (SharedProg r) => EqBinOp -> (SValue r -> SValue r -> SValue r)
469463
eqBfunc Eq = (?==)
@@ -1045,7 +1039,6 @@ convExprProc (ArithBinaryOp Frac (Lit (Int a)) (Lit (Int b))) = do -- hack to de
10451039
getLiteral _ = error "convExprProc: Rational space matched to invalid CodeType; should be Double or Float"
10461040
return $ getLiteral sm
10471041
convExprProc (ArithBinaryOp o a b) = liftM2 (arithBfunc o) (convExprProc a) (convExprProc b)
1048-
convExprProc (BoolBinaryOp o a b) = liftM2 (boolBfunc o) (convExprProc a) (convExprProc b)
10491042
convExprProc (LABinaryOp o a b) = liftM2 (laBfunc o) (convExprProc a) (convExprProc b)
10501043
convExprProc (EqBinaryOp o a b) = liftM2 (eqBfunc o) (convExprProc a) (convExprProc b)
10511044
convExprProc (OrdBinaryOp o a b) = liftM2 (ordBfunc o) (convExprProc a) (convExprProc b)

code/drasil-lang/lib/Drasil/Code/CodeExpr/Convert.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ expr (LD.UnaryOpB uo e) = UnaryOpB uo (expr e)
4040
expr (LD.UnaryOpVV uo e) = UnaryOpVV uo (expr e)
4141
expr (LD.UnaryOpVN uo e) = UnaryOpVN uo (expr e)
4242
expr (LD.ArithBinaryOp bo l r) = ArithBinaryOp bo (expr l) (expr r)
43-
expr (LD.BoolBinaryOp bo l r) = BoolBinaryOp bo (expr l) (expr r)
4443
expr (LD.EqBinaryOp bo l r) = EqBinaryOp bo (expr l) (expr r)
4544
expr (LD.LABinaryOp bo l r) = LABinaryOp bo (expr l) (expr r)
4645
expr (LD.OrdBinaryOp bo l r) = OrdBinaryOp bo (expr l) (expr r)

code/drasil-lang/lib/Drasil/Code/CodeExpr/Development.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Drasil.Code.CodeExpr.Development (
33
-- CodeExpr
44
CodeExpr(..),
55
-- re-export from Expr
6-
ArithBinOp(..), EqBinOp(..), BoolBinOp(..), LABinOp(..),
6+
ArithBinOp(..), EqBinOp(..), LABinOp(..),
77
OrdBinOp(..), VVVBinOp(..), VVNBinOp(..), NVVBinOp(..),
88
ESSBinOp(..), ESBBinOp(..),
99
AssocArithOper(..), AssocBoolOper(..), AssocConcatOper(..),
@@ -21,7 +21,7 @@ module Drasil.Code.CodeExpr.Development (
2121

2222
import Drasil.Code.CodeExpr.Lang (CodeExpr(..))
2323
import Language.Drasil.Expr.Lang (ArithBinOp(..), EqBinOp(..),
24-
BoolBinOp(..), LABinOp(..), OrdBinOp(..), VVVBinOp(..),
24+
LABinOp(..), OrdBinOp(..), VVVBinOp(..),
2525
VVNBinOp(..), NVVBinOp(..),
2626
ESSBinOp(..), ESBBinOp(..),
2727
AssocBoolOper(..), AssocArithOper(..), AssocConcatOper(..),

code/drasil-lang/lib/Drasil/Code/CodeExpr/Extract.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ eNames (UnaryOpB _ u) = eNames u
3030
eNames (UnaryOpVV _ u) = eNames u
3131
eNames (UnaryOpVN _ u) = eNames u
3232
eNames (ArithBinaryOp _ a b) = eNames a ++ eNames b
33-
eNames (BoolBinaryOp _ a b) = eNames a ++ eNames b
3433
eNames (EqBinaryOp _ a b) = eNames a ++ eNames b
3534
eNames (LABinaryOp _ a b) = eNames a ++ eNames b
3635
eNames (OrdBinaryOp _ a b) = eNames a ++ eNames b
@@ -74,7 +73,6 @@ eNames' (UnaryOpB _ u) = eNames' u
7473
eNames' (UnaryOpVV _ u) = eNames' u
7574
eNames' (UnaryOpVN _ u) = eNames' u
7675
eNames' (ArithBinaryOp _ a b) = eNames' a ++ eNames' b
77-
eNames' (BoolBinaryOp _ a b) = eNames' a ++ eNames' b
7876
eNames' (EqBinaryOp _ a b) = eNames' a ++ eNames' b
7977
eNames' (LABinaryOp _ a b) = eNames' a ++ eNames' b
8078
eNames' (OrdBinaryOp _ a b) = eNames' a ++ eNames' b

code/drasil-lang/lib/Drasil/Code/CodeExpr/Lang.hs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Control.Lens ((^.))
77
import Drasil.Database (UID, HasUID(..))
88

99
import Language.Drasil.Expr.Lang
10-
(Completeness(..), ArithBinOp(..), EqBinOp(..), BoolBinOp(..),
10+
(Completeness(..), ArithBinOp(..), EqBinOp(..),
1111
LABinOp(..), OrdBinOp(..), EqBinOp(..),
1212
VVVBinOp(..), VVNBinOp(..), NVVBinOp(..), ESSBinOp(..), ESBBinOp(..),
1313
AssocArithOper(..), AssocBoolOper(..), AssocConcatOper(..),
@@ -73,8 +73,6 @@ data CodeExpr where
7373

7474
-- | Binary operator for arithmetic between expressions (fractional, power, and subtraction).
7575
ArithBinaryOp :: ArithBinOp -> CodeExpr -> CodeExpr -> CodeExpr
76-
-- | Binary operator for boolean operators (implies, iff).
77-
BoolBinaryOp :: BoolBinOp -> CodeExpr -> CodeExpr -> CodeExpr
7876
-- | Binary operator for equality between expressions.
7977
EqBinaryOp :: EqBinOp -> CodeExpr -> CodeExpr -> CodeExpr
8078
-- | Binary operator for indexing two expressions.
@@ -160,11 +158,6 @@ instance ExprC CodeExpr where
160158
-- | Smart constructor for rasing the first expression to the power of the second.
161159
($^) = ArithBinaryOp Pow
162160

163-
-- | Smart constructor to show that one expression implies the other (conditional operator).
164-
($=>) = BoolBinaryOp Impl
165-
-- | Smart constructor to show that an expression exists if and only if another expression exists (biconditional operator).
166-
($<=>) = BoolBinaryOp Iff
167-
168161
-- | Smart constructor for the boolean /and/ operator.
169162
a $&& b = AssocB And [a, b]
170163
-- | Smart constructor for the boolean /or/ operator.

code/drasil-lang/lib/Drasil/Code/CodeExpr/Precedence.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Drasil.Code.CodeExpr.Precedence (precA, precB, eprec) where
22

33
import Drasil.Code.CodeExpr.Lang (CodeExpr(..))
4-
import Language.Drasil.Expr.Precedence (prec2Arith, prec2Eq, prec2Bool,
4+
import Language.Drasil.Expr.Precedence (prec2Arith, prec2Eq,
55
prec2LA, prec2Ord, prec2VVV, prec2VVN, prec2NVV, prec2ESS, prec2ESB,
66
precA, precB, precC, prec1, prec1B, prec1VV, prec1VN)
77

@@ -30,7 +30,6 @@ eprec (UnaryOpVV fn _) = prec1VV fn
3030
eprec (UnaryOpVN fn _) = prec1VN fn
3131
eprec (Operator o _ _) = precA o
3232
eprec (ArithBinaryOp bo _ _) = prec2Arith bo
33-
eprec (BoolBinaryOp bo _ _) = prec2Bool bo
3433
eprec (EqBinaryOp bo _ _) = prec2Eq bo
3534
eprec (LABinaryOp bo _ _) = prec2LA bo
3635
eprec (OrdBinaryOp bo _ _) = prec2Ord bo

code/drasil-lang/lib/Language/Drasil/Expr/Class.hs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ class ExprC r where
113113

114114
($-), ($/), ($^) :: r -> r -> r
115115

116-
($=>), ($<=>) :: r -> r -> r
117-
118116
($&&), ($||) :: r -> r -> r
119117

120118
-- | Smart constructor for set-theoretic membership relation. Added ' to avoid conflict.
@@ -278,11 +276,6 @@ instance ExprC Expr where
278276
-- | Smart constructor for rasing the first expression to the power of the second.
279277
($^) = ArithBinaryOp Pow
280278

281-
-- | Smart constructor to show that one expression implies the other (conditional operator).
282-
($=>) = BoolBinaryOp Impl
283-
-- | Smart constructor to show that an expression exists if and only if another expression exists (biconditional operator).
284-
($<=>) = BoolBinaryOp Iff
285-
286279
-- | Smart constructor for the boolean /and/ operator.
287280
a $&& b = AssocB And [a, b]
288281
-- | Smart constructor for the boolean /or/ operator.
@@ -443,11 +436,6 @@ instance ExprC M.ModelExpr where
443436
-- | Smart constructor for rasing the first expression to the power of the second.
444437
($^) = M.ArithBinaryOp Pow
445438

446-
-- | Smart constructor to show that one expression implies the other (conditional operator).
447-
($=>) = M.BoolBinaryOp Impl
448-
-- | Smart constructor to show that an expression exists if and only if another expression exists (biconditional operator).
449-
($<=>) = M.BoolBinaryOp Iff
450-
451439
-- | Smart constructor for the boolean /and/ operator.
452440
a $&& b = M.AssocB M.And [a, b]
453441
-- | Smart constructor for the boolean /or/ operator.

code/drasil-lang/lib/Language/Drasil/Expr/Development.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Language.Drasil.Expr.Development (
22
-- Expr
33
Expr(..), UFunc(..), UFuncB(..), UFuncVV(..), UFuncVN(..)
4-
, ArithBinOp(..), BoolBinOp(..), EqBinOp(..), LABinOp(..), OrdBinOp(..)
4+
, ArithBinOp(..), EqBinOp(..), LABinOp(..), OrdBinOp(..)
55
, VVVBinOp(..), VVNBinOp(..), NVVBinOp(..), ESSBinOp(..), ESBBinOp(..)
66
, AssocArithOper(..), AssocBoolOper(..), AssocConcatOper(..)
77
, Completeness(..), Relation

code/drasil-lang/lib/Language/Drasil/Expr/Extract.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ eNames (UnaryOpB _ u) = eNames u
2323
eNames (UnaryOpVV _ u) = eNames u
2424
eNames (UnaryOpVN _ u) = eNames u
2525
eNames (ArithBinaryOp _ a b) = eNames a ++ eNames b
26-
eNames (BoolBinaryOp _ a b) = eNames a ++ eNames b
2726
eNames (EqBinaryOp _ a b) = eNames a ++ eNames b
2827
eNames (LABinaryOp _ a b) = eNames a ++ eNames b
2928
eNames (OrdBinaryOp _ a b) = eNames a ++ eNames b
@@ -61,7 +60,6 @@ eNames' (UnaryOpB _ u) = eNames' u
6160
eNames' (UnaryOpVV _ u) = eNames' u
6261
eNames' (UnaryOpVN _ u) = eNames' u
6362
eNames' (ArithBinaryOp _ a b) = eNames' a ++ eNames' b
64-
eNames' (BoolBinaryOp _ a b) = eNames' a ++ eNames' b
6563
eNames' (EqBinaryOp _ a b) = eNames' a ++ eNames' b
6664
eNames' (LABinaryOp _ a b) = eNames' a ++ eNames' b
6765
eNames' (OrdBinaryOp _ a b) = eNames' a ++ eNames' b

0 commit comments

Comments
 (0)