Some questions

View: New views
2 Messages — Rating Filter:   Alert me  

Some questions

by Goyal, Siddharth(IE10) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi

 

Got some more questions- I will ask them based on the person-age example provided in the demos.

 

  1. I make the following assertions
    1. assert (= (age john) (age fred))
    2. assert (age john 20)
    3. assert (age fred 30)

There are no exceptions raised even though c violates a.

I want to make sure that given (a), I should not be able to assert (c). Is there any way to do that?

 

  1. What is the level of complexity of mathematical relations that can be dealt with in powerloom? Can I use sines, cosines, logs, etc while defining propositions?

 

  1. Please explain this behavior. I defined a proposition by the name fbb (see code below) to which an ask query returns unknown. When I ask the same proposition without naming it, I get a false; which should have been the case anyways.

 

PL-USER |= (retrieve all (age jawa ?a))

 

There is 1 solution:

  #1: ?A=30

 

PL-USER |= (retrieve all (age ruby ?a))

 

There is 1 solution:

  #1: ?A=10

 

PL-USER |= (defproposition fbb (> (- (age jawa) (age ruby) ) 20 ))

 

|P|(> (- (AGE JAWA) (AGE RUBY)) 20)

 

PL-USER |= (ask fbb)

 

UNKNOWN

 

PL-USER |= (ask (> (- (age jawa) (age ruby) ) 20 ))

 

FALSE

 

                                                                  Honeywell

Email           :   rajesh.kishore@...

                         swiftpanther@...

Mobile         :   +91 - 9845844025

 


_______________________________________________
powerloom-forum mailing list
powerloom-forum@...
http://mailman.isi.edu/mailman/listinfo/powerloom-forum

Re: Some questions

by Hans Chalupsky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Siddharth,

answers in-line:

>>>>> Siddharth Goyal <Goyal> writes:

> Hi
> Got some more questions- I will ask them based on the person-age example
> provided in the demos.

> 1. I make the following assertions

> a. assert (= (age john) (age fred))
> b. assert (age john 20)
> c. assert (age fred 30)

> There are no exceptions raised even though c violates a.

> I want to make sure that given (a), I should not be able to assert (c).
> Is there any way to do that?

Yes, PowerLoom does uncover inconsistencies like these, but this is
generally done as part of forward inference and not at assertion time.
Forward inference is either triggered when you ask a query, or by
explicitly calling `run-forward-rules'.  For example, after making the
above assertions and asking a query like the following, a clash is
encountered:

STELLA(24): (retrieve (age fred ?x))
`|L|20' clashes with `|L|30'
There is 1 solution so far:
  #1: ?X=30
STELLA(25):

Similarly, if you make the assertions and then explicitly trigger
forward inference, you also uncover the clash:

STELLA(42): (assert (= (age john) (age fred)))
|P|(= (AGE JOHN) (AGE FRED))
STELLA(43): (assert (age john 20))
|P|(= (AGE JOHN) sk16//20)
STELLA(44): (assert (age fred 30))
|P|(= (AGE FRED) sk17//30)
STELLA(45): (run-forward-rules pl-user)
`|L|20' clashes with `|L|30'   One or more facts need to be retracted to eliminate the inconsistency.
()
STELLA(46):

One issue right now is that PowerLoom can't tell you the culprits of
the clash, since we are not yet recording justifications during forward
inference.  If all goes well this should become remedied fairly soon
given a new small project that funds an assortment of PowerLoom
improvements.

> 2. What is the level of complexity of mathematical relations that
> can be dealt with in powerloom? Can I use sines, cosines, logs, etc
> while defining propositions?

Right now the most complex math function supported is square root.  We
haven't yet added other commonly used math functions, primarily,
because there hasn't been a need.  But that's easy to do and we'd be
happy to add them if you give us a list of what you need.  You could
also add them yourself as computed predicates, even though the
interface there isn't quite as user-friendly as it could be.

> 3. Please explain this behavior. I defined a proposition by the
> name fbb (see code below) to which an ask query returns unknown. When I
> ask the same proposition without naming it, I get a false; which should
> have been the case anyways.

> PL-USER |= (retrieve all (age jawa ?a))

> There is 1 solution:
>   #1: ?A=30

> PL-USER |= (retrieve all (age ruby ?a))

> There is 1 solution:
>   #1: ?A=10

> PL-USER |= (defproposition fbb (> (- (age jawa) (age ruby) ) 20 ))
> |P|(> (- (AGE JAWA) (AGE RUBY)) 20)

> PL-USER |= (ask fbb)

> UNKNOWN

> PL-USER |= (ask (> (- (age jawa) (age ruby) ) 20 ))

> FALSE

The reason is that the proposition structures built in assertions
vs. in queries are actually different, even though they may look the
same.  For example, if you turn the inference trace on, you'll see
that the two queries will execute a different trace.  The first
basically just looks for the truth or falsity of a proposition object,
the second runs a query based on the descriptive version of the
proposition that uses variables to link together the various
subexpressions:

STELLA(35): (set-feature trace-subgoals)
|l|(:TRACE-SUBGOALS :EMIT-THINKING-DOTS :JUST-IN-TIME-INFERENCE)
STELLA(36): (ask fbb)
PATTERN: []
| GOAL: (> (- (AGE JAWA) (AGE RUBY)) 20)
| FAIL
UNKNOWN
STELLA(37): (ask (> (- (AGE JAWA) (AGE RUBY)) 20))
PATTERN: []
| GOAL: (AND (= (AGE JAWA) ?v10) (= (AGE RUBY) ?v11) (= (- ?v10 ?v11) ?v12) (> ?v12 20))
| | GOAL: (= (AGE JAWA) ?v10)
| | SUCC: ?V10=30 truth=T
| | GOAL: (= (AGE RUBY) ?v11)
| | SUCC: ?V11=10 ?V10=30 truth=T
| | GOAL: (= (- ?v10/30 ?v11/10) ?v12)
| | SUCC: ?V12=20 ?V11=10 ?V10=30 truth=T
| | GOAL: (> ?v12/20 20)
| | FAIL: truth=F
| FAIL: truth=F
FALSE

Having said that, you shouldn't have to worry about that.  In fact,
when you run forward inference, the falsity of the proposition will be
derived and can then be found by the query:

STELLA(38): (run-forward-rules pl-user)
|L|TRUE
STELLA(39): (ask fbb)
PATTERN: []
| GOAL: (> (- (AGE JAWA) (AGE RUBY)) 20)
| FAIL: truth=F
FALSE


Queries with proposition constants isn't something we usually do.
I'll see whether we can easily adapt our query machinery to handle
them more transparently when that is necessary.

Hans

--------------------------------------------------------------------------
PowerLoom home page:                 http://www.isi.edu/isd/LOOM/PowerLoom
PowerLoom forum:                                   powerloom-forum@...
PowerLoom request line:                      powerloom-forum-admin@...
KOJAK home page:                         http://www.isi.edu/isd/LOOM/kojak
STELLA home page:                       http://www.isi.edu/isd/LOOM/Stella
--------------------------------------------------------------------------
_______________________________________________
powerloom-forum mailing list
powerloom-forum@...
http://mailman.isi.edu/mailman/listinfo/powerloom-forum
LightInTheBox - Buy quality products at wholesale price