-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1508 from zickgraf/master
Introduce DummyRing, DummyCommutativeRing, and DummyField
- Loading branch information
Showing
10 changed files
with
355 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#! @Chapter Examples and Tests | ||
|
||
#! @Section Dummy implementations | ||
|
||
#! @Subsection Dummy rings | ||
|
||
#! @Example | ||
|
||
LoadPackage( "CAP", false ); | ||
#! true | ||
|
||
DummyRing( ); | ||
#! Dummy ring 1 | ||
DummyRing( ); | ||
#! Dummy ring 2 | ||
IsRing( DummyRing( ) ); | ||
#! true | ||
|
||
DummyCommutativeRing( ); | ||
#! Dummy commutative ring 1 | ||
DummyCommutativeRing( ); | ||
#! Dummy commutative ring 2 | ||
IsRing( DummyCommutativeRing( ) ); | ||
#! true | ||
IsCommutative( DummyCommutativeRing( ) ); | ||
#! true | ||
|
||
DummyField( ); | ||
#! Dummy field 1 | ||
DummyField( ); | ||
#! Dummy field 2 | ||
IsRing( DummyField( ) ); | ||
#! true | ||
IsField( DummyField( ) ); | ||
#! true | ||
|
||
#! @EndExample |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# CAP: Categories, Algorithms, Programming | ||
# | ||
# Declarations | ||
# | ||
|
||
#! @Chapter Dummy implementations | ||
#! | ||
#! A dummy implementation of a concept seems to provide an interface for the concept, but calling any operation in this interface will simply signal an error. | ||
#! Hence, when using a dummy implementation, we can be sure that we only rely on the abstract interface but not on any implementation details, | ||
#! for the simple reason that there is no actual implementation. | ||
#! This is useful for testing or compilation against a generic implementation of a concept. | ||
|
||
#################################### | ||
# | ||
#! @Section Dummy rings | ||
# | ||
#################################### | ||
|
||
#################################### | ||
# | ||
# GAP filters | ||
# | ||
#################################### | ||
|
||
#! @Description | ||
#! The ⪆ filter of dummy rings. | ||
DeclareFilter( "IsDummyRing", | ||
IsRingWithOne ); | ||
|
||
#! @Description | ||
#! The ⪆ filter of elements of a dummy ring. | ||
DeclareFilter( "IsDummyRingElement", | ||
IsRingElementWithOne ); | ||
|
||
#! @Description | ||
#! The ⪆ filter of dummy commutative rings. | ||
DeclareFilter( "IsDummyCommutativeRing", | ||
IsDummyRing ); | ||
|
||
#! @Description | ||
#! The ⪆ filter of elements of a dummy commutative ring. | ||
DeclareFilter( "IsDummyCommutativeRingElement", | ||
IsDummyRingElement ); | ||
|
||
#! @Description | ||
#! The ⪆ filter of dummy fields. | ||
DeclareFilter( "IsDummyField", | ||
IsDummyCommutativeRing ); | ||
|
||
#! @Description | ||
#! The ⪆ filter of elements of a dummy commutative ring. | ||
DeclareFilter( "IsDummyFieldElement", | ||
IsDummyCommutativeRingElement ); | ||
|
||
#################################### | ||
# | ||
# Constructors | ||
# | ||
#################################### | ||
|
||
#! @Description | ||
#! @Returns a dummy ring | ||
DeclareGlobalFunction( "DummyRing" ); | ||
|
||
#! @Description | ||
#! @Returns a dummy commutative ring | ||
DeclareGlobalFunction( "DummyCommutativeRing" ); | ||
|
||
#! @Description | ||
#! @Returns a dummy field | ||
DeclareGlobalFunction( "DummyField" ); | ||
|
||
#################################### | ||
# | ||
#! @Section Dummy categories | ||
# | ||
#################################### | ||
|
||
#################################### | ||
# | ||
# GAP categories | ||
# | ||
#################################### | ||
|
||
#! @Description | ||
#! The ⪆ category of a dummy CAP category. | ||
DeclareCategory( "IsDummyCategory", | ||
IsCapCategory ); | ||
|
||
#! @Description | ||
#! The ⪆ category of objects in a dummy CAP category. | ||
DeclareCategory( "IsDummyCategoryObject", | ||
IsCapCategoryObject ); | ||
|
||
#! @Description | ||
#! The ⪆ category of morphisms in a dummy CAP category. | ||
DeclareCategory( "IsDummyCategoryMorphism", | ||
IsCapCategoryMorphism ); | ||
|
||
#################################### | ||
# | ||
# Constructors | ||
# | ||
#################################### | ||
|
||
#! @Description | ||
#! Creates a dummy category subject to the options given via <A>options</A>, which is a record passed on to <Ref Oper="CategoryConstructor" Label="for IsRecord" />. | ||
#! Note that the options `{category,object,morphism}_filter` will be set to `IsDummyCategory{,Object,Morphism}` and the options `{object,morphism}_{constructor,datum}` and | ||
#! `create_func_*` will be set to dummy implementations (throwing errors when actually called). | ||
#! The dummy category will pretend to support empty limits by default. | ||
#! @Arguments options | ||
#! @Returns a category | ||
DeclareOperation( "DummyCategory", | ||
[ IsRecord ] ); |
Oops, something went wrong.