Closed matteolimberto-da closed 2 years ago
On a second thought, I think that in order to figure out the correct approach, we shall decide how 'effectful' we want exercise
to be, either
acquire'
on the elected nodeacquire'
(consuming Cond
nodes, fixing acquisition date for stochastic When
nodes)Let's have a chat next week on what more sensible
- at the moment, the elected sub-tree is automatically flagged as Acquired (by the
Right <$> ...
) without checking whether any predicate of that node is met or not
I don't quite get this. If I have
a `or` (When p b)
And I elect When p b
, then the tree is transformed to When p b
, right?
How does this affect acquisition? I thought that is an altogether separate function.
You still need to run an acquire'
on this in order to 'enter' that subtree, right?
- at the moment, the elected sub-tree is automatically flagged as Acquired (by the
Right <$> ...
) without checking whether any predicate of that node is met or notI don't quite get this. If I have
a `or` (When p b)
And I elect
When p b
, then the tree is transformed toWhen p b
, right?How does this affect acquisition? I thought that is an altogether separate function.
You still need to run an
acquire'
on this in order to 'enter' that subtree, right?
The tree is transformed to Right (When p b)
, so p
is automatically flagged as acquired (which is incorrect).
The two approaches are to either use Left (When p b)
to stop the recursion or acquire' (When p b)
to continue the recursion only if b
is acquired.
This PR has been made redundant after merging https://github.com/digital-asset/contingent-claims/pull/75. Let me open an issue to discuss what the desired behaviour for exercise
is once an election is made (whether to stop or continue with the recursion).
Thanks. To give some more context, following our conversation yesterday, my
confusion arose from the fact that your comment is in the context of a
user-facing exercise
, which calls both acquire'
and exercise'
, and
hence we're here kind of 'skipping over' the call to acquire
. But this is
an issue of composition, as discussed elsewhere, rather than a problem with
this function on its own.
On Thu, May 19, 2022 at 2:17 PM Matteo Limberto @.***> wrote:
- at the moment, the elected sub-tree is automatically flagged as Acquired (by the Right <$> ... ) without checking whether any predicate of that node is met or not
I don't quite get this. If I have
a
or
(When p b)And I elect When p b, then the tree is transformed to When p b, right?
How does this affect acquisition? I thought that is an altogether separate function.
You still need to run an acquire' on this in order to 'enter' that subtree, right?
The tree is transformed to Right (When p b), so p is automatically flagged as acquired (which is incorrect).
The two approaches are to either use Left (When p b) to stop the recursion or acquire' (When p b) to continue the recursion only if b is acquired.
This PR has been made redundant after merging #75 https://github.com/digital-asset/contingent-claims/pull/75. Let me open an issue to discuss what the desired behaviour for exercise is once an election is made (whether to stop or continue with the recursion).
— Reply to this email directly, view it on GitHub https://github.com/digital-asset/contingent-claims/pull/74#issuecomment-1131613995, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMYA3GRLUVGCKW3RZKUOCJTVKYWNDANCNFSM5TNZNFRQ . You are receiving this because your review was requested.Message ID: @.***>
-- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.digitalasset.com/emaildisclaimer.html http://www.digitalasset.com/emaildisclaimer.html. If you are not the intended recipient, please delete this message.
This change fixes a sneaky bug when an
Or
election is made:Right <$> ...
) without checking whether any predicate of that node is met or notPros: no bug Drawback: the claim might need to be life-cycled immediately after the call to
exercise
An alternative fix is to run the
acquire'
function on the elected node.The reason why I did not go for this approach is because I think that the
exercise
function should have as little effect as possible other than just applying an election. Happy to hear your thoughts