Interface: LtnQueryRequest
@kortexya/reasoninglayer / LTN / LtnQueryRequest
Interface: LtnQueryRequest
Defined in: src/types/ltn.ts:155
A tagged-union query over a grounded LTN theory.
Remarks
kind selects the query; the fields each kind needs are validated server-side:
ground— requirespredicateplus either an explicitfeaturesvector orfeature_text(embedded via the configured embedding backend).truth/value— requirerules.generalisation— requiresinstances;sortandcertaintydescribe the formula.
Example
const request: LtnQueryRequest = { kind: 'truth', rules: [{ individual: 'rex', sort: 'dog', membership: 0.9 }], aggregator: { kind: 'p_mean_error', p: 2 },};Properties
aggregator?
optionalaggregator:LtnAggregator|null
Defined in: src/types/ltn.ts:159
KB-level aggregator (truth, generalisation). Absent ⇒ pMeanError(p = 2).
certainty?
optionalcertainty:number|null
Defined in: src/types/ltn.ts:164
The formula’s certainty (generalisation).
Default Value
1.0features?
optionalfeatures:number[] |null
Defined in: src/types/ltn.ts:171
An explicit input feature vector for the queried individual (ground).
featureText?
optionalfeatureText:LtnFeatureText[] |null
Defined in: src/types/ltn.ts:169
Ψ-term feature text to embed into the input vector when features is absent
and an embedding backend is configured (ground).
instances?
optionalinstances:LtnInstance[] |null
Defined in: src/types/ltn.ts:173
The unseen instances to score (generalisation).
kind
kind:
LtnQueryKind
Defined in: src/types/ltn.ts:157
Which query to answer.
predicate?
optionalpredicate:string|null
Defined in: src/types/ltn.ts:175
The neural predicate name (ground).
rules?
optionalrules:LtnRule[] |null
Defined in: src/types/ltn.ts:177
The formula’s rules (truth, value).
sort?
optionalsort:string|null
Defined in: src/types/ltn.ts:179
The formula’s sort, by name (generalisation). Absent ⇒ the root sort.