Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. <mfusco> [18:48:40] @Guard rule r1 when LHS then unitA.run(ds1, ds2); end
  2. <mfusco> [18:48:56] where unitA, ds1 and ds2 come from?
  3. <conan> [18:49:44] mfusco back
  4. <conan> [18:49:46] so I think you and mmatteo went more literal on the declarative aspect that I initial intented.
  5. <conan> [18:49:46] had time to think while in the car
  6. <conan> [18:49:48] but necessarily a bad thing
  7. <conan> [18:49:50] but need to think about some aspects
  8. <conan> [18:50:28] how is unit actually instantiated and with what arguemtns?
  9. <conan> [18:50:30] if you are going to have guards like this
  10. <conan> [18:50:30] then the LHS must be existential
  11. <conan> [18:50:32] it feels clean not to
  12. <conan> [18:51:16] and we could probably introduce @Guard and @Blocked - maybe...
  13. <conan> [18:51:34] the later means a unit can be evaluate while it's true
  14. <conan> [18:51:45] I'd also be interested to see if we caould get some defeasible aspects in here
  15. <conan> [18:52:28] @GuardAllowed @GuardBlocked or something
  16. <conan> [18:52:30] combined with @Superiorirty from defeasible
  17. <conan> [18:52:32] so one can rebut the other
  18. <conan> [18:52:45] now you have something that is interesting :)
  19. <mfusco> [18:54:07] conan: the LHS is existential for what regards the guards
  20. <conan> [18:54:38] the user soudl be explicit
  21. <mfusco> [18:54:41] conan: we count the number of activations and if it is >0 then the guard is active and the guarded unit will be evaluated
  22. <conan> [18:54:44] we don't want mutiple RHT firings
  23. <conan> [18:54:47] it won't make sense
  24. <mfusco> [18:55:21] conan: in our example the consequences of that rules are always empty
  25. <mfusco> [18:55:43] conan: we just use the LHS as guarding condition, there's no consequence
  26. <mfusco> [18:56:11] conan: to reply to your first question, the units are created by the RuleUnitFactory
  27. <mfusco> [18:56:24] conan: that populates the ds and other vars
  28. <mfusco> [18:56:42] conan: but still this means that the unit is a singleton
  29. <mfusco> [18:57:06] conan: at the moment it's impossible to have more than a unit instance of a give class
  30. <mfusco> [18:57:29] conan: not sure if this limitations makes sense or not
  31. <mfusco> [18:57:46] conan: but at the moment you write @Guard(UnitA) I believe this is implicit
  32. <mfusco> [18:58:07] conan: when you write
  33. <mfusco> [18:58:07] @Guard rule r1 when LHS then unitA.run(ds1, ds2); end
  34. <mfusco> [18:58:31] conan: this doesn't make much sense to me if you don't clarify where unitA, ds1 and ds2 come from
  35. <mfusco> [18:58:55] conan: and still in that case I don't understand what @Guard means
  36. <mfusco> [18:59:11] conan: and even more important what is the identity of the unit
  37. <mfusco> [18:59:25] conan: for me the identity of the unit is just its class
  38. <mfusco> [19:00:18] conan: but of course this imply you cannot have more than an instance alive at a given time and I'm not sure if this is a relevant limitation or not
  39. <mfusco> [19:05:01] conan: to recap my doubts are
  40. <mfusco> [19:05:05] 1. what's the identity of a unit? (for me it is its class)
  41. <mfusco> [19:05:05] 2. how do you create it? (at the moment through the RuleUnitFactory)
  42. <mfusco> [19:05:22] conan: and for me both 1. and 2. imply that each unit is a singleton
  43. <conan> [19:08:31] mfusco sorry bck and forth, as looking after son.
  44. <conan> [19:08:48] I don't think we should have empty RHS rules
  45. <conan> [19:08:57] if that's the case
  46. <conan> [19:09:05] we have a new keword that no longer requires it
  47. <conan> [19:09:15] like query
  48. <mfusco> [19:09:24] conan: you're not obliged, you can put something on the RHS
  49. <mfusco> [19:09:37] conan: however that RHS will just have the usual semantic
  50. <mfusco> [19:09:45] conan: while only the guard is existential
  51. <conan> [19:10:28] if you can put something in the RHS
  52. <conan> [19:10:30] then it can cross product on it
  53. <conan> [19:10:30] LHS shodlu be existential then
  54. <mfusco> [19:11:35] conan: ok we can say that if a rule is annotated with @Guard it is always existential
  55. <mfusco> [19:11:52] conan: but this is not my main concern at the moment
  56. <mfusco> [19:12:04] conan: I believe that the 1st thing to clarify is the unit identity
  57. <mfusco> [19:16:50] conan: sorry but I really have to go now, please ping me asap tomorrow, we need to further discuss this and sort it out
  58. <mfusco> [19:16:51] cya
  59. <conan> [19:18:28] ok
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement