Flying Logic Forum
May 21, 2018, 10:09:35 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: • Flying Logic 3.0.9 has been released!
Click here to visit the Flying Logic home page.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Skipping an unnecessary precondition?  (Read 11695 times)
tlmurray
Newbie
*
Posts: 21


View Profile
« on: November 15, 2008, 06:06:40 PM »

Consider this example of what to do with a found cat. If it's dead, do an autopsy. If it's alive, then check if it's hungry. If it's not hungry, take it home immediately. If it's hungry, feed it and then take it home after it eats.

Anyway, I end up with a take-home action of a dead cat because the negative outcome of hungry? is satisfied. The question, then, is if the cat is dead, can I tell FL to not traverse the alive branch at all?

I fear that that I'm trying to drive FL like a flow chart. I used "fear" because I really like this FL hammer, so everything looks like a nail.

* Cat.logic (9.1 KB - downloaded 332 times.)

* Cat.png (17.73 KB, 498x267 - viewed 601 times.)
« Last Edit: December 06, 2008, 10:13:46 AM by tlmurray » Logged
anndelise
Newbie
*
Posts: 14


View Profile
« Reply #1 on: November 16, 2008, 12:15:04 AM »

The mistake I see is that you have the two preconditions connected, one setting the T/F value of the other.  I think that they need to be set separately from each other.

How about something maybe closer to this?


* Cat alt.logic (13.74 KB - downloaded 308 times.)
« Last Edit: November 16, 2008, 07:33:39 AM by anndelise » Logged

the FlyingLogic portion of my blog: http://anndelise.wordpress.com/category/projects-on-off/self-help-psychology/flying-logic/

Take my diagramming efforts w/ a grain of salt. I'm here to learn FL. If you know a better way to do something, then PLEASE show me how (if you have the inclination to).
anndelise
Newbie
*
Posts: 14


View Profile
« Reply #2 on: November 16, 2008, 07:49:03 AM »

another thing to keep in mind,
if you look at the flowchart examples that came with the downloaded program,
you'll see that the truth value thing doesn't work with either of them.
I'm guessing that if you're doing flowcharts, you're not really able to check your work on them by using truth values.
So realistically, what you have already IS a flowchart, you just have to find some other way of checking your work to make sure it all fits.
Perhaps reading the arrows differently than "is sufficient to cause", may help. 
If you read the arrows as "If [A]...then", it'll work for flowcharting, i think.  For example,
* "If not alive, then autopsy"
* "If alive, then hungry?
* "If hungry then feed then take home"
* "If not hungry, then take home"
Logged

the FlyingLogic portion of my blog: http://anndelise.wordpress.com/category/projects-on-off/self-help-psychology/flying-logic/

Take my diagramming efforts w/ a grain of salt. I'm here to learn FL. If you know a better way to do something, then PLEASE show me how (if you have the inclination to).
tlmurray
Newbie
*
Posts: 21


View Profile
« Reply #3 on: November 16, 2008, 08:56:24 AM »

Perhaps reading the arrows differently than "is sufficient to cause", may help. 
Yes, that's going to be a key.
Logged
George Blot
Newbie
*
Posts: 16


View Profile
« Reply #4 on: November 17, 2008, 01:38:59 AM »

anndelise, I agree and disagree. I think your modified chart is not right, because "hungry?" should be dependent on "cat alive?" - you shouldn't even ask the first question unless the second is already asked and is true. On the other hand, you've put your finger on a subtle difference between "is sufficient to cause" (FL) and "if.. then.." (flowcharting). Maybe the expert logicians here could help. My best guess is that it's like in some programming languages where the proposition q isn't evaluated at run-time if p is true in p OR q, or if p is false in P AND Q. That makes sense to save processor time, but can lead to bugs if q is a procedure that happens to evaluate to a Boolean (for example p OR variable++, where variable is increased by one if p is false but not if p is true).

GB
Logged
anndelise
Newbie
*
Posts: 14


View Profile
« Reply #5 on: November 17, 2008, 06:31:53 AM »

i'll admit that i don't understand the last half of your response (though you were probably clear), i've admitted elsewhere that tlmurray should take anything i say with a grain of salt.  Smiley  I'm not a logic thinking person.

However, I did want to add that when I had set up my attempt to try to resolve the issue, I was disappointed that it showed "Hungry?" as being on the same level as "Alive?".  It was one of the many times that I wished we had a nudge feature of some kind so that I could have moved it further to the right and closer to the "and" junctor to show that it only had to be answered IF that particular line was being followed.

As well as also being why I was reminded that the confidence values just don't work with FL's Flowcharting abilities.

Hmmm, I wonder if maybe an arrow that's set up to go through a line but stops the confidence values if something like a Precondition and/or an Action are reached, so that the user has to take the next step and set the confidence value of that entity, and so on.
For example, in this case, we'd answer "Alive?" True...which would automatically block off "Autopsy".  So then following the True line, the next entity would be "Hungry?" (just like in tlmurray's flowchart).  But with the FLowChart Arrow (or whatever to call it), it would maybe highlight the next entity "Hungry?" to let the user know that they now have to set the confidence value of "Hungry?".  It would keep the diagram looking like tlmurray's (short and simple) but maybe the next step or flowchart arrow would be a different color.

Or, lol, just simple changing the phrase we use for arrows when the type of chart changes.  This is the easiest for programming.  But the hardest for someone like me when I'm trying to check to make sure I've got things set up appropriately.

btw, I'm always open to other suggestions for workarounds w/ what's already in FL.
In fact, I don't mind making a fool of myself by showing my attempts, if it might help prompt someone into showing me better methods.  Grin I should probably put that in my sig line.
Logged

the FlyingLogic portion of my blog: http://anndelise.wordpress.com/category/projects-on-off/self-help-psychology/flying-logic/

Take my diagramming efforts w/ a grain of salt. I'm here to learn FL. If you know a better way to do something, then PLEASE show me how (if you have the inclination to).
George Blot
Newbie
*
Posts: 16


View Profile
« Reply #6 on: November 18, 2008, 03:16:19 AM »

Quote
... though you were probably clear...

I certainly hope not; I work for local government, and being clear is grounds for dismissal. Anyway, it was only a theory of the difference between flowcharts and FL. Your approach is better - worry about how to fix it, not how it got broken.

I like your idea - effectively, confidence values can't pass through preconditions. Trouble is, at the moment, we call entities "preconditions", "actions", etc, but these labels don't have any meaning to the program, only to us humans. You're suggesting, I believe, that entities should behave differently, depending on their type. Hmm... I like this idea, but Sciral might have an opinion...

Logged
George Blot
Newbie
*
Posts: 16


View Profile
« Reply #7 on: November 18, 2008, 03:17:40 AM »

... and, shazam, just after posting I noticed Tim's post below mine asking the same question...
Logged
anndelise
Newbie
*
Posts: 14


View Profile
« Reply #8 on: November 18, 2008, 06:26:26 AM »

I certainly hope not; I work for local government, and being clear is grounds for dismissal.
Cheesy

So, yesterday, a couple of hours after my most recent post above, in the car on the way to town, in the middle of a conversation, it came to me out of the blue that if I'd just simply grouped the "Alive: Yes" lines together, then it would have put "Hungry?" closer to where it should be (in the group with the other stuff instead of on same level as "Alive?").

But if I had done that prior, I wouldn't have gotten to smile first this morning when reading the above quote.
Logged

the FlyingLogic portion of my blog: http://anndelise.wordpress.com/category/projects-on-off/self-help-psychology/flying-logic/

Take my diagramming efforts w/ a grain of salt. I'm here to learn FL. If you know a better way to do something, then PLEASE show me how (if you have the inclination to).
Robert McNally
Administrator
Full Member
*****
Posts: 203



View Profile
« Reply #9 on: December 02, 2008, 05:56:47 PM »

OK, here's my take on the "Found a cat" scenario. Note that the two preconditions are "Cat is alive," and "Cat is hungry." The fact that a dead cat  can neither be considered hungry nor fed is accounted for in that the confidence value of the "Cat is hungry" precondition has no effect unless the "Cat is alive" precondition is true. In fact, note that none of the "live" actions have any effect unless the cat is indeed alive.


* Found a Cat.png (30.13 KB, 346x629 - viewed 576 times.)
* Found a Cat.logic (24.66 KB - downloaded 330 times.)
« Last Edit: December 02, 2008, 06:02:17 PM by Robert McNally » Logged
tlmurray
Newbie
*
Posts: 21


View Profile
« Reply #10 on: December 06, 2008, 10:08:42 AM »

OK, here's my take on the "Found a cat" scenario.
Hmm, okay, except the actions of autopsy and feeding are action I wanted to determine from the initial states.

My attachment below is simple and close, except that it's possible to start out with a dead and hungry cat. But all states that are real possibilities work. (Alive +hungry = autopsy, so maybe the graph works if the cat died hungry.)

* Cat2.logic (12.33 KB - downloaded 334 times.)

* Cat2.png (22.69 KB, 450x309 - viewed 560 times.)
« Last Edit: December 06, 2008, 10:11:18 AM by tlmurray » Logged
Robert McNally
Administrator
Full Member
*****
Posts: 203



View Profile
« Reply #11 on: December 08, 2008, 08:44:33 PM »

Your diagram is simpler, except that when doing trees like this I follow the rule that actions never have arrow driving them— because ultimately an action is always a choice, and so it needs to be a driver but not driven. Preconditions are also drivers and never driven. Intermediate effects are always both drivers and driven, and end states are always only driven.

Another advantage of my diagram is that if you simply read it from bottom to top, answering the preconditions in their natural order, you'll see that if you answer that "Cat is alive" is false, you can skip past the entire side of the tree that deals with hunger.

Ultimately, what a "dead hungry cat" means is a matter for interpretation. But the outcome of the diagram itself is unambiguous: it will never lead to an attempt to feed a dead cat.
« Last Edit: December 08, 2008, 08:48:02 PM by Robert McNally » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!