theory presentation combinators
play

Theory Presentation Combinators Jacques Carette, and Russell OConnor - PowerPoint PPT Presentation

Theory Presentation Combinators Jacques Carette, and Russell OConnor McMaster University CICM 2012, Bremen, Germany 12 th July 2012 Motivation As part of MathScheme, we wish to efficiently encode mathematical knowledge. 1. Efficient for the


  1. Theory Presentation Combinators Jacques Carette, and Russell O’Connor McMaster University CICM 2012, Bremen, Germany 12 th July 2012

  2. Motivation As part of MathScheme, we wish to efficiently encode mathematical knowledge. 1. Efficient for the library developper 2. Efficient for the user 3. Efficient for processing Focus first on Theory Presentations ◮ Over a (dependently) typed expression language ◮ Syntax for meaningful content Carette, O’Connor Theory Presentation Combinators 2/18

  3. Theories Monoid := Theory { U : type ; ∗ : (U, U) − > U; e : U; axiom r i g h t I d e n t i t y ∗ e : f o r a l l x :U. x ∗ e = x ; axiom l e f t I d e n t i t y ∗ e : f o r a l l x :U. e ∗ x = x ; axiom a s s o c i a t i v e ∗ : f o r a l l x , y , z :U. ( x ∗ y ) ∗ z=x ∗ ( y ∗ z ) } Carette, O’Connor Theory Presentation Combinators 3/18

  4. Theories Monoid := Theory { U : type ; ∗ : (U, U) − > U; e : U; axiom r i g h t I d e n t i t y ∗ e : f o r a l l x :U. x ∗ e = x ; axiom l e f t I d e n t i t y ∗ e : f o r a l l x :U. e ∗ x = x ; axiom a s s o c i a t i v e ∗ : f o r a l l x , y , z :U. ( x ∗ y ) ∗ z=x ∗ ( y ∗ z ) } CommutativeMonoid := Theory { U : type ; ∗ : (U, U) − > U; e : U; r i g h t I d e n t i t y ∗ e : x :U. x ∗ e = x ; axiom f o r a l l l e f t I d e n t i t y ∗ e : x :U. e ∗ x = x ; axiom f o r a l l axiom a s s o c i a t i v e ∗ : f o r a l l x , y , z :U. ( x ∗ y ) ∗ z=x ∗ ( y ∗ z ) axiom commutative ∗ : f o r a l l x , y , z :U. x ∗ y=y ∗ x } Carette, O’Connor Theory Presentation Combinators 3/18

  5. Theories Monoid := Theory { U : type ; ∗ : (U, U) − > U; e : U; axiom r i g h t I d e n t i t y ∗ e : f o r a l l x :U. x ∗ e = x ; axiom l e f t I d e n t i t y ∗ e : f o r a l l x :U. e ∗ x = x ; axiom a s s o c i a t i v e ∗ : f o r a l l x , y , z :U. ( x ∗ y ) ∗ z=x ∗ ( y ∗ z ) } AdditiveMonoid := Theory { U : type ; + : (U, U) − > U; 0 : U; r i g h t I d e n t i t y + 0 : x :U. x+0 = x ; axiom f o r a l l l e f t I d e n t i t y + 0 : x :U. 0+x = x ; axiom f o r a l l axiom a s s o c i a t i v e + : f o r a l l x , y , z :U. ( x+y)+z=x+(y+z ) } Carette, O’Connor Theory Presentation Combinators 3/18

  6. Theories Monoid := Theory { U : type ; ∗ : (U, U) − > U; e : U; axiom r i g h t I d e n t i t y ∗ e : f o r a l l x :U. x ∗ e = x ; axiom l e f t I d e n t i t y ∗ e : f o r a l l x :U. e ∗ x = x ; axiom a s s o c i a t i v e ∗ : f o r a l l x , y , z :U. ( x ∗ y ) ∗ z=x ∗ ( y ∗ z ) } AdditiveCommutativeMonoid := Theory { U : type ; + : (U, U) − > U; 0 : U; r i g h t I d e n t i t y + 0 : x :U. x+0 = x ; axiom f o r a l l l e f t I d e n t i t y + 0 : x :U. 0+x = x ; axiom f o r a l l axiom a s s o c i a t i v e + : f o r a l l x , y , z :U. ( x+y)+z=x+(y+z ) axiom commutative + : f o r a l l x , y , z :U. x+y=y+x } Carette, O’Connor Theory Presentation Combinators 3/18

  7. Combinators for theories Extension: CommutativeMonoid := Monoid extended by { axiom commutative ∗ : f o r a l l x , y , z :U. x ∗ y=y ∗ x } Carette, O’Connor Theory Presentation Combinators 4/18

  8. Combinators for theories Extension: CommutativeMonoid := Monoid extended by { axiom commutative ∗ : f o r a l l x , y , z :U. x ∗ y=y ∗ x } Renaming: AdditiveMonoid := Monoid [ ∗ |− > +, e |− > 0 ] Carette, O’Connor Theory Presentation Combinators 4/18

  9. Combinators for theories Extension: CommutativeMonoid := Monoid extended by { axiom commutative ∗ : f o r a l l x , y , z :U. x ∗ y=y ∗ x } Renaming: AdditiveMonoid := Monoid [ ∗ |− > +, e |− > 0 ] Combination: AdditiveCommutativeMonoid := combine AdditiveMonoid , CommutativeMonoid over Monoid Carette, O’Connor Theory Presentation Combinators 4/18

  10. A fraction of the Algebraic Zoo ModalAlgebra ModalFixes ModalDistributes KleeneLattice VectorSpace BooleanAlgebra UnaryDistributes DeMorganAlgebra PseudoComplement RModule GoedelAlgebra FixedPoint OckhamAlgebra RightRModule LeftRModule CommutativeRingAction HeytingAlgebra DualdeMorgan RightRingAction LeftRingAction ImplicationUnipotentMagma Field ModularOrthoLattice BoundedDistributiveLattice LeftDistributiveImplication Implicative AnddeMorgan OrdeMorgan PreRightRingAction PreLeftRingAction OrthoLattice IntegralDomain BoundedModularLattice ComplementedLattice BooleanRing LeftImplicative RightImplicative PrimeRingoidSig MultRightMonoidAction PrimeAdditiveGroup MultMonoidAction DivisionRing Domain BoundedLattice CommutativeRing DistributiveLattice MeetImplicativeSig RightMonoid1Action LeftMonoid1Action OrthoModularLattice KleeneAlgebra Ring NonassociativeRing NoZeroDivisors ModularLattice BoundedJoinLattice BoundedMeetLattice OrthoComplement StarSemiring MoufangLoop Dioid Rng NonassociativeNondistributiveRing Modularity BoundedJoinSemilattice Lattice Asteration AbelianGroup Loop Semiring NearRing SemiRng MoufangIdentity AbelianAdditiveGroup Semifield BoundedMeetSemilattice LeftAbsorptionOp DualSemilattices IdempotentAdditiveMagma LeftAsteration RightAsteration RightGroupAction ModalAlgebraSig LeftGroupAction Group1 OrthoLatticeSig RightCommutator LeftCommutator Left0 QuasiGroup AdditiveCommutativeMonoid AdditiveGroup NearSemifield HeytingAlgebraSig CommutativeMonoid1 Ringoid LeftAbsorption JoinSemilattice StarSemiringSig LogicAlgebra RightMonoidAction LeftMonoidAction Group Ringoid01Sig Monoid1 AdditiveMonoid BooleanGroup Sloop LeftLoop RightQuasiGroup CommutativeMonoid NearSemiring CommutativeAdditiveMagma LeftRingoid MeetSemilattice Quandle Inverse ComplementRightZero RightMagmaAction RightUnitalAction Right0 InvolutiveSemigroup Zero LeftUnitalAction LeftSemigroupAction Ringoid1Sig Monoid UnipotentPointedMagma PointedSteinerMagma RightCancellative RightCancellativeOp LeftQuasiGroup AdditiveSemigroup Ringoid0Sig RightRingoid Squag CommutativeBand RectangularBand NormalBand Directoid LeftSpindle RightSpindle Rack Shelf Chain InvolutiveMagma RightInverse LeftInverse RightUnitalActionSig RightZero LeftZero LeftUnitalActionSig LeftMagmaAction Unital RightSemigroupAction LeftMonoid RightMonoid RightBiMagma LeftCancellativeOp LeftCancellative CommutativeSemigroup PointedCommutativeMagma RingoidSig SteinerMagma Band InducedRelation LeftIdempotence RightIdempotence LeftBinaryInverse RightBinaryInverse LeftShelf RightShelf UpDirectedSet TotalOrder DownDirectedSet Involution UnaryAntiDistribution PointComplement LogicAlgebraSig InverseSig RightMagmaActionSig LeftMagmaActionSig RightPointAction LeftPointAction LeftUnital RightUnital LeftBiMagma Semigroup CommutativeMagma MiddleCommute IdempotentMagma RackSig Sink PartialOrder UpperBound TotalPreorder LowerBound SimpleGraph InvolutiveMagmaSig ComplementedSig InvolutivePointedMagmaSig RightOperation LeftOperation Pair PointedMagma LeftDivisionMagma ImplicativeSig AdditiveMagma AntiAbsorbent MiddleAbsorption DirectoidIdentities RightShelfSig LeftShelfSig LeftDistributiveMagma RightDistributiveMagma SinkSig AntisymmetricOrderRelation Preorder EquivalenceRelation Graph Digraph StarSig Necessity ComplementSig PointedUnarySystem DoublyPointed MultiCarrier Pointed1Sig Pointed0Sig Magma TransitiveOrderRelation StrictPartialOrder ReflexiveOrderRelation SymmetricOrderRelation TotalRelation PseudoGraph UnaryOperation CarrierS PointedCarrier TransitiveRelation IrreflexiveRelation OrderRelation Pointed2Carrier UtoS SubType BinaryRelation Carrier Empty Base Carette, O’Connor Theory Presentation Combinators 5/18

  11. Library fragment 1 NearSemiring := combine AdditiveSemigroup , Semigroup , RightRingoid over R N e a r S e m i f i e l d := combine NearSemiring , Group over Semigroup S e m i f i e l d := combine NearSemifield , L e f t R i n g o i d over R in go i dS i g NearRing := combine AdditiveGroup , Semigroup , RightRingoid R in go i dS i over Rng := combine AbelianAdditiveGroup , Semigroup , Ringoid R in g oi dS i g over Semiring := combine AdditiveCommutativeMonoid , Monoid1 , Ringoid , Le ft 0 ov SemiRng := combine AdditiveCommutativeMonoid , Semigroup , Ringoid R in over Dioid := combine Semiring , IdempotentAdditiveMagma AdditiveMagma over Ring := combine Rng , Semiring SemiRng over CommutativeRing := combine Ring , CommutativeMagma over Magma BooleanRing := combine CommutativeRing , IdempotentMagma over Magma NoZeroDivisors := Ringoid0Sig extended by { axiom o n l y Z e r o D i v i s o r ∗ 0 : f o r a l l x :U. ( ( e x i s t s b :U. x ∗ b = 0) and ( e x i s t s b :U. b ∗ x = 0)) i m p l i e s ( x = 0) } Domain := combine Ring , NoZeroDivisors over Ringoid0Sig IntegralDomain := combine CommutativeRing , NoZeroDivisors over Ringoid0Si D i v i s i o n R i n g := Ring extended by { d i v i s i b l e : x :U. ( x=0) axiom f o r a l l not i m p l i e s ( ( e x i s t s ! y :U. y ∗ x = 1) ( e x i s t s ! y :U. x ∗ y = 1)) } and F i e l d := combine D i v i s i o n R i n g , IntegralDomain Ring over Carette, O’Connor Theory Presentation Combinators 6/18

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend