Skip to content

Instantly share code, notes, and snippets.

@zenna
Last active March 25, 2019 22:07
Show Gist options
  • Save zenna/81f8dfaebb55b3c04bde027c77f272c8 to your computer and use it in GitHub Desktop.
Save zenna/81f8dfaebb55b3c04bde027c77f272c8 to your computer and use it in GitHub Desktop.
using Omega
using Debugger
using Omega: mem
"Return sequence bounded between lb ad ub"
function f_(ω)
lb = -1.0
ub = 1.0
xs = Float64[]
x = rand(ω)
for i = 1:10
x += rand(ω)
cond(ω, x <ₛ ub)
cond(ω, lb <ₛ x)
push!(xs, x)
end
xs
end
f = ciid(f_)
g = ciid(ω -> (f(ω); f(ω)))
ω = defΩ()()
@show indomainₛ(f, ω)
# returns: Omega.Soft.DualSoftBool{SoftBool{Float64}}(ϵ:-0.0, ϵ:-30830.490459499295)
@show indomainₛ(g, ω)
# returns: Omega.Soft.DualSoftBool{SoftBool{Float64}}(ϵ:-0.0, ϵ:-61660.980918998575)
@show indomainₛ(mem(g), ω)
# returns Omega.Soft.DualSoftBool{SoftBool{Float64}}(ϵ:-0.0, ϵ:-30830.490459499295)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment