[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TYPOL:withsubject & fail





=>> I suspect the 'withsubject' construct of TYPOL to sometimes not correctly handle
=>> the case, if the Goal it should proove fails.
=>> 
=>> I have an example which behaves very strange.
=>> When I click 'Fail' in the debbugger on some rule that is executed within
=>> the 'withsubject', the Debbugger displays 'FAIL' but after one 'Step'
=>> TYPOL execution returns with 'true.'??? Everything after the last 'Step'
=>> is out of my control.

withsubject is only a pragma of compilation, it shouldn't
interfer with the evaluation. Remember that the reason of a fail
is sometimes a type constraint that fails (type constraints are implemented
as lazy predicats in Prolog). So don't blame the poor withsubject :-)

=>> In another example I switch heavily between different trees 
=>> (with differnt roots) using the 'withsubject'.
=>> A minor bug is, that the first subject of the tree I have changed to with
=>> the 'withsubject' is not selected in the ctedit but the message
=>> "Ancestor given is not ancestor of tree given' is put out on the console.
=>> The sons of the first subject are selected correctly in the window.
=>> The real bug is very hard to describe.

Are you sure that the path you give with withsubject is a valid path?
If it's correct the only explanation I can see is that the path
represents a sublist node which has no equivalent in VTP.

=>> I have a rule that is tried a second time after it has failed for no
=>> apparent reason.
=>> Another rule, that just does a 'getannot' on the subject can be prooven
=>> infinitely often???
=>> On the one hand that seems to be logic, because the conditions don't change
=>> so the 'getannot' can be done infinitely often indeed, but this is not the
=>> normal behaviour, is it?
=>> (Normally the rule with the getannot is not used more than once).

Maybe you can get some information from the trace generated by
Prolog. To get this trace, just type the following sequence in the top 
level window:

? (prolog)
?- trace.                        
?- ^D.                           (Control D)
?

To exit from the trace mode just use the predicat notrace.


=>> The real bug is very hard to describe.
=>> I have a rule that is tried a second time after it has failed for no
=>> apparent reason.
=>> Another rule, that just does a 'getannot' on the subject can be prooven
=>> infinitely often???
=>> On the one hand that seems to be logic, because the conditions don't change
=>> so the 'getannot' can be done infinitely often indeed, but this is not the
=>> normal behaviour, is it?
=>> (Normally the rule with the getannot is not used more than once).
=>> 
=>> All these cases I described above are not disturbing the normal run
=>> of my TYPOL program.
=>> 
=>> It is just the case of an error, in which for example the error message
=>> is put out on the console infinitely often, although after 'prmess' I
=>> added the predicate 'fail()'.

From all you've said, I get the impression that your program has somewhere
an infinite backtrack loop. So when the program is ok, you get the result
straight but when the program fails it never ends. One more time have a look
at the Prolog trace, it can give you hints ...


Hope it will help

Regards,

-- 
Laurent Thery                        e-mail thery@capa.inria.fr
Projet Croap INRIA - Sophia Antipolis,
2004, rte des Lucioles, 06565 Valbonne Cedex, FRANCE