logic-TPTP 0.4.0.0 → 0.4.1.0
raw patch · 9 files changed
+321/−216 lines, 9 filesdep +transformersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: transformers
API changes (from Hackage documentation)
- Codec.TPTP.Base: instance [overlap ok] Eq a => Eq (Identity a)
- Codec.TPTP.Base: instance [overlap ok] Ord a => Ord (Identity a)
- Codec.TPTP.Base: instance [overlap ok] Read a => Read (Identity a)
- Codec.TPTP.Base: instance [overlap ok] Show a => Show (Identity a)
Files
- Codec/TPTP/Base.hs +53/−23
- Lexer.x +0/−2
- MACROS.h +0/−7
- Parser.y +0/−2
- Util.hs +7/−3
- dist/build/Lexer.hs +49/−69
- dist/build/Parser.hs +105/−55
- dist/build/ParserC.hs +105/−53
- logic-TPTP.cabal +2/−2
Codec/TPTP/Base.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, TemplateHaskell, NoMonomorphismRestriction, RecordWildCards+{-# LANGUAGE CPP, NoMonomorphismRestriction , StandaloneDeriving , TypeSynonymInstances, FlexibleInstances, FlexibleContexts , UndecidableInstances, DeriveDataTypeable, GeneralizedNewtypeDeriving@@ -6,9 +6,15 @@ #-} {-# OPTIONS -Wall -fno-warn-orphans #-} -#include "../../MACROS.h"- module Codec.TPTP.Base where++#ifndef MIN_VERSION_transformers+#define MIN_VERSION_transformers(a,b,c) 1+#endif+#ifndef MIN_VERSION_base+#define MIN_VERSION_base(a,b,c) 1+#endif+-- Assume we are using the newest versions when using ghci without cabal import Codec.TPTP.QuickCheck import Control.Applicative@@ -21,17 +27,26 @@ import Data.String import Prelude --hiding(concat,foldl,foldl1,foldr,foldr1) import Test.QuickCheck hiding ((.&.))-import Util import Data.Pointed import Data.Copointed++#if !MIN_VERSION_base(4,7,0)+import Util+#endif -- Should be in the standard library+#if !MIN_VERSION_transformers(0,4,0) deriving instance Eq a => Eq (Identity a) deriving instance Ord a => Ord (Identity a) deriving instance Show a => Show (Identity a) deriving instance Read a => Read (Identity a)+#endif deriving instance Data a => Data (Identity a)+#if MIN_VERSION_base(4,7,0)+deriving instance Typeable Identity+#else deriving instance Typeable1 Identity+#endif -- * Basic undecorated formulae and terms @@ -80,79 +95,79 @@ -- Important special case: -- -- @\(\.\<\=\>\.\) :: 'Formula' -> 'Formula' -> 'Formula'@-(.<=>.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c+(.<=>.) :: Pointed c => (F c) -> (F c) -> F c x .<=>. y = (F . point) $ BinOp x (:<=>:) y -- | Implication-(.=>.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c+(.=>.) :: Pointed c => (F c) -> (F c) -> F c x .=>. y = (F . point) $ BinOp x (:=>:) y -- | Reverse implication-(.<=.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c+(.<=.) :: Pointed c => (F c) -> (F c) -> F c x .<=. y = (F . point) $ BinOp x (:<=:) y -- | Disjunction/OR-(.|.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c+(.|.) :: Pointed c => (F c) -> (F c) -> F c x .|. y = (F . point) $ BinOp x (:|:) y -- | Conjunction/AND-(.&.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c+(.&.) :: Pointed c => (F c) -> (F c) -> F c x .&. y = (F . point) $ BinOp x (:&:) y -- | XOR-(.<~>.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c+(.<~>.) :: Pointed c => (F c) -> (F c) -> F c x .<~>. y = (F . point) $ BinOp x (:<~>:) y -- | NOR-(.~|.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c+(.~|.) :: Pointed c => (F c) -> (F c) -> F c x .~|. y = (F . point) $ BinOp x (:~|:) y -- | NAND-(.~&.) :: POINTED_FORMULA(c) => (F c) -> (F c) -> F c+(.~&.) :: Pointed c => (F c) -> (F c) -> F c x .~&. y = (F . point) $ BinOp x (:~&:) y -- | Negation-(.~.) :: POINTED_FORMULA(c) => (F c) -> F c+(.~.) :: Pointed c => (F c) -> F c (.~.) x = (F . point) $ (:~:) x -- | Equality-(.=.) :: POINTED_FORMULA(c) => (T c) -> (T c) -> F c+(.=.) :: Pointed c => (T c) -> (T c) -> F c x .=. y = (F . point) $ InfixPred x (:=:) y -- | Inequality-(.!=.) :: POINTED_FORMULA(c) => (T c) -> (T c) -> F c+(.!=.) :: Pointed c => (T c) -> (T c) -> F c x .!=. y = (F . point) $ InfixPred x (:!=:) y -- | Universal quantification-for_all :: POINTED_FORMULA(c) => [V] -> (F c) -> F c+for_all :: Pointed c => [V] -> (F c) -> F c for_all vars x = (F . point) $ Quant All vars x -- | Existential quantification-exists :: POINTED_FORMULA(c) => [V] -> (F c) -> F c+exists :: Pointed c => [V] -> (F c) -> F c exists vars x = (F . point) $ Quant Exists vars x -- | Predicate symbol application-pApp :: POINTED_FORMULA(c) => AtomicWord -> [T c] -> F c+pApp :: Pointed c => AtomicWord -> [T c] -> F c pApp x args = (F . point) $ PredApp x args -- | Variable-var :: POINTED_TERM(c) => V -> T c+var :: Pointed c => V -> T c var = (T . point) . Var -- | Function symbol application (constants are encoded as nullary functions)-fApp :: POINTED_TERM(c) => AtomicWord -> [T c] -> T c+fApp :: Pointed c => AtomicWord -> [T c] -> T c fApp x args = (T . point) $ FunApp x args -- | Number literal-numberLitTerm :: POINTED_TERM(c) => Rational -> T c+numberLitTerm :: Pointed c => Rational -> T c numberLitTerm = (T . point) . NumberLitTerm -- | Double-quoted string literal, called /Distinct Object/ in TPTP's grammar -distinctObjectTerm :: POINTED_TERM(c) => String -> T c+distinctObjectTerm :: Pointed c => String -> T c distinctObjectTerm = (T . point) . DistinctObjectTerm infixl 2 .<=>. , .=>. , .<=. , .<~>.@@ -252,9 +267,16 @@ deriving instance Ord (c (Formula0 (T c) (F c))) => Ord (TPTP_Input_ c) deriving instance Show (c (Formula0 (T c) (F c))) => Show (TPTP_Input_ c) deriving instance Read (c (Formula0 (T c) (F c))) => Read (TPTP_Input_ c)+++#if MIN_VERSION_base(4,7,0)+deriving instance (Typeable c, Data (c (Formula0 (T c) (F c)))) => Data (TPTP_Input_ c)+deriving instance Typeable TPTP_Input_+#else deriving instance (Typeable1 c, Data (c (Formula0 (T c) (F c)))) => Data (TPTP_Input_ c) instance Typeable1 c => Typeable (TPTP_Input_ c) where typeOf = mkTypeOfForRank2Kind "Codec.TPTP.Base" "TPTP_Input_"+#endif -- | Annotations about the formulas origin data Annotations = NoAnnotations | Annotations GTerm UsefulInfo@@ -558,14 +580,22 @@ DI(Show) DI(Read) +#if MIN_VERSION_base(4,7,0)+deriving instance Typeable F+deriving instance Typeable T++deriving instance (Typeable c, Data (c (Term0 (T c)))) => Data (T c)+deriving instance (Typeable c, Data (c (Formula0 (T c) (F c)))) => Data (F c)+#else instance Typeable1 c => Typeable (F c) where typeOf = mkTypeOfForRank2Kind "Codec.TPTP.Base" "F" instance Typeable1 c => Typeable (T c) where typeOf = mkTypeOfForRank2Kind "Codec.TPTP.Base" "T" -deriving instance (Typeable1 c, Data (c (Term0 (T c)))) => Data (T c)+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)+#endif -- * Utility functions
Lexer.x view
@@ -1,10 +1,8 @@ { {-# 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
@@ -1,7 +0,0 @@-#ifndef __MACROS_H--#define POINTED_FORMULA(c) \- (Pointed c)-#define POINTED_TERM(c) \- (Pointed c)-#endif
Parser.y view
@@ -1,6 +1,4 @@ {-{-# LANGUAGE CPP #-}-#include "../../MACROS.h" module Parser where import Data.Char
Util.hs view
@@ -1,12 +1,15 @@ {-# LANGUAGE ScopedTypeVariables, CPP #-} {-# OPTIONS -Wall #-}-module Util where -import Data.Typeable+module Util where #ifndef MIN_VERSION_base #define MIN_VERSION_base(X,Y,Z) 1 #endif++#if !MIN_VERSION_base(4,7,0)+import Data.Typeable+ #if ! MIN_VERSION_base(4,4,0) mkTyCon3 _ m t = mkTyCon $ m++"."++t #endif@@ -14,6 +17,7 @@ packageName :: String packageName = "logic-TPTP" + -- | Gets the TypeRep of @c@ (not of @c ()@) getTyRep1 :: forall c. Typeable1 c => c () -> TypeRep getTyRep1 _ = mkTyConApp (typeRepTyCon (typeOf1 (undefined :: c ()))) []@@ -24,4 +28,4 @@ where tc = mkTyCon3 packageName moduleName typeName tr = mkTyConApp tc [getTyRep1 (undefined :: c ())]-+#endif
dist/build/Lexer.hs view
@@ -2,11 +2,9 @@ {-# 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@@ -92,11 +90,11 @@ in p' `seq` Just (b, (p', c, bs, s)) -{-# LINE 89 "templates/wrappers.hs" #-}+{-# LINE 92 "templates/wrappers.hs" #-} -{-# LINE 103 "templates/wrappers.hs" #-}+{-# LINE 106 "templates/wrappers.hs" #-} -{-# LINE 118 "templates/wrappers.hs" #-}+{-# LINE 121 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Token positions@@ -124,27 +122,27 @@ -- ----------------------------------------------------------------------------- -- Default monad -{-# LINE 231 "templates/wrappers.hs" #-}+{-# LINE 242 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Monad (with ByteString input) -{-# LINE 320 "templates/wrappers.hs" #-}+{-# LINE 333 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Basic wrapper -{-# LINE 346 "templates/wrappers.hs" #-}+{-# LINE 360 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Basic wrapper, ByteString version -{-# LINE 364 "templates/wrappers.hs" #-}+{-# LINE 378 "templates/wrappers.hs" #-} -{-# LINE 377 "templates/wrappers.hs" #-}+{-# LINE 392 "templates/wrappers.hs" #-} -- -----------------------------------------------------------------------------@@ -158,7 +156,7 @@ where go inp@(pos,_,_,str) = case alexScan inp 0 of AlexEOF -> []- AlexError ((AlexPn _ line column),_,_,_) -> error $ "lexical error at " ++ (show line) ++ " line, " ++ (show column) ++ " column"+ AlexError ((AlexPn _ line column),_,_,_) -> error $ "lexical error at line " ++ (show line) ++ ", column " ++ (show column) AlexSkip inp' len -> go inp' AlexToken inp' len act -> act pos (take len str) : go inp' @@ -167,7 +165,7 @@ -- ----------------------------------------------------------------------------- -- Posn wrapper, ByteString version -{-# LINE 409 "templates/wrappers.hs" #-}+{-# LINE 424 "templates/wrappers.hs" #-} -- -----------------------------------------------------------------------------@@ -187,8 +185,8 @@ alex_deflt :: AlexAddr 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 71 "Lexer.x" #-}+alex_accept = listArray (0::Int,80) [AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,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 69 "Lexer.x" #-} -- Each action has type :: String -> Token @@ -293,13 +291,25 @@ -- ----------------------------------------------------------------------------- -- INTERNALS and main scanner engine -{-# LINE 37 "templates/GenericTemplate.hs" #-}+{-# LINE 21 "templates/GenericTemplate.hs" #-} -{-# LINE 47 "templates/GenericTemplate.hs" #-} -data AlexAddr = AlexA# Addr# ++-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.+#if __GLASGOW_HASKELL__ > 706+#define GTE(n,m) (tagToEnum# (n >=# m))+#define EQ(n,m) (tagToEnum# (n ==# m))+#else+#define GTE(n,m) (n >=# m)+#define EQ(n,m) (n ==# m)+#endif+{-# LINE 51 "templates/GenericTemplate.hs" #-}+++data AlexAddr = AlexA# Addr#+-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. #if __GLASGOW_HASKELL__ < 503 uncheckedShiftL# = shiftL# #endif@@ -326,14 +336,14 @@ #ifdef WORDS_BIGENDIAN narrow32Int# i where- !i = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#`+ i = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#` (b2 `uncheckedShiftL#` 16#) `or#` (b1 `uncheckedShiftL#` 8#) `or#` b0)- !b3 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#)))- !b2 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#)))- !b1 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))- !b0 = int2Word# (ord# (indexCharOffAddr# arr off'))- !off' = off *# 4#+ b3 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#)))+ b2 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#)))+ b1 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))+ b0 = int2Word# (ord# (indexCharOffAddr# arr off'))+ off' = off *# 4# #else indexInt32OffAddr# arr off #endif@@ -342,6 +352,7 @@ + #if __GLASGOW_HASKELL__ < 503 quickIndex arr i = arr ! i #else@@ -408,35 +419,29 @@ - let- (base) = alexIndexInt32OffAddr alex_base s- ((I# (ord_c))) = fromIntegral c- (offset) = (base +# ord_c)- (check) = alexIndexInt16OffAddr alex_check offset+ case fromIntegral c of { (I# (ord_c)) ->+ let+ base = alexIndexInt32OffAddr alex_base s+ offset = (base +# ord_c)+ check = alexIndexInt16OffAddr alex_check offset - (new_s) = if (offset >=# 0#) && (check ==# ord_c)+ new_s = if GTE(offset,0#) && EQ(check,ord_c) then alexIndexInt16OffAddr alex_table offset else alexIndexInt16OffAddr alex_deflt s in- case new_s of + case new_s of -1# -> (new_acc, input) -- on an error, we want to keep the input *before* the -- character that failed, not after. _ -> alex_scan_tkn user orig_input (if c < 0x80 || c >= 0xC0 then (len +# 1#) else len) -- note that the length is increased ONLY if this is the 1st byte in a char encoding) new_input new_s new_acc-+ } where- check_accs [] = last_acc- check_accs (AlexAcc a : _) = AlexLastAcc a input (I# (len))- check_accs (AlexAccSkip : _) = AlexLastSkip input (I# (len))- check_accs (AlexAccPred a predx : rest)- | predx user orig_input (I# (len)) input- = AlexLastAcc a input (I# (len))- check_accs (AlexAccSkipPred predx : rest)- | predx user orig_input (I# (len)) input- = AlexLastSkip input (I# (len))- check_accs (_ : rest) = check_accs rest+ check_accs (AlexAccNone) = last_acc+ check_accs (AlexAcc a ) = AlexLastAcc a input (I# (len))+ check_accs (AlexAccSkip) = AlexLastSkip input (I# (len))+{-# LINE 198 "templates/GenericTemplate.hs" #-} data AlexLastAcc a = AlexNone@@ -449,35 +454,10 @@ fmap f (AlexLastSkip x y) = AlexLastSkip x y data AlexAcc a user- = AlexAcc a+ = AlexAccNone+ | AlexAcc a | AlexAccSkip- | AlexAccPred a (AlexAccPred user)- | AlexAccSkipPred (AlexAccPred user)--type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool---- -------------------------------------------------------------------------------- Predicates on a rule--alexAndPred p1 p2 user in1 len in2- = p1 user in1 len in2 && p2 user in1 len in2----alexPrevCharIsPred :: Char -> AlexAccPred _ -alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input--alexPrevCharMatches f _ input _ _ = f (alexInputPrevChar input)----alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ -alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input----alexRightContext :: Int -> AlexAccPred _-alexRightContext (I# (sc)) user _ _ input = - case alex_scan_tkn user input 0# input sc AlexNone of- (AlexNone, _) -> False- _ -> True- -- TODO: there's no need to find the longest- -- match when checking the right context, just- -- the first match will do.+{-# LINE 242 "templates/GenericTemplate.hs" #-} -- used by wrappers iUnbox (I# (i)) = i
dist/build/Parser.hs view
@@ -1,7 +1,5 @@ {-# OPTIONS_GHC -w #-} {-# OPTIONS -fglasgow-exts -cpp #-}-{-# LANGUAGE CPP #-}-#include "../../MACROS.h" module Parser where import Data.Char@@ -18,7 +16,7 @@ import qualified Data.Array as Happy_Data_Array import qualified GHC.Exts as Happy_GHC_Exts --- parser produced by Happy Version 1.18.9+-- parser produced by Happy Version 1.19.3 newtype HappyAbsSyn = HappyAbsSyn HappyAny #if __GLASGOW_HASKELL__ >= 607@@ -2261,23 +2259,74 @@ {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "<command-line>" #-}+{-# LINE 11 "<command-line>" #-}+# 1 "/usr/include/stdc-predef.h" 1 3 4++# 17 "/usr/include/stdc-predef.h" 3 4++++++++++++++++++++# 47 "/usr/include/stdc-predef.h" 3 4++# 59 "/usr/include/stdc-predef.h" 3 4+++++++++{-# LINE 11 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp -{-# LINE 30 "templates/GenericTemplate.hs" #-}+{-# LINE 13 "templates/GenericTemplate.hs" #-} ++++-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.+#if __GLASGOW_HASKELL__ > 706+#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)+#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)+#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)+#else+#define LT(n,m) (n Happy_GHC_Exts.<# m)+#define GTE(n,m) (n Happy_GHC_Exts.>=# m)+#define EQ(n,m) (n Happy_GHC_Exts.==# m)+#endif+{-# LINE 46 "templates/GenericTemplate.hs" #-}++ data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList -{-# LINE 51 "templates/GenericTemplate.hs" #-}+{-# LINE 67 "templates/GenericTemplate.hs" #-} -{-# LINE 61 "templates/GenericTemplate.hs" #-}+{-# LINE 77 "templates/GenericTemplate.hs" #-} -{-# LINE 70 "templates/GenericTemplate.hs" #-}+{-# LINE 86 "templates/GenericTemplate.hs" #-} infixr 9 `HappyStk` data HappyStk a = HappyStk a (HappyStk a)@@ -2294,9 +2343,9 @@ -- parse (a %partial parser). We must ignore the saved token on the top of -- the stack in this case. happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =- happyReturn1 ans+ happyReturn1 ans happyAccept j tk st sts (HappyStk ans _) = - (happyTcHack j (happyTcHack st)) (happyReturn1 ans)+ (happyTcHack j (happyTcHack st)) (happyReturn1 ans) ----------------------------------------------------------------------------- -- Arrays only: do the next action@@ -2304,37 +2353,35 @@ happyDoAction i tk st- = {- nothing -}+ = {- nothing -} - case action of- 0# -> {- nothing -}- happyFail i tk st- -1# -> {- nothing -}- happyAccept i tk st- n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}+ case action of+ 0# -> {- nothing -}+ happyFail i tk st+ -1# -> {- nothing -}+ happyAccept i tk st+ n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -} - (happyReduceArr Happy_Data_Array.! rule) i tk st- where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))- n -> {- nothing -}+ (happyReduceArr Happy_Data_Array.! rule) i tk st+ where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))+ n -> {- nothing -} - happyShift new_state i tk st- where (new_state) = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))- where (off) = indexShortOffAddr happyActOffsets st- (off_i) = (off Happy_GHC_Exts.+# i)- check = if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))- then (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)- else False- (action)+ happyShift new_state i tk st+ where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))+ where off = indexShortOffAddr happyActOffsets st+ off_i = (off Happy_GHC_Exts.+# i)+ check = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))+ then EQ(indexShortOffAddr happyCheck off_i, i)+ else False+ action | check = indexShortOffAddr happyTable off_i | otherwise = indexShortOffAddr happyDefActions st -{-# LINE 130 "templates/GenericTemplate.hs" #-} - indexShortOffAddr (HappyA# arr) off =- Happy_GHC_Exts.narrow16Int# i+ Happy_GHC_Exts.narrow16Int# i where i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low) high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))@@ -2353,13 +2400,13 @@ ----------------------------------------------------------------------------- -- HappyState data type (not arrays) -{-# LINE 163 "templates/GenericTemplate.hs" #-}+{-# LINE 170 "templates/GenericTemplate.hs" #-} ----------------------------------------------------------------------------- -- Shifting a token happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =- let (i) = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in+ let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in -- trace "shifting the error token" $ happyDoAction i tk new_state (HappyCons (st) (sts)) (stk) @@ -2395,30 +2442,33 @@ = happyFail 0# tk st sts stk happyReduce k nt fn j tk st sts stk = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of- sts1@((HappyCons (st1@(action)) (_))) ->- let r = fn stk in -- it doesn't hurt to always seq here...- happyDoSeq r (happyGoto nt j tk st1 sts1 r)+ sts1@((HappyCons (st1@(action)) (_))) ->+ let r = fn stk in -- it doesn't hurt to always seq here...+ happyDoSeq r (happyGoto nt j tk st1 sts1 r) happyMonadReduce k nt fn 0# tk st sts stk = happyFail 0# tk st sts stk happyMonadReduce k nt fn j tk st sts stk =- happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))- where (sts1@((HappyCons (st1@(action)) (_)))) = happyDrop k (HappyCons (st) (sts))- drop_stk = happyDropStk k stk+ case happyDrop k (HappyCons (st) (sts)) of+ sts1@((HappyCons (st1@(action)) (_))) ->+ let drop_stk = happyDropStk k stk in+ happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk)) happyMonad2Reduce k nt fn 0# tk st sts stk = happyFail 0# tk st sts stk happyMonad2Reduce k nt fn j tk st sts stk =- happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))- where (sts1@((HappyCons (st1@(action)) (_)))) = happyDrop k (HappyCons (st) (sts))- drop_stk = happyDropStk k stk+ case happyDrop k (HappyCons (st) (sts)) of+ sts1@((HappyCons (st1@(action)) (_))) ->+ let drop_stk = happyDropStk k stk - (off) = indexShortOffAddr happyGotoOffsets st1- (off_i) = (off Happy_GHC_Exts.+# nt)- (new_state) = indexShortOffAddr happyTable off_i+ off = indexShortOffAddr happyGotoOffsets st1+ off_i = (off Happy_GHC_Exts.+# nt)+ new_state = indexShortOffAddr happyTable off_i + in+ happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk)) happyDrop 0# l = l happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t@@ -2433,9 +2483,9 @@ happyGoto nt j tk st = {- nothing -} happyDoAction j tk new_state- where (off) = indexShortOffAddr happyGotoOffsets st- (off_i) = (off Happy_GHC_Exts.+# nt)- (new_state) = indexShortOffAddr happyTable off_i+ where off = indexShortOffAddr happyGotoOffsets st+ off_i = (off Happy_GHC_Exts.+# nt)+ new_state = indexShortOffAddr happyTable off_i @@ -2445,8 +2495,8 @@ -- parse error if we are in recovery and we fail again happyFail 0# tk old_st _ stk@(x `HappyStk` _) =- let (i) = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in--- trace "failing" $ + let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in+-- trace "failing" $ happyError_ i tk {- We don't need state discarding for our restricted implementation of@@ -2455,16 +2505,16 @@ -- discard a state happyFail 0# tk old_st (HappyCons ((action)) (sts)) - (saved_tok `HappyStk` _ `HappyStk` stk) =--- trace ("discarding state, depth " ++ show (length stk)) $- happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))+ (saved_tok `HappyStk` _ `HappyStk` stk) =+-- trace ("discarding state, depth " ++ show (length stk)) $+ happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk)) -} -- Enter error recovery: generate an error token, -- save the old token and carry on. happyFail i tk (action) sts stk = -- trace "entering error recovery" $- happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)+ happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk) -- Internal happy errors: @@ -2482,9 +2532,9 @@ ----------------------------------------------------------------------------- -- Seq-ing. If the --strict flag is given, then Happy emits --- happySeq = happyDoSeq+-- happySeq = happyDoSeq -- otherwise it emits--- happySeq = happyDontSeq+-- happySeq = happyDontSeq happyDoSeq, happyDontSeq :: a -> b -> b happyDoSeq a b = a `seq` b
dist/build/ParserC.hs view
@@ -17,7 +17,7 @@ import qualified Data.Array as Happy_Data_Array import qualified GHC.Exts as Happy_GHC_Exts --- parser produced by Happy Version 1.18.9+-- parser produced by Happy Version 1.19.3 newtype HappyAbsSyn = HappyAbsSyn HappyAny #if __GLASGOW_HASKELL__ >= 607@@ -2275,23 +2275,74 @@ {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "<command-line>" #-}+{-# LINE 11 "<command-line>" #-}+# 1 "/usr/include/stdc-predef.h" 1 3 4++# 17 "/usr/include/stdc-predef.h" 3 4++++++++++++++++++++# 47 "/usr/include/stdc-predef.h" 3 4++# 59 "/usr/include/stdc-predef.h" 3 4+++++++++{-# LINE 11 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp -{-# LINE 30 "templates/GenericTemplate.hs" #-}+{-# LINE 13 "templates/GenericTemplate.hs" #-} ++++-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.+#if __GLASGOW_HASKELL__ > 706+#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)+#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)+#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)+#else+#define LT(n,m) (n Happy_GHC_Exts.<# m)+#define GTE(n,m) (n Happy_GHC_Exts.>=# m)+#define EQ(n,m) (n Happy_GHC_Exts.==# m)+#endif+{-# LINE 46 "templates/GenericTemplate.hs" #-}++ data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList -{-# LINE 51 "templates/GenericTemplate.hs" #-}+{-# LINE 67 "templates/GenericTemplate.hs" #-} -{-# LINE 61 "templates/GenericTemplate.hs" #-}+{-# LINE 77 "templates/GenericTemplate.hs" #-} -{-# LINE 70 "templates/GenericTemplate.hs" #-}+{-# LINE 86 "templates/GenericTemplate.hs" #-} infixr 9 `HappyStk` data HappyStk a = HappyStk a (HappyStk a)@@ -2308,9 +2359,9 @@ -- parse (a %partial parser). We must ignore the saved token on the top of -- the stack in this case. happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =- happyReturn1 ans+ happyReturn1 ans happyAccept j tk st sts (HappyStk ans _) = - (happyTcHack j (happyTcHack st)) (happyReturn1 ans)+ (happyTcHack j (happyTcHack st)) (happyReturn1 ans) ----------------------------------------------------------------------------- -- Arrays only: do the next action@@ -2318,37 +2369,35 @@ happyDoAction i tk st- = {- nothing -}+ = {- nothing -} - case action of- 0# -> {- nothing -}- happyFail i tk st- -1# -> {- nothing -}- happyAccept i tk st- n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}+ case action of+ 0# -> {- nothing -}+ happyFail i tk st+ -1# -> {- nothing -}+ happyAccept i tk st+ n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -} - (happyReduceArr Happy_Data_Array.! rule) i tk st- where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))- n -> {- nothing -}+ (happyReduceArr Happy_Data_Array.! rule) i tk st+ where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))+ n -> {- nothing -} - happyShift new_state i tk st- where (new_state) = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))- where (off) = indexShortOffAddr happyActOffsets st- (off_i) = (off Happy_GHC_Exts.+# i)- check = if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))- then (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)- else False- (action)+ happyShift new_state i tk st+ where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))+ where off = indexShortOffAddr happyActOffsets st+ off_i = (off Happy_GHC_Exts.+# i)+ check = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))+ then EQ(indexShortOffAddr happyCheck off_i, i)+ else False+ action | check = indexShortOffAddr happyTable off_i | otherwise = indexShortOffAddr happyDefActions st -{-# LINE 130 "templates/GenericTemplate.hs" #-} - indexShortOffAddr (HappyA# arr) off =- Happy_GHC_Exts.narrow16Int# i+ Happy_GHC_Exts.narrow16Int# i where i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low) high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))@@ -2367,13 +2416,13 @@ ----------------------------------------------------------------------------- -- HappyState data type (not arrays) -{-# LINE 163 "templates/GenericTemplate.hs" #-}+{-# LINE 170 "templates/GenericTemplate.hs" #-} ----------------------------------------------------------------------------- -- Shifting a token happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =- let (i) = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in+ let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in -- trace "shifting the error token" $ happyDoAction i tk new_state (HappyCons (st) (sts)) (stk) @@ -2409,30 +2458,33 @@ = happyFail 0# tk st sts stk happyReduce k nt fn j tk st sts stk = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of- sts1@((HappyCons (st1@(action)) (_))) ->- let r = fn stk in -- it doesn't hurt to always seq here...- happyDoSeq r (happyGoto nt j tk st1 sts1 r)+ sts1@((HappyCons (st1@(action)) (_))) ->+ let r = fn stk in -- it doesn't hurt to always seq here...+ happyDoSeq r (happyGoto nt j tk st1 sts1 r) happyMonadReduce k nt fn 0# tk st sts stk = happyFail 0# tk st sts stk happyMonadReduce k nt fn j tk st sts stk =- happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))- where (sts1@((HappyCons (st1@(action)) (_)))) = happyDrop k (HappyCons (st) (sts))- drop_stk = happyDropStk k stk+ case happyDrop k (HappyCons (st) (sts)) of+ sts1@((HappyCons (st1@(action)) (_))) ->+ let drop_stk = happyDropStk k stk in+ happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk)) happyMonad2Reduce k nt fn 0# tk st sts stk = happyFail 0# tk st sts stk happyMonad2Reduce k nt fn j tk st sts stk =- happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))- where (sts1@((HappyCons (st1@(action)) (_)))) = happyDrop k (HappyCons (st) (sts))- drop_stk = happyDropStk k stk+ case happyDrop k (HappyCons (st) (sts)) of+ sts1@((HappyCons (st1@(action)) (_))) ->+ let drop_stk = happyDropStk k stk - (off) = indexShortOffAddr happyGotoOffsets st1- (off_i) = (off Happy_GHC_Exts.+# nt)- (new_state) = indexShortOffAddr happyTable off_i+ off = indexShortOffAddr happyGotoOffsets st1+ off_i = (off Happy_GHC_Exts.+# nt)+ new_state = indexShortOffAddr happyTable off_i + in+ happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk)) happyDrop 0# l = l happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t@@ -2447,9 +2499,9 @@ happyGoto nt j tk st = {- nothing -} happyDoAction j tk new_state- where (off) = indexShortOffAddr happyGotoOffsets st- (off_i) = (off Happy_GHC_Exts.+# nt)- (new_state) = indexShortOffAddr happyTable off_i+ where off = indexShortOffAddr happyGotoOffsets st+ off_i = (off Happy_GHC_Exts.+# nt)+ new_state = indexShortOffAddr happyTable off_i @@ -2459,8 +2511,8 @@ -- parse error if we are in recovery and we fail again happyFail 0# tk old_st _ stk@(x `HappyStk` _) =- let (i) = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in--- trace "failing" $ + let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in+-- trace "failing" $ happyError_ i tk {- We don't need state discarding for our restricted implementation of@@ -2469,16 +2521,16 @@ -- discard a state happyFail 0# tk old_st (HappyCons ((action)) (sts)) - (saved_tok `HappyStk` _ `HappyStk` stk) =--- trace ("discarding state, depth " ++ show (length stk)) $- happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))+ (saved_tok `HappyStk` _ `HappyStk` stk) =+-- trace ("discarding state, depth " ++ show (length stk)) $+ happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk)) -} -- Enter error recovery: generate an error token, -- save the old token and carry on. happyFail i tk (action) sts stk = -- trace "entering error recovery" $- happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)+ happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk) -- Internal happy errors: @@ -2496,9 +2548,9 @@ ----------------------------------------------------------------------------- -- Seq-ing. If the --strict flag is given, then Happy emits --- happySeq = happyDoSeq+-- happySeq = happyDoSeq -- otherwise it emits--- happySeq = happyDontSeq+-- happySeq = happyDontSeq happyDoSeq, happyDontSeq :: a -> b -> b happyDoSeq a b = a `seq` b
logic-TPTP.cabal view
@@ -1,5 +1,5 @@ name: logic-TPTP -version: 0.4.0.0+version: 0.4.1.0 cabal-version: >= 1.6 build-type: Simple license: GPL@@ -40,7 +40,6 @@ testing/TestImportExportImportFile.hs testing/PrettyPrintFile.hs testing/ParseRandom.hs- MACROS.h tested-with: GHC==7.4.1 tested-with: GHC==7.2.1@@ -63,6 +62,7 @@ , QuickCheck >= 2 , mtl , pointed+ , transformers exposed-modules: Codec.TPTP.Import , Codec.TPTP.Base