#792 translated and untranslated 'is'

closed
nobody
None
5
2005-12-08
2005-09-30
Barton Willis
No

Consider:
(%i1) f(x) := (prederror : 'false, is(x <= -1))$

It seems that 'f' is OK:

(%i2) f(a);
(%o2) UNKNOWN
(%i3) f(-5);
(%o3) true
(%i4) f(5);
(%o4) false

After translation, f(a) --> error. This is bogus:

(%i5) translate(f)$
(%i6) f(a);
MACSYMA was unable to evaluate the predicate:
a+1>0

I think that the reason for the difference is that
untranslated code evaluates predicates using 'mevalp'
while translated code uses 'is-bool-check.'

(%i7) build_info();
Maxima version: 5.9.1
Maxima build date: 7:34 9/24/2004
host type: i686-pc-mingw32
lisp-implementation-type: Kyoto Common Lisp
lisp-implementation-version: GCL 2.6.5

Barton

Discussion

  • Raymond Toy
    Raymond Toy
    2005-12-05

    Logged In: YES
    user_id=28849

    Actually, I think is-boole-check would be ok, if it called
    mevalp_tr with a second arg of $prederror instead of T.
    Making this change indicates that mevalp_tr would return
    $unknown. But the translations for mleqp uses (not foo),
    which causes it to return false when foo is $unknown.

    Fixing that will cause the translated function to return the
    same as the interpreted version.

     
  • Raymond Toy
    Raymond Toy
    2005-12-08

    • status: open --> closed