Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Post production systems - Questions

1 view
Skip to first unread message

Lyle Waldman

unread,
Jul 8, 2009, 5:04:52 PM7/8/09
to
I'm not entirely sure about how Post production systems work, and
according to Google they do not exist as taught in class (or at least
not under that name). I'm not entirely clear on a few things, and so
would like some help:

1) Can you have multiple items on the left or right side of a Post
production? That is to say, can you have an event that is a mouse click
and a question asking where the mouse was clicked and determine your
result based on both items taken together? If so, what is the notation
for this?

2) Similarly for output: Can you have multiple actions performed on
output? How does the notation work?

3) Can you have parameters to side effects? For example, in the
assignment, we are asked to change something as a side effect of a
production. Can we say ChangeX(var)> to change X to var as a side effect?

4) I'm still somewhat confused as to what "Program Inputs" are and how
"The System" is defined.

5) Are there any good examples of Post production systems on the
interblag that anyone has found?

It would be nice to have been given this information in the lecture
slides...the lecture slides on this topic seem to be lacking on this
topic...and given the way the midterms have been, this worries me very
very much looking to the final...

Lyle Waldman

unread,
Jul 8, 2009, 5:40:19 PM7/8/09
to
To clarify, since I have 5 assignments due next week, including this
one, and thus need to get this done ASAP so I can get other stuff done,
are we allowed to have an action like:

x -> !command

which is triggered whenever a state becomes x?

Lyle Waldman wrote:

> 2) Are we allowed productions that do not have an action on the left side?

Lyle Waldman

unread,
Jul 8, 2009, 5:37:04 PM7/8/09
to
More questions:

1) Are we allowed alternation (e.g. a rule that says *action, State,
(State1 | State2 | State3) that triggers on action if State and any of
State1, State2, or State3 are true?

2) Are we allowed productions that do not have an action on the left side?

Byron Weber Becker

unread,
Jul 9, 2009, 8:19:06 PM7/9/09
to Lyle Waldman
Lyle Waldman wrote:
> More questions:
>
> 1) Are we allowed alternation (e.g. a rule that says *action, State,
> (State1 | State2 | State3) that triggers on action if State and any of
> State1, State2, or State3 are true?

No. This would be done as three rules:

*event, state1 ==>
*event, state2 ==>
*event, state3 ==>

> 2) Are we allowed productions that do not have an action on the left side?

Actions and side effects appear only on the right.
Events, queries, and program inputs appear only on the left.
State variables can appear on either side.

Byron


--
---------------------------------------------------------
Byron Weber Becker Voice: 519-888-4567 x34661
School of Computer Science Fax: 519-885-1208
University of Waterloo Office: DC3105
Waterloo, ON N2L 3G1

Byron Weber Becker

unread,
Jul 9, 2009, 8:16:10 PM7/9/09
to Lyle Waldman
Lyle Waldman wrote:
> I'm not entirely sure about how Post production systems work, and
> according to Google they do not exist as taught in class (or at least
> not under that name). I'm not entirely clear on a few things, and so
> would like some help:
>
> 1) Can you have multiple items on the left or right side of a Post
> production?
Yes.

> That is to say, can you have an event that is a mouse click
> and a question asking where the mouse was clicked and determine your
> result based on both items taken together?

Absolutely, provided you have definitions for both. Good definitions of
your terms are critical.

> If so, what is the notation
> for this?

Something like:

Definitions:
Events
Mouse{*mouseDown, *mouseUp} // Mouse button pressed down event
(more detail would probably be good; also need documentation for *mouseUp

Queries:
location{?TopLeft, ?TopRight, ?BottomLeft, ?BottomRight} //
appropriate documentation. Assume each query returns true or false

Productions:

*mouseDown, ?TopLeft ==> (put your actions here)

Please Note: There are many ways to do this. This example builds off
of Lyle's question and is not meant to be taken as THE way to do it

> 2) Similarly for output: Can you have multiple actions performed on
> output? How does the notation work?

Yes. List all the actions you want to have happen if/when the rule fires.

> 3) Can you have parameters to side effects? For example, in the
> assignment, we are asked to change something as a side effect of a
> production. Can we say ChangeX(var)> to change X to var as a side effect?

That would typically be done with a state variable (documented in
definitions section) named X and then simply say

???? ==> X = var

Please be careful with variables. They should behave more like
enumerations - ie: a small set of possible values

> 4) I'm still somewhat confused as to what "Program Inputs" are and how
> "The System" is defined.

Program inputs are not that common for what we're doing. Think of them
as inputs to the program that don't originate with the user. For example,
>NetworkIsNowConnected //used to determine when to enable...

>
> 5) Are there any good examples of Post production systems on the
> interblag that anyone has found?

The textbook has an entire chapter mostly devoted to the topic with more
examples in the following chapter.

> It would be nice to have been given this information in the lecture
> slides...the lecture slides on this topic seem to be lacking on this
> topic...and given the way the midterms have been, this worries me very
> very much looking to the final...

Some things lend themselves to actual demonstrations/interactive
presentation. I thought this was one of them.

Byron Weber Becker

unread,
Jul 9, 2009, 8:22:57 PM7/9/09
to Lyle Waldman
Lyle Waldman wrote:
> To clarify, since I have 5 assignments due next week, including this
> one, and thus need to get this done ASAP so I can get other stuff done,
> are we allowed to have an action like:
I'd substitute "production" where you have "action", assuming you are
referring to all of the following line.

>
> x -> !command
>
> which is triggered whenever a state becomes x?

Assuming x is a state variable, it can have one of a limited set of
values -- like an enumeration in Java. You should specify which of
those it has:

Location == INSIDE --> !command

If the variable is boolean valued, then just stating it, like you did,
is fine.

Lyle Waldman

unread,
Jul 9, 2009, 10:04:42 PM7/9/09
to
I asked this question mostly because of this statement in the spec:

"The component produces a total of 6 messages plus the null message.
These should be viewed as side-effects of the component (internally,
it's updating listeners, one of which is code that displays the text in
a JLabel)."

As such, it seems that changing the string to be printed is a side
effect, meaning I would need to write a side effect to do it. If it's
allowed to be done as a state variable change, I think it would probably
be cleaner. Or perhaps I'm misunderstanding the spec.

Byron Weber Becker

unread,
Jul 10, 2009, 9:31:17 AM7/10/09
to Lyle Waldman
I see. I was assuming X was a variable.

Yes, you may use parameters provided they are appropriately documented.
I didn't show any examples in class that used them, but Olsen allows them.

In class we spoke of informal language vs. formal language. You're
definitely sliding the balance towards the informal language. That's OK
(to a point) but does put an additional burden on your definitions and
the documentation of them.

Byron

0 new messages