assume(y,expression); y and true; => y and true

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 603
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

assume(y,expression); y and true; => y and true

Message par compsystems » sam. févr. 10, 2018 6:54 pm

I do not find logic, when an identifier is defined as a symbolic expression, it is evaluated to a numeric or Boolean value

Code : Tout sélectionner

f():={
  local y, expr1;
  assume(y,expression);
  expr1:=(y and true);
  print(y and true);   // y Why?
  print(expr1); // y Why?
  return expr1; // y Why?
}:;
f() returns y, Why?

assume(y,expression); y and true; => y and true

parisse
Messages : 5882
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: assume(y,expression); y and true; => y and true

Message par parisse » sam. févr. 10, 2018 7:26 pm

What's the problem?
Testing something and true or something alone is the same test.

Répondre