Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove witness field from properties #495

Closed
schillic opened this issue Feb 24, 2019 · 1 comment
Closed

Remove witness field from properties #495

schillic opened this issue Feb 24, 2019 · 1 comment

Comments

@schillic
Copy link
Member

schillic commented Feb 24, 2019

We always ask for a witness in the properties and store them. However, in general the witness production is more expensive, and we never used the witness so far. Furthermore, the property types are currently mutable for this reason, and witnesses cannot be stored with Conjunction etc. (see #474).

I propose to instead add an optional argument witness::Bool=false to the check function, and then optionally return the witness immediately to the caller.

@schillic
Copy link
Member Author

Comment from here by @mforets:

Tested independently:

julia> using LazySets; R = rand(Hyperrectangle, dim=100); H = rand(HalfSpace, dim=100);

julia> @btime is_intersection_empty($R, $H, false)
  272.878 ns (3 allocations: 1.77 KiB)
false

julia> @btime is_intersection_empty($R, $H, true);
  771.026 ns (5 allocations: 1.81 KiB)
julia> R = rand(Hyperrectangle, dim=2); H = rand(HalfSpace, dim=2);

julia> @btime is_intersection_empty($R, $H, false);
  152.680 ns (3 allocations: 208 bytes)

julia> @btime is_intersection_empty($R, $H, true);
  589.767 ns (6 allocations: 336 bytes)

@schillic schillic self-assigned this Feb 24, 2019
schillic added a commit that referenced this issue Feb 24, 2019
#495 - Remove witness field from properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant