logic-TPTP 0.3.0.2 → 0.4.0.0
raw patch · 14 files changed
+57/−79 lines, 14 filesdep +pointeddep −utf8-preludePVP ok
version bump matches the API change (PVP)
Dependencies added: pointed
Dependencies removed: utf8-prelude
API changes (from Hackage documentation)
- Codec.TPTP.Base: class Copointed a b | b -> a
- Codec.TPTP.Base: class Pointed a b | b -> a
- Codec.TPTP.Base: copoint :: Copointed a b => b -> a
- Codec.TPTP.Base: data Role
- Codec.TPTP.Base: instance [overlap ok] Copointed a (Identity a)
- Codec.TPTP.Base: instance [overlap ok] Monad m => Pointed a (m a)
- Codec.TPTP.Base: point :: Pointed a b => a -> b
+ Codec.TPTP.Base: newtype Role
- Codec.TPTP.Base: (.!=.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (T c) -> (T c) -> F c
+ Codec.TPTP.Base: (.!=.) :: Pointed c => (T c) -> (T c) -> F c
- Codec.TPTP.Base: (.&.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> (F c) -> F c
+ Codec.TPTP.Base: (.&.) :: Pointed c => (F c) -> (F c) -> F c
- Codec.TPTP.Base: (.<=.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> (F c) -> F c
+ Codec.TPTP.Base: (.<=.) :: Pointed c => (F c) -> (F c) -> F c
- Codec.TPTP.Base: (.<=>.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> (F c) -> F c
+ Codec.TPTP.Base: (.<=>.) :: Pointed c => (F c) -> (F c) -> F c
- Codec.TPTP.Base: (.<~>.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> (F c) -> F c
+ Codec.TPTP.Base: (.<~>.) :: Pointed c => (F c) -> (F c) -> F c
- Codec.TPTP.Base: (.=.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (T c) -> (T c) -> F c
+ Codec.TPTP.Base: (.=.) :: Pointed c => (T c) -> (T c) -> F c
- Codec.TPTP.Base: (.=>.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> (F c) -> F c
+ Codec.TPTP.Base: (.=>.) :: Pointed c => (F c) -> (F c) -> F c
- Codec.TPTP.Base: (.|.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> (F c) -> F c
+ Codec.TPTP.Base: (.|.) :: Pointed c => (F c) -> (F c) -> F c
- Codec.TPTP.Base: (.~&.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> (F c) -> F c
+ Codec.TPTP.Base: (.~&.) :: Pointed c => (F c) -> (F c) -> F c
- Codec.TPTP.Base: (.~.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> F c
+ Codec.TPTP.Base: (.~.) :: Pointed c => (F c) -> F c
- Codec.TPTP.Base: (.~|.) :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => (F c) -> (F c) -> F c
+ Codec.TPTP.Base: (.~|.) :: Pointed c => (F c) -> (F c) -> F c
- Codec.TPTP.Base: distinctObjectTerm :: Pointed (Term0 (T c)) (c (Term0 (T c))) => String -> T c
+ Codec.TPTP.Base: distinctObjectTerm :: Pointed c => String -> T c
- Codec.TPTP.Base: exists :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => [V] -> (F c) -> F c
+ Codec.TPTP.Base: exists :: Pointed c => [V] -> (F c) -> F c
- Codec.TPTP.Base: fApp :: Pointed (Term0 (T c)) (c (Term0 (T c))) => AtomicWord -> [T c] -> T c
+ Codec.TPTP.Base: fApp :: Pointed c => AtomicWord -> [T c] -> T c
- Codec.TPTP.Base: foldF :: Copointed (Formula0 (T t) (F t)) (t (Formula0 (T t) (F t))) => (F t -> r) -> (Quant -> [V] -> F t -> r) -> (F t -> BinOp -> F t -> r) -> (T t -> InfixPred -> T t -> r) -> (AtomicWord -> [T t] -> r) -> (F t -> r)
+ Codec.TPTP.Base: foldF :: Copointed t => (F t -> r) -> (Quant -> [V] -> F t -> r) -> (F t -> BinOp -> F t -> r) -> (T t -> InfixPred -> T t -> r) -> (AtomicWord -> [T t] -> r) -> (F t -> r)
- Codec.TPTP.Base: foldT :: Copointed (Term0 (T t)) (t (Term0 (T t))) => (String -> r) -> (Rational -> r) -> (V -> r) -> (AtomicWord -> [T t] -> r) -> (T t -> r)
+ Codec.TPTP.Base: foldT :: Copointed t => (String -> r) -> (Rational -> r) -> (V -> r) -> (AtomicWord -> [T t] -> r) -> (T t -> r)
- Codec.TPTP.Base: for_all :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => [V] -> (F c) -> F c
+ Codec.TPTP.Base: for_all :: Pointed c => [V] -> (F c) -> F c
- Codec.TPTP.Base: numberLitTerm :: Pointed (Term0 (T c)) (c (Term0 (T c))) => Rational -> T c
+ Codec.TPTP.Base: numberLitTerm :: Pointed c => Rational -> T c
- Codec.TPTP.Base: pApp :: Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))) => AtomicWord -> [T c] -> F c
+ Codec.TPTP.Base: pApp :: Pointed c => AtomicWord -> [T c] -> F c
- Codec.TPTP.Base: unwrapF :: Copointed (Formula0 (T t) (F t)) (t (Formula0 (T t) (F t))) => F t -> Formula0 (T t) (F t)
+ Codec.TPTP.Base: unwrapF :: Copointed t => F t -> Formula0 (T t) (F t)
- Codec.TPTP.Base: unwrapT :: Copointed (Term0 (T t)) (t (Term0 (T t))) => T t -> Term0 (T t)
+ Codec.TPTP.Base: unwrapT :: Copointed t => T t -> Term0 (T t)
- Codec.TPTP.Base: var :: Pointed (Term0 (T c)) (c (Term0 (T c))) => V -> T c
+ Codec.TPTP.Base: var :: Pointed c => V -> T c
- Codec.TPTP.Diff: class Diffable a b
+ Codec.TPTP.Diff: class Diffable a b | a -> b
Files
- Codec/TPTP/Base.hs +27/−49
- Codec/TPTP/Diff.hs +1/−6
- Codec/TPTP/Export.hs +1/−1
- Codec/TPTP/Pretty.hs +1/−1
- Codec/TPTP/QuickCheck.hs +1/−1
- Lexer.x +7/−0
- MACROS.h +2/−3
- Util.hs +4/−3
- dist/build/Lexer.hs +8/−1
- logic-TPTP.cabal +2/−2
- testing/ParseRandom.hs +0/−3
- testing/PrettyPrintFile.hs +1/−3
- testing/TestImportExportImportFile.hs +1/−3
- testing/TestImportExportRandom.hs +1/−3
Codec/TPTP/Base.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE CPP, TemplateHaskell, NoMonomorphismRestriction, RecordWildCards- , StandaloneDeriving, MultiParamTypeClasses, FunctionalDependencies+ , StandaloneDeriving , TypeSynonymInstances, FlexibleInstances, FlexibleContexts , UndecidableInstances, DeriveDataTypeable, GeneralizedNewtypeDeriving , OverlappingInstances, ScopedTypeVariables@@ -22,6 +22,8 @@ import Prelude --hiding(concat,foldl,foldl1,foldr,foldr1) import Test.QuickCheck hiding ((.&.)) import Util+import Data.Pointed+import Data.Copointed -- Should be in the standard library deriving instance Eq a => Eq (Identity a)@@ -39,7 +41,7 @@ -- | Basic (undecorated) terms type Term = T Identity --- * Formulae and terms decoreated with state+-- * Formulae and terms decorated with state -- | First-order formulae decorated with state type FormulaST s = F (State s)@@ -53,7 +55,7 @@ -- | Terms decorated with comments type TermC = TermST [String] --- | Forget comments in formulae decoreated with comments+-- | Forget comments in formulae decorated with comments forgetFC :: FormulaC -> Formula forgetFC (F f) = F . return $ case evalState f [] of@@ -63,7 +65,7 @@ Quant quant vs f_ -> Quant quant vs (forgetFC f_) (:~:) f_ -> (:~:) (forgetFC f_) --- | Forget comments in terms decoreated with comments+-- | Forget comments in terms decorated with comments forgetTC :: TermC -> Term forgetTC (T t) = T . return $ case evalState t [] of@@ -75,7 +77,7 @@ -- | Equivalence ----- Don't let the type context of these wrapper function confuse you :) -- the important special case is just:+-- Important special case: -- -- @\(\.\<\=\>\.\) :: 'Formula' -> 'Formula' -> 'Formula'@ (.<=>.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c@@ -180,20 +182,7 @@ --- | Formulae whose subexpressions are wrapped in the given type constructor @c@.------ For example:------ - @c = 'Identity'@: Plain formulae------ - @c = 'Maybe'@: Formulae that may contain \"holes\"------ - @c = 'IORef'@: (Mutable) formulae with mutable subexpressions -newtype F c = F { runF :: c (Formula0 (T c) (F c)) } --- | Terms whose subterms are wrapped in the given type constructor @c@-newtype T c = T { runT :: c (Term0 (T c)) }- -- | Binary formula connectives @@ -240,7 +229,7 @@ -- | A line of a TPTP file: Annotated formula (with the comment string embbeded in the State monad ), comment or include statement type TPTP_Input_C = TPTP_Input_ (State [String]) --- | Forget comments in a line of a TPTP file decoreated with comments+-- | Forget comments in a line of a TPTP file decorated with comments forgetTIC :: TPTP_Input_C -> TPTP_Input forgetTIC tic@(AFormula {}) = tic { formula = forgetFC (formula tic) } forgetTIC (Comment s) = Comment s@@ -275,8 +264,8 @@ data UsefulInfo = NoUsefulInfo | UsefulInfo [GTerm] deriving (Eq,Ord,Show,Read,Data,Typeable) --- | Formula roles -- why isn't this newtype??-data Role = Role { unrole :: String }+-- | Formula roles+newtype Role = Role { unrole :: String } deriving (Eq,Ord,Show,Read,Data,Typeable) @@ -548,6 +537,19 @@ -- * Fixed-point style decorated formulae and terms +-- | Formulae whose subexpressions are wrapped in the given type constructor @c@.+--+-- For example:+--+-- - @c = 'Identity'@: Plain formulae+--+-- - @c = 'Maybe'@: Formulae that may contain \"holes\"+--+-- - @c = 'IORef'@: (Mutable) formulae with mutable subexpressions +newtype F c = F { runF :: c (Formula0 (T c) (F c)) }+ +-- | Terms whose subterms are wrapped in the given type constructor @c@+newtype T c = T { runT :: c (Term0 (T c)) } #define DI(X) deriving instance (X (c (Term0 (T c)))) => X (T c); deriving instance (X (c (Formula0 (T c) (F c)))) => X (F c) @@ -565,38 +567,14 @@ deriving instance (Typeable1 c, Data (c (Term0 (T c)))) => Data (T c) deriving instance (Typeable1 c, Data (c (Formula0 (T c) (F c)))) => Data (F c) - --- | This class is used in several utility functions involving 'F' and 'T'.------ Conceptually 'point' should be of type @a -> m a@, but we need the extra flexibility to make restricted monads like 'Set' instances. ------ Note: We have @instance (Monad m) => Pointed a (m a)@, but Haddock currently doesn't display this.-class Pointed a b | b -> a where- point :: a -> b--instance (Monad m) => Pointed a (m a) where- point = return- --- instance Ord a => Pointed a (Set a) where--- point = S.singleton- --- | This class is used in several utility functions involving 'F' and 'T'.------ Conceptually 'copoint' should be of type @w a -> a@, but let's keep the extra flexibility. -class Copointed a b | b -> a where- copoint :: b -> a--instance Copointed a (Identity a) where- copoint (Identity x) = x- -- * Utility functions unwrapF ::- (Copointed (Formula0 (T t) (F t)) (t (Formula0 (T t) (F t)))) =>+ (Copointed t) => F t -> Formula0 (T t) (F t) unwrapF (F x) = copoint x unwrapT ::- (Copointed (Term0 (T t)) (t (Term0 (T t)))) =>+ (Copointed t) => T t -> Term0 (T t) unwrapT (T x) = copoint x @@ -633,7 +611,7 @@ -- | Eliminate formulae foldF ::- (Copointed (Formula0 (T t) (F t)) (t (Formula0 (T t) (F t)))) =>+ (Copointed t) => (F t -> r) -- ^ Handle negation -> (Quant -> [V] -> F t -> r) -- ^ Handle quantification -> (F t -> BinOp -> F t -> r) -- ^ Handle binary op@@ -645,7 +623,7 @@ -- | Eliminate terms foldT ::- (Copointed (Term0 (T t)) (t (Term0 (T t)))) =>+ (Copointed t) => (String -> r) -- ^ Handle string literal -> (Rational -> r) -- ^ Handle number literal -> (V -> r) -- ^ Handle variable
Codec/TPTP/Diff.hs view
@@ -12,15 +12,10 @@ -- Warning: This module is a MESS (but it seems to work :)). import Data.Generics-import Control.Applicative()-import Prelude hiding (putStrLn) import Test.QuickCheck hiding((.&.))-import Data.Char()-import Debug.Trace() import Codec.TPTP.Base import Codec.TPTP.Pretty import Text.PrettyPrint.ANSI.Leijen-import System.UTF8IO import Control.Monad.Identity @@ -331,7 +326,7 @@ -class Diffable a b where+class Diffable a b | a -> b where diff :: a -> a -> b instance Diffable Formula (F DiffResult) where diff = diffFormula
Codec/TPTP/Export.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE NoMonomorphismRestriction, RecordWildCards- , StandaloneDeriving, MultiParamTypeClasses, FunctionalDependencies+ , StandaloneDeriving , TypeSynonymInstances, FlexibleInstances, FlexibleContexts , UndecidableInstances, DeriveDataTypeable, GeneralizedNewtypeDeriving , OverlappingInstances, RankNTypes
Codec/TPTP/Pretty.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE NoMonomorphismRestriction, RecordWildCards- , StandaloneDeriving, MultiParamTypeClasses, FunctionalDependencies+ , StandaloneDeriving , TypeSynonymInstances, FlexibleInstances, FlexibleContexts , UndecidableInstances, DeriveDataTypeable, GeneralizedNewtypeDeriving , OverlappingInstances, RankNTypes, PatternGuards
Codec/TPTP/QuickCheck.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE NoMonomorphismRestriction, RecordWildCards- , StandaloneDeriving, MultiParamTypeClasses, FunctionalDependencies+ , StandaloneDeriving , TypeSynonymInstances, FlexibleInstances, FlexibleContexts , UndecidableInstances, DeriveDataTypeable, GeneralizedNewtypeDeriving , OverlappingInstances, RankNTypes, PatternGuards
Lexer.x view
@@ -1,4 +1,11 @@ {+{-# OPTIONS -fno-warn-missing-signatures #-}+{-# OPTIONS -fno-warn-unused-binds #-}+{-# OPTIONS -fno-warn-unused-matches #-}+{-# OPTIONS -fno-warn-name-shadowing #-}+{-# OPTIONS -fno-warn-incomplete-patterns #-}+{-# OPTIONS -fno-warn-lazy-unlifted-bindings #-}+ module Lexer where import Data.Ratio }
MACROS.h view
@@ -1,8 +1,7 @@ #ifndef __MACROS_H #define POINTED_FORMULA(c) \- (Pointed (Formula0 (T c) (F c)) (c (Formula0 (T c) (F c))))+ (Pointed c) #define POINTED_TERM(c) \- (Pointed (Term0 (T c)) (c (Term0 (T c))))-+ (Pointed c) #endif
Util.hs view
@@ -4,9 +4,10 @@ import Data.Typeable -#if MIN_VERSION_base(4,4,0)--#else+#ifndef MIN_VERSION_base+#define MIN_VERSION_base(X,Y,Z) 1+#endif+#if ! MIN_VERSION_base(4,4,0) mkTyCon3 _ m t = mkTyCon $ m++"."++t #endif
dist/build/Lexer.hs view
@@ -1,6 +1,13 @@ {-# LANGUAGE CPP,MagicHash #-} {-# LINE 1 "Lexer.x" #-} +{-# OPTIONS -fno-warn-missing-signatures #-}+{-# OPTIONS -fno-warn-unused-binds #-}+{-# OPTIONS -fno-warn-unused-matches #-}+{-# OPTIONS -fno-warn-name-shadowing #-}+{-# OPTIONS -fno-warn-incomplete-patterns #-}+{-# OPTIONS -fno-warn-lazy-unlifted-bindings #-}+ module Lexer where import Data.Ratio @@ -181,7 +188,7 @@ alex_deflt = AlexA# "\xff\xff\xff\xff\x27\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x15\x00\x15\x00\xff\xff\x17\x00\x17\x00\x19\x00\x19\x00\x1d\x00\x1d\x00\x23\x00\x23\x00\x26\x00\x26\x00\x27\x00\x27\x00\x27\x00\x28\x00\x28\x00\x2e\x00\xff\xff\x2e\x00\x2e\x00\x03\x00\x03\x00\x03\x00\x27\x00\x31\x00\x31\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2e\x00\x3e\x00\x3e\x00\x3e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# alex_accept = listArray (0::Int,80) [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[(AlexAccSkip)],[(AlexAcc (alex_action_1))],[(AlexAcc (alex_action_2))],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_6))],[(AlexAcc (alex_action_6))],[(AlexAcc (alex_action_6))],[(AlexAcc (alex_action_6))],[(AlexAcc (alex_action_7))],[(AlexAcc (alex_action_8))],[(AlexAcc (alex_action_9))],[(AlexAcc (alex_action_10))],[(AlexAcc (alex_action_11))],[(AlexAcc (alex_action_12))],[(AlexAcc (alex_action_13))],[(AlexAcc (alex_action_14))],[(AlexAcc (alex_action_15))],[(AlexAcc (alex_action_16))],[(AlexAcc (alex_action_17))],[(AlexAcc (alex_action_18))],[(AlexAcc (alex_action_19))],[(AlexAcc (alex_action_19))],[(AlexAcc (alex_action_19))],[(AlexAcc (alex_action_20))],[(AlexAcc (alex_action_20))],[(AlexAcc (alex_action_21))],[(AlexAcc (alex_action_21))],[(AlexAcc (alex_action_22))]]-{-# LINE 64 "Lexer.x" #-}+{-# LINE 71 "Lexer.x" #-} -- Each action has type :: String -> Token
logic-TPTP.cabal view
@@ -1,5 +1,5 @@ name: logic-TPTP -version: 0.3.0.2+version: 0.4.0.0 cabal-version: >= 1.6 build-type: Simple license: GPL@@ -61,8 +61,8 @@ , containers , ansi-wl-pprint , QuickCheck >= 2- , utf8-prelude , mtl+ , pointed exposed-modules: Codec.TPTP.Import , Codec.TPTP.Base
testing/ParseRandom.hs view
@@ -24,11 +24,8 @@ import qualified Data.ByteString as B import Data.Function import System.Process-import System.UTF8IO import Control.Arrow import Debug.Trace-import Prelude()-import UTF8Prelude hiding(catch) import System.SimpleArgs import Data.Generics import Test.QuickCheck
testing/PrettyPrintFile.hs view
@@ -24,11 +24,9 @@ import qualified Data.ByteString as B import Data.Function import System.Process-import System.UTF8IO+import System.IO import Control.Arrow import Debug.Trace-import Prelude()-import UTF8Prelude hiding(catch) import System.SimpleArgs import Data.Generics import Test.QuickCheck
testing/TestImportExportImportFile.hs view
@@ -6,9 +6,7 @@ import Data.Maybe import Data.List as L import Data.Function-import System.UTF8IO-import Prelude()-import UTF8Prelude hiding(catch)+import System.IO import System.SimpleArgs import Data.Monoid import Text.PrettyPrint.ANSI.Leijen
testing/TestImportExportRandom.hs view
@@ -3,9 +3,7 @@ module TestImportExportRandom where import Data.Function-import System.UTF8IO-import Prelude()-import UTF8Prelude hiding(catch)+import System.IO import Test.QuickCheck import Common import Data.Functor.Identity