Till today I just used "print" to debug the application. Now I'm
starting to use the trace method.
So, I have these rules:
interval_from_type
use interval($type, $name, $degree, $size)
when
$tuple_type = tuple($type)
type($tuple_type, $modifier, $degree)
note_basics.interval_modifier($modifier, $modifier_value)
note_basics.natural_interval($degree, $degree_value)
$size = $degree_value + $modifier_value
$name = print_interval_name($size, $degree)
dominant_7
use type(('7',), '', 7)
maj_7
use type(('m', 'a', 'j', '7'), 'maj', 7)
and in the file note_basics:
#interval_modifier('', 0) <---
interval_modifier('#', 1)
interval_modifier('b', -1)
interval_modifier('maj', 1)
The maj_7 rules works fine. When I try to prove interval with just
'7', so that it should use the dominant_7 rule, this happens:
intervals.interval_from_type('7', '$ans_0', '$ans_1', '$ans_2')
intervals.dominant_7(('7',), '$modifier', '$ans_1')
intervals.dominant_7 succeeded with (('7',), '', 7)
intervals.dominant_7 failed
If I uncomment the interval_modifier fact in note_basics it works fine.
Now, what I don't understand is why is the dominant_7 rule to fail. It
says it succeded, so the problem should just exist with
interval_modifier. I'm sure I'm wrong, but I don't why.
Then, I don't really like having this assertion: interval_modifier('',
0), but I couldn't find a better way. Any suggestion?
Thanks again,
Carlo