Skip to content

Commit 93d16a4

Browse files
committed
fix types in redundancy script + small refactor
1 parent 6cc2c8f commit 93d16a4

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

databases/catdat/scripts/redundancies.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import { get_client } from './utils/helpers'
2-
import { get_categories, type NormalizedCategoryImplication } from './utils/categories'
32
import {
43
get_deduced_satisfied_properties,
54
get_deduced_unsatisfied_properties,
65
} from './deduce-structure-properties'
7-
import { get_property_assignments_by_deduction, StructureMeta } from './utils/deduction'
8-
import { get_functors } from './utils/functors'
9-
import { StructureType } from './config'
10-
import { get_normalized_implications } from './utils/implications'
6+
import {
7+
get_property_assignments_by_deduction,
8+
get_structures,
9+
StructureMeta,
10+
} from './utils/deduction'
11+
import type { StructureType } from './config'
12+
import {
13+
get_normalized_implications,
14+
type NormalizedImplication,
15+
} from './utils/implications'
1116

1217
const db = get_client()
1318

@@ -32,8 +37,7 @@ function check_redundant_property_assignments(type: StructureType) {
3237

3338
const implications = get_normalized_implications(db, type)
3439

35-
const structures: StructureMeta[] =
36-
type === 'category' ? get_categories(db) : get_functors(db)
40+
const structures: StructureMeta[] = get_structures(db, type)
3741

3842
const assignments = get_property_assignments_by_deduction(db, structures, type)
3943
const ignore_dict = get_ignored_redundant_assignments(type)
@@ -102,7 +106,7 @@ function check_redundant_property_assignments(type: StructureType) {
102106
*/
103107
function get_redundant_satisfied_property(
104108
satisfied_properties: Set<string>,
105-
implications: NormalizedCategoryImplication[],
109+
implications: NormalizedImplication[],
106110
ignored: Set<string> = new Set(),
107111
associated_satisfied_properties?: Record<string, Set<string>>,
108112
) {
@@ -131,7 +135,7 @@ function get_redundant_satisfied_property(
131135
function get_redundant_unsatisfied_property(
132136
satisfied_properties: Set<string>,
133137
unsatisfied_properties: Set<string>,
134-
implications: NormalizedCategoryImplication[],
138+
implications: NormalizedImplication[],
135139
ignored: Set<string> = new Set(),
136140
associated_satisfied_properties?: Record<string, Set<string>>,
137141
) {

databases/catdat/scripts/utils/categories.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ type CategoryMeta = {
66
dual: string | null
77
}
88

9-
export type NormalizedCategoryImplication = {
10-
id: string
11-
assumptions: Set<string>
12-
conclusion: string
13-
}
14-
159
/**
1610
* Returns the list of categories saved in the database.
1711
*/

0 commit comments

Comments
 (0)