diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0736398..1c7df353 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,7 +112,7 @@ When contributing new data (categories, functors, properties, implications), ple - **Counterexamples**: Ensure that at least one category does not satisfy any new property of categories that is added. If no existing category fits, add a new category that does not have the new property. The same remarks apply to properties of functors. -- **Positive Properties**: Do not add negated properties to the database. For example, do not add "large" as the negation of "small". Instead, add "small" to the list of unsatisfied properties for a category. As a rule of thumb, every registered property of categories should be satisfied at least by the trivial category. Similarly, every property of functors should be satisfied at least by the identity functor. +- **Positive Properties**: Do not add negated properties to the database. For example, do not add "large" as the negation of "small". Instead, add "small" to the list of unsatisfied properties for a category. Every registered property of categories should be satisfied at least by the trivial category. Similarly, every property of functors should be satisfied at least by the identity functor. - **Proofs for Claims**: Provide proofs for all new claims (satisfied properties, unsatisfied properties, implications, special morphisms). (We are currently working on filling in the existing ones.) diff --git a/scripts/test.ts b/scripts/test.ts index 1ca438f9..5a03d99e 100644 --- a/scripts/test.ts +++ b/scripts/test.ts @@ -21,6 +21,7 @@ async function execute_tests() { await test_mutual_category_duals() await test_mutual_property_duals() await test_decided_categories() + await test_properties_of_trivial_category() await test_properties_of_core_categories() } @@ -114,6 +115,24 @@ async function test_decided_category(category_id: string) { console.info(`✅ All properties have been decided for ${category_id}`) } +/** + * Tests that the trivial category has no unsatisfied property. + * This enforces that all properties in the database are "positive". + */ +async function test_properties_of_trivial_category() { + const res = await db.execute(` + SELECT property_id FROM category_property_assignments + WHERE category_id = '1' AND is_satisfied = FALSE + `) + if (res.rows.length > 0) { + throw new Error( + `❌ The trivial category has ${res.rows.length} unsatisfied properties, but it should have 0.`, + ) + } + + console.info(`✅ The trivial category has no unsatisfied properties`) +} + /** * Tests if the "core categories" (currently: Set, Ab, Top) behave as expected: * All of their properties in the database have to match those in the