This repository has been archived by the owner on Jun 4, 2019. It is now read-only.
Resolute collection semantics #91
Labels
Comments
" Conversely, there are models that depend on the semantics being those of
sets. The Flight
<https://github.com/smaccm/smaccm/tree/master/models/Flight> model is one
such model. In this model a recursive function is used to walk over the
connections in the model and collect the reachable set of destinations.
This allows an argument as to whether there is separation between model
elements and and answer can certain elements in the model reach (influence)
other elements without traversing an intermediate such as a firewall or
decryptor. In this model immediate problem encountered is that with
duplicates allowed in the collections, the exit criterion for the recursive
walk is never met, resulting in an infinite loop in the Resolute evaluator."
I haven't seen any of this code. But reachability type algorithms, via
various kinds of search (DFS, BFS, etc) usually mark already seen nodes,
which dynamically renders the fringe of the search (a list) into a set.
Termination is not based on the size of the fringe but rather on the size
of the set of "reachable-but-not-yet-encountered" nodes.
I am not sure this comment helps at all.
Konrad.
…On Thu, Mar 8, 2018 at 10:53 AM, kfhoech ***@***.***> wrote:
Presently the collection semantics in Resolute is that of lists.
There are models where this semantics is appropriate. @reteprelief
<https://github.com/reteprelief> provides the following where proper
summation over the collection depends on allowing duplicate elements:
-- recursively total of weight budgets of all components
AddAllBudgets(self : component) : real =
let subs :{component} = subcomponents(self);
let totals: real = sum({AddAllBudgets(t) for (t: subs)}) + NetWeight(self);
if (length(subs) = 0 or totals = 0.0) then
WeightBudget(self)
else
totals
-- c omputational function to calculate total of weight budget from subcomponents
AddSubcomponentWeightBudgets(self: component) : real =
sum({WeightBudget(t) for (t: subcomponents(self))})
WeightBudget(self:component): real =
if (has_property(self,SEI::GrossWeight)) then property(self,SEI::GrossWeight,0.0 kg)
else property(self,SEI::NetWeight,0.0 kg)
Conversely, there are models that depend on the semantics being those of
sets. The Flight
<https://github.com/smaccm/smaccm/tree/master/models/Flight> model is one
such model. In this model a recursive function is used to walk over the
connections in the model and collect the reachable set of destinations.
This allows an argument as to whether there is separation between model
elements and and answer can certain elements in the model reach (influence)
other elements without traversing an intermediate such as a firewall or
decryptor. In this model immediate problem encountered is that with
duplicates allowed in the collections, the exit criterion for the recursive
walk is never met, resulting in an infinite loop in the Resolute evaluator.
Accordingly, both set semantics and list semantics are wanted. For making
this improvement in Resolute I propose:
1. Changing the behavior back to sets.
2. Adding grammar elements and evaluators for lists based on the
existing code, but adding the missing list accessors (e.g. head, tail) so
that it's possible to write recursive functions that operate on lists.
3. adding fold (a.k.a accumulate) operator.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#91>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABDgD_EUtMLIxfRFY7-0j4OLGixi8IiUks5tcWIlgaJpZM4Si_7i>
.
|
kfhoech
added a commit
that referenced
this issue
Mar 19, 2018
Resolve Resolute collection semantics (Issue #91)
Resolved by Pull Request 95. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Presently the collection semantics in Resolute is that of lists.
There are models where this semantics is appropriate. @reteprelief provides the following where proper summation over the collection depends on allowing duplicate elements:
Conversely, there are models that depend on the semantics being those of sets. The Flight model is one such model. In this model a recursive function is used to walk over the connections in the model and collect the reachable set of destinations. This allows an argument as to whether there is separation between model elements and and answer can certain elements in the model reach (influence) other elements without traversing an intermediate such as a firewall or decryptor. In this model immediate problem encountered is that with duplicates allowed in the collections, the exit criterion for the recursive walk is never met, resulting in an infinite loop in the Resolute evaluator.
Accordingly, both set semantics and list semantics are wanted. For making this improvement in Resolute I propose:
The text was updated successfully, but these errors were encountered: