A Combinator Language for Theorem Discovery Phil Scott and Jacques Fleuriot July 13, 2012 Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Overview ◮ Example: Incidence Reasoning ◮ Monad for Discovery/Search ◮ Composable Proof Trees ◮ Example: Forward Chaining Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Example: Incidence Reasoning Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Algebra for Theorem Discovery ◮ Expressing data flow ◮ Merging data ◮ Lifting Inference Rules over Discovery Process ◮ Filtering Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Monad 0 : α m (+) : α m → α m → m ( >> =) : α m → ( α → β m ) → β m filter : ( α → bool ) → α m → α m oflist : α list → α m msum : α list m → α m Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Idiom return : α → α m ap : ( α → β ) m → α m → β m fmap : ( α → β ) → α m → β m fmap2 : ( α → β → γ ) → α m → β m → γ m fmap3 : ( α → β → γ → δ ) → α m → β m → γ m → δ m sequence : α m list → α list m Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Collection difference : α m → α m → α m maxima : ( α → α → bool ) → α m → α m unique : ( α → α → bool ) → α m → α m transpose : α m list → α list m Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Theorem Discovery α m := α Stream ( collection ) . t subst : thm m → thm m → thm m contr : thm m → thm m → thm m mp : thm m → thm m → thm m rule1 : thm → thm m → thm m rule2 : thm → thm m → thm m → thm m rule3 : thm → thm m → thm m → thm m → thm m disjuncts : thm → thm m conjuncts : thm → thm m split : thm m → thm m delay : α m → α m Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Example Search Algebra by incidence thms = let rec collinear = maxima ( filter is collinear thms + fmap3 col union ( delay collinear ) ( delay collinear ) neqs ) and non collinear = maxima ( filter is non collinear thms + fmap3 triangle collinear ( delay non collinear ) neqs ) and eqs = filter is eq thms + maxima ( msum ( fmap3 intersect collinears collinear non collinear )) and neqs = maxima ( filter is neq thms + sum ( fmap2 colncolneq collinear ( delay non collinear )) + sum ( fmap ′ CONJUNCTS ( rule1 ncol neq non collinear ))) and planes = maxima ( filter is plane thms + fmap3 ′ plane union ( delay planes ) ( delay planes ) non collinear + fmap3 ′ colplaneplane collinear ( delay planes ) neqs + fmap2 ′ colcolplane collinear collinear + fmap ′ colplane collinear + fmap ′ ncolplane non collinear ) in collinear + non collinear + eqs + neqs + planes Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Case-splitting Book-keeping Case-analysis φ 1 ∧ φ 2 ∧· · ·∧ φ n ∧ ( P → ψ 1 ∧ ψ 2 ∧ · · · ∧ ψ n ) ∧ ( Q → χ 1 ∧ χ 2 ∧· · ·∧ χ n ∧ ( R → α 1 ∧ α 2 ∧ · · · ∧ α n ) ∧ ( S → β 1 ∧ β 2 ∧ · · · ∧ β n )) [ φ 1 , φ 2 , . . . , φ n ] Q P [ ψ 1 , ψ 2 , . . . , ψ n ][ χ 1 , χ 2 , . . . , χ n ] R S [ α 1 , α 2 , . . . , α n ] [ β 1 , β 2 , . . . , β n ] Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Tree Merging Parallel Merge/Combine xs xs ′ Q P X Y + ys ′ zs ′ ys zs Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Tree Merging Parallel Merge/Combine xs xs ′ Q P X Y + ys ′ zs ′ ys zs xs Q P ys + xs ′ zs + xs ′ = X Y X Y ys ′ zs ′ ys ′ zs ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Tree Merging with Simplification xs ′ xs Q Q P P + ys zs ys ′ zs ′ xs Q P ys + xs ′ zs + xs ′ = Q Q P P ys ′ zs ′ ys ′ zs ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Tree Merging with Simplification xs ′ xs Q Q P P + ys zs ys ′ zs ′ xs Q P ys + xs ′ zs + xs ′ = Q Q P P ys ′ zs ′ ys ′ zs ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Tree Merging with Simplification xs ′ xs Q Q P P + ys zs ys ′ zs ′ xs Q P = ys + xs ′ + ys ′ zs + xs ′ Q P ys ′ zs ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Tree Merging with Simplification xs ′ xs Q Q P P + ys zs ys ′ zs ′ xs Q P = ys + xs ′ + ys ′ zs + xs ′ Q P ys ′ zs ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Tree Merging with Simplification xs xs ′ Q Q P P + ys ′ zs ′ ys zs xs Q P = ys + xs ′ + ys ′ zs + xs ′ + zs ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Further Simplification xs ′ xs Q P X P ys zs + ys ′ zs ′ Q R S T U T R S ts ′ us ′ vs ′ ws ′ ts us vs ws Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (left branch) If we have already assumed a particular case (red), we discard the alternative (blue) and merge into the parent. xs Q P ys R S ts us X P ys ′ zs ′ Q T R S ts ′ us ′ vs ′ ws ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (left branch) If we have already assumed a particular case (red), we discard the alternative (blue) and merge into the parent. xs Q P ys R S ts us X P ys ′ zs ′ Q T R S ts ′ us ′ vs ′ ws ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (left branch) xs ′ xs P P zs ′ ys + R S R S vs ′ ws ′ us ts Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (left branch) xs ′ xs P P zs ′ ys + R S R S vs ′ ws ′ us ts xs + xs ′ P ys + zs ′ = R S us + vs ′ ts + ws ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (right branch) If a case has already been considered in an alternative branch (an uncle branch), we discard the case. xs Q P zs T vs X P ys ′ zs ′ Q T R S ts ′ us ′ vs ′ ws ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (right branch) If a case has already been considered in an alternative branch (an uncle branch), we discard the case. xs Q P zs T vs X P ys ′ zs ′ Q T R S ts ′ us ′ vs ′ ws ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (right branch) If a case has already been considered in an alternative branch (an uncle branch), we discard the case. xs Q P zs T vs X ys ′ Q T ts ′ us ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (right branch) If a case has already been considered in an alternative branch (an uncle branch), we discard the case. xs Q P zs T vs X ys ′ Q T ts ′ us ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
More Tree Filtering (right branch) If a case has already been considered in an alternative branch (an uncle branch), we discard the case. xs Q P zs T vs X ys ′ + ts ′ + us ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
After Full Simplification xs ′ xs Q P X P ys zs + ys ′ zs ′ Q R S T U T R S ts ′ us ′ vs ′ ws ′ ts us vs ws xs + xs ′ Q P = ys + zs ′ zs R S T U ts + vs ′ us + ws ′ vs ws X X ys ′ + ts ′ + us ′ ys ′ + us ′ Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Forward-chaining chain imps thms = imps >> = ( λ imp . if is imp imp then chain ( fmap’ ( MATCH MP imp ) thms ) thms else return imp ) f rules base = chain ( oflist rules ) ( delay f rules thms ) + delay ( f rules base ) Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Integration ◮ Concurrent discovery ◮ Writer transformer to add assumption dependencies obviously : ( thm chain → thm chain ) → assumption list → step clearly : ( thm chain → thm chain ) → assumption list → step Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Contributions ◮ Language for guiding discovery ◮ Integration with proof contexts ◮ ML library for monads, idioms and transformers ◮ Improved library for lazy lists Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Conclusion and Further Work ◮ Search algebras ◮ Monads and idioms ◮ Implementing data-flow for discovery ◮ Integration with interactive theorem proving ◮ Case-splitting via composable proof trees Future work ◮ Higher-order reasoning/existential reasoning ◮ Efficient subsumption Phil Scott and Jacques Fleuriot A Combinator Language for Theorem Discovery
Recommend
More recommend