Skip to content

Type Alias: AlcConcept

@kortexya/reasoninglayer


@kortexya/reasoninglayer / DL / AlcConcept

Type Alias: AlcConcept

AlcConcept = { type: "Top"; } | { type: "Bot"; } | { name: string; type: "Atom"; } | { concept: AlcConcept; type: "Not"; } | { left: AlcConcept; right: AlcConcept; type: "And"; } | { left: AlcConcept; right: AlcConcept; type: "Or"; } | { concept: AlcConcept; role: string; type: "Exists"; } | { concept: AlcConcept; role: string; type: "Forall"; }

Defined in: src/types/dl.ts:57

An ALC (Attributive Language with Complement) concept expression.

Remarks

A recursive discriminated union on type, mirroring the backend AlcConcept AST. This is the description-logic counterpart of the sort lattice: Top is the lattice top (⊤, every individual), Bot the lattice bottom (⊥, no individual), And is a meet (⊓, the GLB of two concepts) and Or a join (⊔, the LUB of two concepts). Subsumption (C ⊑ D) is the lattice order.

Unlike Sorts, ALC concepts are not persisted in the tenant’s sort lattice — they are anonymous expressions evaluated by the tableau on the fly, so they may use concept names (Atom) and role names that were never declared.

Serialization is the backend’s externally tagged enum encoding, produced by the dl normalizers:

ConceptShippedWire
{ type: 'Top' }"Top"
{ type: 'Bot' }"Bot"
A{ type: 'Atom', name: 'A' }{"Atom":"A"}
¬C{ type: 'Not', concept: C }{"Not":<c>}
C ⊓ D{ type: 'And', left: C, right: D }{"And":[<c>,<d>]}
C ⊔ D{ type: 'Or', left: C, right: D }{"Or":[<c>,<d>]}
∃R.C{ type: 'Exists', role: 'R', concept: C }{"Exists":["R",<c>]}
∀R.C{ type: 'Forall', role: 'R', concept: C }{"Forall":["R",<c>]}

Example

// Dog ⊓ ∃hasOwner.Person
const concept: AlcConcept = {
type: 'And',
left: { type: 'Atom', name: 'Dog' },
right: {
type: 'Exists',
role: 'hasOwner',
concept: { type: 'Atom', name: 'Person' },
},
};