Skip to content

Interface: CounterfactualResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / Causal / CounterfactualResponse

Interface: CounterfactualResponse

Defined in: src/types/causal.ts:253

Response for counterfactual query.

Remarks

Evaluated under the canonical noisy-OR semantics of certainty-annotated causes/2 edges: causes(x, y, c) is read as an independent Bernoulli(c) transmission and effects are ORs of transmitted causes. The answer is exact relative to that declared parameterization — CounterfactualResponse.method names it. Declare a full SCM via CausalClient.scmCounterfactual for richer mechanisms.

Properties

assumedRootPriors

assumedRootPriors: string[]

Defined in: src/types/causal.ts:258

Roots whose uninformative Bernoulli(1/2) prior entered the answer — recorded assumptions, never silent.


counterfactualValue?

optional counterfactualValue: unknown

Defined in: src/types/causal.ts:260

The counterfactual result (predicted value of consequent).


explanation

explanation: string

Defined in: src/types/causal.ts:262

Step-by-step explanation of the three-step algorithm.


method

method: string

Defined in: src/types/causal.ts:267

What actually ran: the declared semantics are named, and the answer is exact relative to them.


probabilityTrue

probabilityTrue: number

Defined in: src/types/causal.ts:272

P(consequent = true) in the counterfactual world, under the canonical noisy-OR semantics.


query

query: string

Defined in: src/types/causal.ts:274

The counterfactual query in natural language.


success

success: boolean

Defined in: src/types/causal.ts:276

Whether the counterfactual evaluation was successful.


trace

trace: CounterfactualTraceDto

Defined in: src/types/causal.ts:278

Detailed trace of abduction, action, and prediction steps.