atp-haskell 1.9 → 1.10
raw patch · 3 files changed
+85/−44 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Data.Logic.ATP.Apply: instance (Data.Data.Data term, Data.Data.Data predicate) => Data.Data.Data (Data.Logic.ATP.Apply.FOLAP predicate term)
- Data.Logic.ATP.Apply: instance (GHC.Classes.Eq term, GHC.Classes.Eq predicate) => GHC.Classes.Eq (Data.Logic.ATP.Apply.FOLAP predicate term)
- Data.Logic.ATP.Apply: instance (GHC.Classes.Ord term, GHC.Classes.Ord predicate) => GHC.Classes.Ord (Data.Logic.ATP.Apply.FOLAP predicate term)
- Data.Logic.ATP.Apply: instance (GHC.Read.Read term, GHC.Read.Read predicate) => GHC.Read.Read (Data.Logic.ATP.Apply.FOLAP predicate term)
- Data.Logic.ATP.Apply: type family TermOf atom;
- Data.Logic.ATP.Apply: }
- Data.Logic.ATP.Equate: infix 6 .=.
- Data.Logic.ATP.Equate: instance (Data.Data.Data term, Data.Data.Data predicate) => Data.Data.Data (Data.Logic.ATP.Equate.FOL predicate term)
- Data.Logic.ATP.Equate: instance (GHC.Classes.Eq term, GHC.Classes.Eq predicate) => GHC.Classes.Eq (Data.Logic.ATP.Equate.FOL predicate term)
- Data.Logic.ATP.Equate: instance (GHC.Classes.Ord term, GHC.Classes.Ord predicate) => GHC.Classes.Ord (Data.Logic.ATP.Equate.FOL predicate term)
- Data.Logic.ATP.Equate: instance (GHC.Read.Read term, GHC.Read.Read predicate) => GHC.Read.Read (Data.Logic.ATP.Equate.FOL predicate term)
- Data.Logic.ATP.Formulas: type family AtomOf formula;
- Data.Logic.ATP.Formulas: }
- Data.Logic.ATP.Lit: infix 6 ¬
- Data.Logic.ATP.Pretty: infixr 6 <>
- Data.Logic.ATP.Prop: infixl 2 <==>
- Data.Logic.ATP.Prop: infixl 4 ∨
- Data.Logic.ATP.Prop: infixl 5 `·`
- Data.Logic.ATP.Prop: infixr 3 →
- Data.Logic.ATP.Quantified: infixr 1 ∃
- Data.Logic.ATP.Quantified: instance (Data.Data.Data atom, Data.Data.Data v) => Data.Data.Data (Data.Logic.ATP.Quantified.QFormula v atom)
- Data.Logic.ATP.Quantified: type family VarOf formula;
- Data.Logic.ATP.Quantified: }
- Data.Logic.ATP.Skolem: type family SVarOf function;
- Data.Logic.ATP.Skolem: }
- Data.Logic.ATP.Term: instance (Data.Data.Data v, Data.Data.Data function) => Data.Data.Data (Data.Logic.ATP.Term.Term function v)
- Data.Logic.ATP.Term: type family FunOf term;
- Data.Logic.ATP.Term: }
- Data.Logic.ATP.Unif: type family UTermOf a;
- Data.Logic.ATP.Unif: }
+ Data.Logic.ATP.Apply: instance (Data.Data.Data predicate, Data.Data.Data term) => Data.Data.Data (Data.Logic.ATP.Apply.FOLAP predicate term)
+ Data.Logic.ATP.Apply: instance (GHC.Classes.Eq predicate, GHC.Classes.Eq term) => GHC.Classes.Eq (Data.Logic.ATP.Apply.FOLAP predicate term)
+ Data.Logic.ATP.Apply: instance (GHC.Classes.Ord predicate, GHC.Classes.Ord term) => GHC.Classes.Ord (Data.Logic.ATP.Apply.FOLAP predicate term)
+ Data.Logic.ATP.Apply: instance (GHC.Read.Read predicate, GHC.Read.Read term) => GHC.Read.Read (Data.Logic.ATP.Apply.FOLAP predicate term)
+ Data.Logic.ATP.Equate: instance (Data.Data.Data predicate, Data.Data.Data term) => Data.Data.Data (Data.Logic.ATP.Equate.FOL predicate term)
+ Data.Logic.ATP.Equate: instance (GHC.Classes.Eq predicate, GHC.Classes.Eq term) => GHC.Classes.Eq (Data.Logic.ATP.Equate.FOL predicate term)
+ Data.Logic.ATP.Equate: instance (GHC.Classes.Ord predicate, GHC.Classes.Ord term) => GHC.Classes.Ord (Data.Logic.ATP.Equate.FOL predicate term)
+ Data.Logic.ATP.Equate: instance (GHC.Read.Read predicate, GHC.Read.Read term) => GHC.Read.Read (Data.Logic.ATP.Equate.FOL predicate term)
+ Data.Logic.ATP.Quantified: instance (Data.Data.Data v, Data.Data.Data atom) => Data.Data.Data (Data.Logic.ATP.Quantified.QFormula v atom)
+ Data.Logic.ATP.Term: instance (Data.Data.Data function, Data.Data.Data v) => Data.Data.Data (Data.Logic.ATP.Term.Term function v)
- Data.Logic.ATP.Apply: class (IsAtom atom, IsPredicate (PredOf atom), IsTerm (TermOf atom)) => HasApply atom where type PredOf atom type TermOf atom where {
+ Data.Logic.ATP.Apply: class (IsAtom atom, IsPredicate (PredOf atom), IsTerm (TermOf atom)) => HasApply atom where type family PredOf atom type family TermOf atom
- Data.Logic.ATP.DefCNF: defcnf1 :: forall pf. (IsPropositional pf, JustPropositional pf, NumAtom (AtomOf pf), Ord pf) => pf -> pf
+ Data.Logic.ATP.DefCNF: defcnf1 :: (IsPropositional pf, JustPropositional pf, NumAtom (AtomOf pf), Ord pf) => pf -> pf
- Data.Logic.ATP.DefCNF: defcnf3 :: forall pf. (JustPropositional pf, Ord pf, NumAtom (AtomOf pf)) => pf -> pf
+ Data.Logic.ATP.DefCNF: defcnf3 :: (JustPropositional pf, Ord pf, NumAtom (AtomOf pf)) => pf -> pf
- Data.Logic.ATP.Equal: equalitize :: forall formula atom term v function. (atom ~ AtomOf formula, term ~ TermOf atom, v ~ VarOf formula, v ~ TVarOf term, function ~ FunOf term, IsQuantified formula, HasEquate atom, IsTerm term, Ord formula, Ord atom) => formula -> formula
+ Data.Logic.ATP.Equal: equalitize :: (atom ~ AtomOf formula, term ~ TermOf atom, v ~ VarOf formula, v ~ TVarOf term, function ~ FunOf term, IsQuantified formula, HasEquate atom, IsTerm term, Ord formula, Ord atom) => formula -> formula
- Data.Logic.ATP.Equal: function_congruence :: forall fof atom term v p function. (atom ~ AtomOf fof, term ~ TermOf atom, p ~ PredOf atom, v ~ VarOf fof, v ~ TVarOf term, function ~ FunOf term, IsQuantified fof, HasEquate atom, IsTerm term, Ord fof) => (function, Int) -> Set fof
+ Data.Logic.ATP.Equal: function_congruence :: (atom ~ AtomOf fof, term ~ TermOf atom, p ~ PredOf atom, v ~ VarOf fof, v ~ TVarOf term, function ~ FunOf term, IsQuantified fof, HasEquate atom, IsTerm term, Ord fof) => (function, Int) -> Set fof
- Data.Logic.ATP.FOL: holdsQuantified :: forall formula function predicate dom. (IsQuantified formula, FiniteInterpretation (AtomOf formula) function predicate (VarOf formula) dom, FiniteInterpretation formula function predicate (VarOf formula) dom) => Interp function predicate dom -> Map (VarOf formula) dom -> formula -> Bool
+ Data.Logic.ATP.FOL: holdsQuantified :: (IsQuantified formula, FiniteInterpretation (AtomOf formula) function predicate (VarOf formula) dom, FiniteInterpretation formula function predicate (VarOf formula) dom) => Interp function predicate dom -> Map (VarOf formula) dom -> formula -> Bool
- Data.Logic.ATP.Formulas: class (Pretty formula, HasFixity formula, IsAtom (AtomOf formula)) => IsFormula formula where type AtomOf formula where {
+ Data.Logic.ATP.Formulas: class (Pretty formula, HasFixity formula, IsAtom (AtomOf formula)) => IsFormula formula where type family AtomOf formula
- Data.Logic.ATP.Herbrand: davisputnam :: forall formula atom term v function. (IsFirstOrder formula, Ord formula, HasSkolem function, atom ~ AtomOf formula, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => formula -> Int
+ Data.Logic.ATP.Herbrand: davisputnam :: (IsFirstOrder formula, Ord formula, HasSkolem function, atom ~ AtomOf formula, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => formula -> Int
- Data.Logic.ATP.Herbrand: davisputnam' :: forall formula atom term v function. (IsFirstOrder formula, Ord formula, HasSkolem function, atom ~ AtomOf formula, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => formula -> formula -> formula -> Int
+ Data.Logic.ATP.Herbrand: davisputnam' :: (IsFirstOrder formula, Ord formula, HasSkolem function, atom ~ AtomOf formula, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => formula -> formula -> formula -> Int
- Data.Logic.ATP.Herbrand: gilmore :: forall fof atom term v function. (IsFirstOrder fof, Ord fof, HasSkolem function, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => fof -> Int
+ Data.Logic.ATP.Herbrand: gilmore :: (IsFirstOrder fof, Ord fof, HasSkolem function, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => fof -> Int
- Data.Logic.ATP.Herbrand: herbloop :: forall lit atom function v term. (atom ~ AtomOf lit, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function, JustLiteral lit, HasApply atom, IsTerm term) => (Set (Set lit) -> (lit -> lit) -> Set (Set lit) -> Set (Set lit)) -> (Set (Set lit) -> Bool) -> Set (Set lit) -> Set term -> Set (function, Int) -> [TVarOf term] -> Int -> Set (Set lit) -> Set [term] -> Set [term] -> Set [term]
+ Data.Logic.ATP.Herbrand: herbloop :: (atom ~ AtomOf lit, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function, JustLiteral lit, HasApply atom, IsTerm term) => (Set (Set lit) -> (lit -> lit) -> Set (Set lit) -> Set (Set lit)) -> (Set (Set lit) -> Bool) -> Set (Set lit) -> Set term -> Set (function, Int) -> [TVarOf term] -> Int -> Set (Set lit) -> Set [term] -> Set [term] -> Set [term]
- Data.Logic.ATP.Lib: allnonemptysubsets :: forall a. Ord a => Set a -> Set (Set a)
+ Data.Logic.ATP.Lib: allnonemptysubsets :: Ord a => Set a -> Set (Set a)
- Data.Logic.ATP.Lib: allpairs :: forall a b c set. (SetLike set, Ord c) => (a -> b -> c) -> set a -> set b -> set c
+ Data.Logic.ATP.Lib: allpairs :: (SetLike set, Ord c) => (a -> b -> c) -> set a -> set b -> set c
- Data.Logic.ATP.Lib: allsets :: forall a b. (Num a, Eq a, Ord b) => a -> Set b -> Set (Set b)
+ Data.Logic.ATP.Lib: allsets :: (Num a, Eq a, Ord b) => a -> Set b -> Set (Set b)
- Data.Logic.ATP.Lib: allsubsets :: forall a. Ord a => Set a -> Set (Set a)
+ Data.Logic.ATP.Lib: allsubsets :: Ord a => Set a -> Set (Set a)
- Data.Logic.ATP.Lib: optimize :: forall s a b. (SetLike s, Foldable s) => (b -> b -> Ordering) -> (a -> b) -> s a -> Maybe a
+ Data.Logic.ATP.Lib: optimize :: (SetLike s, Foldable s) => (b -> b -> Ordering) -> (a -> b) -> s a -> Maybe a
- Data.Logic.ATP.Lib: slMap :: forall a b. (SetLike c, Ord b) => (a -> b) -> c a -> c b
+ Data.Logic.ATP.Lib: slMap :: (SetLike c, Ord b) => (a -> b) -> c a -> c b
- Data.Logic.ATP.Lib: slView :: forall a. SetLike c => c a -> Maybe (a, c a)
+ Data.Logic.ATP.Lib: slView :: SetLike c => c a -> Maybe (a, c a)
- Data.Logic.ATP.Lib: undefine :: forall k a. Ord k => k -> Map k a -> Map k a
+ Data.Logic.ATP.Lib: undefine :: Ord k => k -> Map k a -> Map k a
- Data.Logic.ATP.Meson: meson1 :: forall m fof atom predicate term function v. (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Ord fof, HasSkolem function, Monad m, atom ~ AtomOf fof, term ~ TermOf atom, predicate ~ PredOf atom, function ~ FunOf term, v ~ VarOf fof, v ~ SVarOf function) => Maybe Depth -> fof -> SkolemT m function (Set (Failing Depth))
+ Data.Logic.ATP.Meson: meson1 :: (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Ord fof, HasSkolem function, Monad m, atom ~ AtomOf fof, term ~ TermOf atom, predicate ~ PredOf atom, function ~ FunOf term, v ~ VarOf fof, v ~ SVarOf function) => Maybe Depth -> fof -> SkolemT m function (Set (Failing Depth))
- Data.Logic.ATP.Meson: meson2 :: forall m fof atom term function v. (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Ord fof, HasSkolem function, Monad m, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ VarOf fof, v ~ SVarOf function) => Maybe Depth -> fof -> SkolemT m function (Set (Failing Depth))
+ Data.Logic.ATP.Meson: meson2 :: (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Ord fof, HasSkolem function, Monad m, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ VarOf fof, v ~ SVarOf function) => Maybe Depth -> fof -> SkolemT m function (Set (Failing Depth))
- Data.Logic.ATP.Parser: def :: forall s u m. Stream s m Char => GenLanguageDef s u m
+ Data.Logic.ATP.Parser: def :: Stream s m Char => GenLanguageDef s u m
- Data.Logic.ATP.Parser: existentialQuantifier :: forall formula s u m. (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: existentialQuantifier :: (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: folconstant :: forall term t t1 t2. (IsTerm term, Stream t t2 Char) => ParsecT t t1 t2 term
+ Data.Logic.ATP.Parser: folconstant :: (IsTerm term, Stream t t2 Char) => ParsecT t t1 t2 term
- Data.Logic.ATP.Parser: folconstant_numeric :: forall term t t1 t2. (IsTerm term, Stream t t2 Char) => ParsecT t t1 t2 term
+ Data.Logic.ATP.Parser: folconstant_numeric :: (IsTerm term, Stream t t2 Char) => ParsecT t t1 t2 term
- Data.Logic.ATP.Parser: folconstant_reserved :: forall term t t1 t2. (IsTerm term, Stream t t2 Char) => String -> ParsecT t t1 t2 term
+ Data.Logic.ATP.Parser: folconstant_reserved :: (IsTerm term, Stream t t2 Char) => String -> ParsecT t t1 t2 term
- Data.Logic.ATP.Parser: folfunction :: forall term s u m. (IsTerm term, Stream s m Char) => ParsecT s u m term
+ Data.Logic.ATP.Parser: folfunction :: (IsTerm term, Stream s m Char) => ParsecT s u m term
- Data.Logic.ATP.Parser: folfunction_infix :: forall term s u m. (IsTerm term, Stream s m Char) => ParsecT s u m term
+ Data.Logic.ATP.Parser: folfunction_infix :: (IsTerm term, Stream s m Char) => ParsecT s u m term
- Data.Logic.ATP.Parser: folparser :: forall formula s u m. (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: folparser :: (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: folpredicate :: forall formula s u m. (IsFormula formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: folpredicate :: (IsFormula formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: folpredicate_infix :: forall formula s u m. (IsFormula formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: folpredicate_infix :: (IsFormula formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: folsubterm :: forall term s u m. (IsTerm term, Stream s m Char) => ParsecT s u m term
+ Data.Logic.ATP.Parser: folsubterm :: (IsTerm term, Stream s m Char) => ParsecT s u m term
- Data.Logic.ATP.Parser: folsubterm_prefix :: forall term s u m. (IsTerm term, Stream s m Char) => ParsecT s u m term
+ Data.Logic.ATP.Parser: folsubterm_prefix :: (IsTerm term, Stream s m Char) => ParsecT s u m term
- Data.Logic.ATP.Parser: folterm :: forall formula s u m. (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: folterm :: (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: forallQuantifier :: forall formula s u m. (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: forallQuantifier :: (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: litexprparser :: forall formula s u m. (IsLiteral formula, Stream s m Char) => ParsecT s u m formula -> ParsecT s u m formula
+ Data.Logic.ATP.Parser: litexprparser :: (IsLiteral formula, Stream s m Char) => ParsecT s u m formula -> ParsecT s u m formula
- Data.Logic.ATP.Parser: litparser :: forall formula s u m. (JustLiteral formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: litparser :: (JustLiteral formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: litterm :: forall formula s u m. (JustLiteral formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: litterm :: (JustLiteral formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: m_angles :: forall t t1 t2. Stream t t2 Char => forall a. ParsecT t t1 t2 a -> ParsecT t t1 t2 a
+ Data.Logic.ATP.Parser: m_angles :: Stream t t2 Char => forall a. ParsecT t t1 t2 a -> ParsecT t t1 t2 a
- Data.Logic.ATP.Parser: m_identifier :: forall t t1 t2. Stream t t2 Char => ParsecT t t1 t2 String
+ Data.Logic.ATP.Parser: m_identifier :: Stream t t2 Char => ParsecT t t1 t2 String
- Data.Logic.ATP.Parser: m_integer :: forall t t1 t2. Stream t t2 Char => ParsecT t t1 t2 Integer
+ Data.Logic.ATP.Parser: m_integer :: Stream t t2 Char => ParsecT t t1 t2 Integer
- Data.Logic.ATP.Parser: m_parens :: forall t t1 t2. Stream t t2 Char => forall a. ParsecT t t1 t2 a -> ParsecT t t1 t2 a
+ Data.Logic.ATP.Parser: m_parens :: Stream t t2 Char => forall a. ParsecT t t1 t2 a -> ParsecT t t1 t2 a
- Data.Logic.ATP.Parser: m_reserved :: forall t t1 t2. Stream t t2 Char => String -> ParsecT t t1 t2 ()
+ Data.Logic.ATP.Parser: m_reserved :: Stream t t2 Char => String -> ParsecT t t1 t2 ()
- Data.Logic.ATP.Parser: m_reservedOp :: forall t t1 t2. Stream t t2 Char => String -> ParsecT t t1 t2 ()
+ Data.Logic.ATP.Parser: m_reservedOp :: Stream t t2 Char => String -> ParsecT t t1 t2 ()
- Data.Logic.ATP.Parser: m_symbol :: forall t t1 t2. Stream t t2 Char => String -> ParsecT t t1 t2 String
+ Data.Logic.ATP.Parser: m_symbol :: Stream t t2 Char => String -> ParsecT t t1 t2 String
- Data.Logic.ATP.Parser: m_whiteSpace :: forall t t1 t2. Stream t t2 Char => ParsecT t t1 t2 ()
+ Data.Logic.ATP.Parser: m_whiteSpace :: Stream t t2 Char => ParsecT t t1 t2 ()
- Data.Logic.ATP.Parser: propexprparser :: forall formula s u m. (IsPropositional formula, Stream s m Char) => ParsecT s u m formula -> ParsecT s u m formula
+ Data.Logic.ATP.Parser: propexprparser :: (IsPropositional formula, Stream s m Char) => ParsecT s u m formula -> ParsecT s u m formula
- Data.Logic.ATP.Parser: propparser :: forall formula s u m. (JustPropositional formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: propparser :: (JustPropositional formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: propterm :: forall formula s u m. (JustPropositional formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
+ Data.Logic.ATP.Parser: propterm :: (JustPropositional formula, HasEquate (AtomOf formula), Stream s m Char) => ParsecT s u m formula
- Data.Logic.ATP.Parser: quantifierId :: forall formula s u m. (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => String -> (String -> formula -> formula) -> ParsecT s u m formula
+ Data.Logic.ATP.Parser: quantifierId :: (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => String -> (String -> formula -> formula) -> ParsecT s u m formula
- Data.Logic.ATP.Parser: quantifierOp :: forall formula s u m. (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => String -> (String -> formula -> formula) -> ParsecT s u m formula
+ Data.Logic.ATP.Parser: quantifierOp :: (IsQuantified formula, HasEquate (AtomOf formula), Stream s m Char) => String -> (String -> formula -> formula) -> ParsecT s u m formula
- Data.Logic.ATP.Prolog: renamerule :: forall lit atom term v. (IsLiteral lit, JustLiteral lit, Ord lit, HasApply atom, IsTerm term, atom ~ AtomOf lit, term ~ TermOf atom, v ~ TVarOf term) => Int -> PrologRule lit -> (PrologRule lit, Int)
+ Data.Logic.ATP.Prolog: renamerule :: (IsLiteral lit, JustLiteral lit, Ord lit, HasApply atom, IsTerm term, atom ~ AtomOf lit, term ~ TermOf atom, v ~ TVarOf term) => Int -> PrologRule lit -> (PrologRule lit, Int)
- Data.Logic.ATP.Prop: cnf' :: forall pf. (JustPropositional pf, Ord pf) => pf -> pf
+ Data.Logic.ATP.Prop: cnf' :: (JustPropositional pf, Ord pf) => pf -> pf
- Data.Logic.ATP.Prop: dnf :: forall pf. (JustPropositional pf, Ord pf) => pf -> pf
+ Data.Logic.ATP.Prop: dnf :: (JustPropositional pf, Ord pf) => pf -> pf
- Data.Logic.ATP.Prop: prettyPropositional :: forall pf. JustPropositional pf => Side -> PrettyLevel -> Rational -> pf -> Doc
+ Data.Logic.ATP.Prop: prettyPropositional :: JustPropositional pf => Side -> PrettyLevel -> Rational -> pf -> Doc
- Data.Logic.ATP.Quantified: associativityQuantified :: forall formula. IsQuantified formula => formula -> Associativity
+ Data.Logic.ATP.Quantified: associativityQuantified :: IsQuantified formula => formula -> Associativity
- Data.Logic.ATP.Quantified: class (IsPropositional formula, IsVariable (VarOf formula)) => IsQuantified formula where type VarOf formula where {
+ Data.Logic.ATP.Quantified: class (IsPropositional formula, IsVariable (VarOf formula)) => IsQuantified formula where type family VarOf formula
- Data.Logic.ATP.Quantified: convertQuantified :: forall f1 f2. (IsQuantified f1, IsQuantified f2) => (AtomOf f1 -> AtomOf f2) -> (VarOf f1 -> VarOf f2) -> f1 -> f2
+ Data.Logic.ATP.Quantified: convertQuantified :: (IsQuantified f1, IsQuantified f2) => (AtomOf f1 -> AtomOf f2) -> (VarOf f1 -> VarOf f2) -> f1 -> f2
- Data.Logic.ATP.Quantified: precedenceQuantified :: forall formula. IsQuantified formula => formula -> Precedence
+ Data.Logic.ATP.Quantified: precedenceQuantified :: IsQuantified formula => formula -> Precedence
- Data.Logic.ATP.Quantified: prettyQuantified :: forall fof v. (IsQuantified fof, v ~ VarOf fof) => Side -> PrettyLevel -> Rational -> fof -> Doc
+ Data.Logic.ATP.Quantified: prettyQuantified :: (IsQuantified fof, v ~ VarOf fof) => Side -> PrettyLevel -> Rational -> fof -> Doc
- Data.Logic.ATP.Resolution: presolution :: forall fof atom term v function m. (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Match (atom, atom) v term, HasSkolem function, Monad m, Ord fof, Pretty fof, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ VarOf fof, v ~ SVarOf function) => fof -> SkolemT m function (Set (Failing Bool))
+ Data.Logic.ATP.Resolution: presolution :: (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Match (atom, atom) v term, HasSkolem function, Monad m, Ord fof, Pretty fof, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ VarOf fof, v ~ SVarOf function) => fof -> SkolemT m function (Set (Failing Bool))
- Data.Logic.ATP.Resolution: resolution1 :: forall m fof atom term v function. (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Ord fof, HasSkolem function, Monad m, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => fof -> SkolemT m function (Set (Failing Bool))
+ Data.Logic.ATP.Resolution: resolution1 :: (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Ord fof, HasSkolem function, Monad m, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => fof -> SkolemT m function (Set (Failing Bool))
- Data.Logic.ATP.Resolution: resolution2 :: forall fof atom term v function m. (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Match (atom, atom) v term, HasSkolem function, Monad m, Ord fof, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => fof -> SkolemT m function (Set (Failing Bool))
+ Data.Logic.ATP.Resolution: resolution2 :: (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Match (atom, atom) v term, HasSkolem function, Monad m, Ord fof, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => fof -> SkolemT m function (Set (Failing Bool))
- Data.Logic.ATP.Resolution: resolution3 :: forall fof atom term v function m. (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Match (atom, atom) v term, HasSkolem function, Monad m, Ord fof, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ VarOf fof, v ~ SVarOf function) => fof -> SkolemT m function (Set (Failing Bool))
+ Data.Logic.ATP.Resolution: resolution3 :: (IsFirstOrder fof, Unify (atom, atom), term ~ UTermOf (atom, atom), Match (atom, atom) v term, HasSkolem function, Monad m, Ord fof, atom ~ AtomOf fof, term ~ TermOf atom, function ~ FunOf term, v ~ VarOf fof, v ~ SVarOf function) => fof -> SkolemT m function (Set (Failing Bool))
- Data.Logic.ATP.Skolem: class (IsFunction function, IsVariable (SVarOf function)) => HasSkolem function where type SVarOf function where {
+ Data.Logic.ATP.Skolem: class (IsFunction function, IsVariable (SVarOf function)) => HasSkolem function where type family SVarOf function
- Data.Logic.ATP.Tableaux: prawitz :: forall formula atom term function v. (IsFirstOrder formula, Ord formula, Unify (atom, atom), term ~ UTermOf (atom, atom), HasSkolem function, Show formula, atom ~ AtomOf formula, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => formula -> Int
+ Data.Logic.ATP.Tableaux: prawitz :: (IsFirstOrder formula, Ord formula, Unify (atom, atom), term ~ UTermOf (atom, atom), HasSkolem function, Show formula, atom ~ AtomOf formula, term ~ TermOf atom, function ~ FunOf term, v ~ TVarOf term, v ~ SVarOf function) => formula -> Int
- Data.Logic.ATP.Term: class (Eq term, Ord term, Pretty term, Show term, IsString term, HasFixity term, IsVariable (TVarOf term), IsFunction (FunOf term)) => IsTerm term where type TVarOf term type FunOf term where {
+ Data.Logic.ATP.Term: class (Eq term, Ord term, Pretty term, Show term, IsString term, HasFixity term, IsVariable (TVarOf term), IsFunction (FunOf term)) => IsTerm term where type family TVarOf term type family FunOf term
- Data.Logic.ATP.Unif: class (IsTerm (UTermOf a), IsVariable (TVarOf (UTermOf a))) => Unify a where type UTermOf a where {
+ Data.Logic.ATP.Unif: class (IsTerm (UTermOf a), IsVariable (TVarOf (UTermOf a))) => Unify a where type family UTermOf a
- Data.Logic.ATP.Unif: fullunify :: (IsTerm term, v ~ TVarOf term, f ~ FunOf term) => [(term, term)] -> Failing (Map v term)
+ Data.Logic.ATP.Unif: fullunify :: (IsTerm term, v ~ TVarOf term, f ~ FunOf term, Monad m) => [(term, term)] -> m (Map v term)
- Data.Logic.ATP.Unif: unify :: Unify a => a -> StateT (Map (TVarOf (UTermOf a)) (UTermOf a)) Failing ()
+ Data.Logic.ATP.Unif: unify :: (Unify a, Monad m) => a -> StateT (Map (TVarOf (UTermOf a)) (UTermOf a)) m ()
- Data.Logic.ATP.Unif: unify_and_apply :: (IsTerm term, v ~ TVarOf term, f ~ FunOf term) => [(term, term)] -> Failing [(term, term)]
+ Data.Logic.ATP.Unif: unify_and_apply :: (IsTerm term, v ~ TVarOf term, f ~ FunOf term, Monad m) => [(term, term)] -> m [(term, term)]
- Data.Logic.ATP.Unif: unify_atoms :: (JustApply atom1, term ~ TermOf atom1, JustApply atom2, term ~ TermOf atom2, v ~ TVarOf term, PredOf atom1 ~ PredOf atom2) => (atom1, atom2) -> StateT (Map v term) Failing ()
+ Data.Logic.ATP.Unif: unify_atoms :: (JustApply atom1, term ~ TermOf atom1, JustApply atom2, term ~ TermOf atom2, v ~ TVarOf term, PredOf atom1 ~ PredOf atom2, Monad m) => (atom1, atom2) -> StateT (Map v term) m ()
- Data.Logic.ATP.Unif: unify_atoms_eq :: (HasEquate atom1, term ~ TermOf atom1, HasEquate atom2, term ~ TermOf atom2, PredOf atom1 ~ PredOf atom2, v ~ TVarOf term) => atom1 -> atom2 -> StateT (Map v term) Failing ()
+ Data.Logic.ATP.Unif: unify_atoms_eq :: (HasEquate atom1, term ~ TermOf atom1, HasEquate atom2, term ~ TermOf atom2, PredOf atom1 ~ PredOf atom2, v ~ TVarOf term, Monad m) => atom1 -> atom2 -> StateT (Map v term) m ()
- Data.Logic.ATP.Unif: unify_literals :: (IsLiteral lit1, HasApply atom1, atom1 ~ AtomOf lit1, term ~ TermOf atom1, JustLiteral lit2, HasApply atom2, atom2 ~ AtomOf lit2, term ~ TermOf atom2, Unify (atom1, atom2), term ~ UTermOf (atom1, atom2), v ~ TVarOf term) => lit1 -> lit2 -> StateT (Map v term) Failing ()
+ Data.Logic.ATP.Unif: unify_literals :: (IsLiteral lit1, HasApply atom1, atom1 ~ AtomOf lit1, term ~ TermOf atom1, JustLiteral lit2, HasApply atom2, atom2 ~ AtomOf lit2, term ~ TermOf atom2, Unify (atom1, atom2), term ~ UTermOf (atom1, atom2), v ~ TVarOf term, Monad m) => lit1 -> lit2 -> StateT (Map v term) m ()
- Data.Logic.ATP.Unif: unify_terms :: (IsTerm term, v ~ TVarOf term) => [(term, term)] -> StateT (Map v term) Failing ()
+ Data.Logic.ATP.Unif: unify_terms :: (IsTerm term, v ~ TVarOf term, Monad m) => [(term, term)] -> StateT (Map v term) m ()
Files
- .travis.yml +60/−22
- atp-haskell.cabal +2/−1
- src/Data/Logic/ATP/Unif.hs +23/−21
.travis.yml view
@@ -1,44 +1,82 @@+# This file has been generated -- see https://github.com/hvr/multi-ghc-travis+language: c sudo: false +cache:+ directories:+ - $HOME/.cabsnap+ - $HOME/.cabal/packages++before_cache:+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar+ matrix: include:- - env: CABALVER=1.22 GHCVER=7.10.2- addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2],sources: [hvr-ghc]}}+ - env: CABALVER=1.22 GHCVER=7.10.3+ compiler: ": #GHC 7.10.3"+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}} - env: CABALVER=head GHCVER=head- addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}+ compiler: ": #GHC head"+ addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}} allow_failures:- - env: CABALVER=head GHCVER=head+ - env: CABALVER=head GHCVER=head before_install:+ - unset CC - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH install: - cabal --version - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"- - travis_retry cabal update- - cabal install --only-dependencies --enable-tests --enable-benchmarks+ - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];+ then+ zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >+ $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;+ fi+ - travis_retry cabal update -v+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config+ - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt+ - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt -# Here starts the actual work to be performed for the package under-# test; any command which exits with a non-zero exit code causes the-# build to fail.+# check whether current requested install-plan matches cached package-db snapshot+ - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;+ then+ echo "cabal build-cache HIT";+ rm -rfv .ghc;+ cp -a $HOME/.cabsnap/ghc $HOME/.ghc;+ cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;+ else+ echo "cabal build-cache MISS";+ rm -rf $HOME/.cabsnap;+ mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;+ cabal install --only-dependencies --enable-tests --enable-benchmarks;+ fi +# snapshot package-db on cache miss+ - if [ ! -d $HOME/.cabsnap ];+ then+ echo "snapshotting package-db to build-cache";+ mkdir $HOME/.cabsnap;+ cp -a $HOME/.ghc $HOME/.cabsnap/ghc;+ cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;+ fi++# Here starts the actual work to be performed for the package under test;+# any command which exits with a non-zero exit code causes the build to fail. script:- - cabal configure --enable-tests -v2 # -v2 provides useful information for debugging+ - if [ -f configure.ac ]; then autoreconf -i; fi+ - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging - cabal build # this builds all libraries and executables (including tests/benchmarks) - cabal test- # - cabal check+# - cabal check - cabal sdist # tests that a source-distribution can be generated -# The following scriptlet checks that the resulting source distribution can be built & installed- - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;- cd dist/;- if [ -f "$SRC_TGZ" ]; then- cabal install --force-reinstalls "$SRC_TGZ";- else- echo "expected '$SRC_TGZ' not found";- exit 1;- fi+# Check that the resulting source distribution can be built & installed.+# If there are no other `.tar.gz` files in `dist`, this can be even simpler:+# `cabal install --force-reinstalls dist/*-*.tar.gz`+ - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&+ (cd dist && cabal install --force-reinstalls "$SRC_TGZ") -after_script:- - cat dist/test/*.log+# EOF
atp-haskell.cabal view
@@ -1,5 +1,5 @@ Name: atp-haskell-Version: 1.9+Version: 1.10 Synopsis: Translation from Ocaml to Haskell of John Harrison's ATP code Description: This package is a liberal translation from OCaml to Haskell of the automated theorem prover written in OCaml in@@ -15,6 +15,7 @@ Cabal-version: >= 1.9 Build-Type: Simple Extra-Source-Files: tests/Extra.hs, .travis.yml, .ghci+Tested-With: GHC == 7.10.3, GHC == 7.11.* Source-Repository head type: git
src/Data/Logic/ATP/Unif.hs view
@@ -52,36 +52,38 @@ -- EqualityT a) b)@. class (IsTerm (UTermOf a), IsVariable (TVarOf (UTermOf a))) => Unify a where type UTermOf a- unify :: a -> StateT (Map (TVarOf (UTermOf a)) (UTermOf a)) Failing ()+ unify :: Monad m => a -> StateT (Map (TVarOf (UTermOf a)) (UTermOf a)) m () -unify_terms :: (IsTerm term, v ~ TVarOf term) => [(term,term)] -> StateT (Map v term) Failing ()+unify_terms :: (IsTerm term, v ~ TVarOf term, Monad m) =>+ [(term,term)] -> StateT (Map v term) m () unify_terms = mapM_ (uncurry unify_term_pair) -unify_term_pair :: forall term v f. (IsTerm term, v ~ TVarOf term, f ~ FunOf term) =>- term -> term -> StateT (Map v term) Failing ()+unify_term_pair :: forall term v f m.+ (IsTerm term, v ~ TVarOf term, f ~ FunOf term, Monad m) =>+ term -> term -> StateT (Map v term) m () unify_term_pair a b = foldTerm (vr b) (\ f fargs -> foldTerm (vr a) (fn f fargs) b) a where- vr :: term -> v -> StateT (Map v term) Failing ()+ vr :: term -> v -> StateT (Map v term) m () vr t x = (Map.lookup x <$> get) >>= maybe (istriv x t >>= bool (modify (Map.insert x t)) (return ())) (\y -> unify_term_pair y t)- fn :: f -> [term] -> f -> [term] -> StateT (Map v term) Failing ()+ fn :: f -> [term] -> f -> [term] -> StateT (Map v term) m () fn f fargs g gargs = if f == g && length fargs == length gargs then mapM_ (uncurry unify_term_pair) (zip fargs gargs) else fail "impossible unification" -istriv :: forall term v. (IsTerm term, v ~ TVarOf term) =>- v -> term -> StateT (Map v term) Failing Bool+istriv :: forall term v m. (IsTerm term, v ~ TVarOf term, Monad m) =>+ v -> term -> StateT (Map v term) m Bool istriv x t = foldTerm vr fn t where- -- vr :: v -> StateT (Map v term) Failing Bool+ vr :: v -> StateT (Map v term) m Bool vr y | x == y = return True vr y = (Map.lookup y <$> get) >>= maybe (return False) (istriv x)- -- fn :: f -> [term] -> StateT (Map v term) Failing Bool+ fn :: f -> [term] -> StateT (Map v term) m Bool fn _ args = mapM (istriv x) args >>= bool (return False) (fail "cyclic") . or -- | Solve to obtain a single instantiation.@@ -92,13 +94,13 @@ where env' = Map.map (tsubst env) env -- | Unification reaching a final solved form (often this isn't needed).-fullunify :: (IsTerm term, v ~ TVarOf term, f ~ FunOf term) =>- [(term,term)] -> Failing (Map v term)+fullunify :: (IsTerm term, v ~ TVarOf term, f ~ FunOf term, Monad m) =>+ [(term,term)] -> m (Map v term) fullunify eqs = solve <$> execStateT (unify_terms eqs) Map.empty -- | Examples.-unify_and_apply :: (IsTerm term, v ~ TVarOf term, f ~ FunOf term) =>- [(term, term)] -> Failing [(term, term)]+unify_and_apply :: (IsTerm term, v ~ TVarOf term, f ~ FunOf term, Monad m) =>+ [(term, term)] -> m [(term, term)] unify_and_apply eqs = fullunify eqs >>= \i -> return $ List.map (\ (t1, t2) -> (tsubst i t1, tsubst i t2)) eqs @@ -108,8 +110,8 @@ -- who cares. unify_literals :: (IsLiteral lit1, HasApply atom1, atom1 ~ AtomOf lit1, term ~ TermOf atom1, JustLiteral lit2, HasApply atom2, atom2 ~ AtomOf lit2, term ~ TermOf atom2,- Unify (atom1, atom2), term ~ UTermOf (atom1, atom2), v ~ TVarOf term) =>- lit1 -> lit2 -> StateT (Map v term) Failing ()+ Unify (atom1, atom2), term ~ UTermOf (atom1, atom2), v ~ TVarOf term, Monad m) =>+ lit1 -> lit2 -> StateT (Map v term) m () unify_literals f1 f2 = fromMaybe (fail "Can't unify literals") (zipLiterals' ho ne tf at f1 f2) where@@ -120,21 +122,21 @@ unify_atoms :: (JustApply atom1, term ~ TermOf atom1, JustApply atom2, term ~ TermOf atom2,- v ~ TVarOf term, PredOf atom1 ~ PredOf atom2) =>- (atom1, atom2) -> StateT (Map v term) Failing ()+ v ~ TVarOf term, PredOf atom1 ~ PredOf atom2, Monad m) =>+ (atom1, atom2) -> StateT (Map v term) m () unify_atoms (a1, a2) = maybe (fail "unify_atoms") id (zipApplys (\_ tpairs -> Just (unify_terms tpairs)) a1 a2) unify_atoms_eq :: (HasEquate atom1, term ~ TermOf atom1, HasEquate atom2, term ~ TermOf atom2,- PredOf atom1 ~ PredOf atom2, v ~ TVarOf term) =>- atom1 -> atom2 -> StateT (Map v term) Failing ()+ PredOf atom1 ~ PredOf atom2, v ~ TVarOf term, Monad m) =>+ atom1 -> atom2 -> StateT (Map v term) m () unify_atoms_eq a1 a2 = maybe (fail "unify_atoms") id (zipEquates (\l1 r1 l2 r2 -> Just (unify_terms [(l1, l2), (r1, r2)])) (\_ tpairs -> Just (unify_terms tpairs)) a1 a2) ---unify_and_apply' :: (v ~ TVarOf term, f ~ FunOf term, IsTerm term) => [(term, term)] -> Failing [(term, term)]+--unify_and_apply' :: (v ~ TVarOf term, f ~ FunOf term, IsTerm term, Monad m) => [(term, term)] -> m [(term, term)] --unify_and_apply' eqs = -- mapM app eqs -- where