Skip to content

black boxes that return containers need to take care of sizes #202

@ooovi

Description

@ooovi

the size of the output container is relevant for sensitivity analysis. there is two aspects of this:

  • the size of a container is zero-sensitive in the container, but other sensitive variables may be encoded in it like in this example, which we currently infer ti be 0-sensitive in x:
f(x) :: BlackBox() = zeros(x,x)
function broken(x::Int)
 m = f(x)
 (xx,_)=size(m)
 return xx
end
  • a black box could return a container whose size depends on runtime values (like with filter). this kind of function does not have a type in our type system.

in the duet code, matrices with unknown dimensions are introduced to alleviate this. however, these are not suitable for use with most rules, especially gauss which is what we want this for.

a possible relief: calls to black boxes that return matrices have to annotate the return matrix's dimension. kind of like this:

unbox_container(f(x), (x, x))

where unbox_container returns it's first argument after runtime-checking the dimensions match, and is typechecked to be infinitely sensitive in the second parameter...

Metadata

Metadata

Assignees

No one assigned

    Labels

    black boxeschecking uncheckable functions :D

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions