Вопрос

I would like to know if there is a way to extract the X Value when I'm doing this :

aggregate_all(min(V), simulate(P, Color, V, X), Value)

The simulate predicate is used with P and Color as inputs and V and X as outputs.

For now, this works well to get the min value of V, but what I actually want is to get the value of X when V is at its minimum.

Is there a way to do that ? Any idea about how should I proceed ?

Это было полезно?

Решение

aggregate library supports a 'Witness' on min/max scalar aggregates: then this should work

aggregate_all(min(V,X), simulate(P, Color, V, X), min(Value,X))
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top