close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 21 years ago

Closed 21 years ago

Last modified 18 years ago

#179 closed defect (fixed)

Real out2 =!fun(0)+!fun(1)+!fun(0); Error!!

Reported by: jlaybar Owned by: danirus
Priority: normal Milestone:
Component: Kernel Version: 1.1.1
Severity: normal Keywords:
Cc:

Description

I don´t know where is the problem becouse the function is an Real objetc.
It seems that TOL is unable to evaluate the code.

Real fun(Real x) { And(x) };

Real x1 = !fun(0);
Real x2 = !fun(1);
Real x3 = !fun(0);

Real out = x1+x2+x3;
Real out2 =!fun(0)+!fun(1)+!fun(0); ERROR !!!!!!

cheers!!

James LAybar

Change History (3)

comment:1 Changed 21 years ago by danirus

Resolution: fixed
Status: newclosed

This bug has been just resolved.
The problem was a bad precedence value for Monary Token ! (not).
Before the solution, with a sentence like:
_

Real out2=!fun(0)+!fun(1)


Tol creates a syntactical tree with bad position for token !, as you can see below:

----> [BINARY]=

> [TYPE]Real

|> [ARGUMENT]out2

> [MONARY]!

> [BINARY]+ > [FUNCTION]fun
|> [ARGUMENT](0)

> [MONARY]!

> [FUNCTION]fun > [ARGUMENT](1)


Now, with that sentence, we get this syntactical tree:

----> [BINARY]=

> [TYPE]Real

|> [ARGUMENT]out2

> [BINARY]+

> [MONARY]!
|> [FUNCTION]fun |> [ARGUMENT](0)

> [MONARY]!

> [FUNCTION]fun > [ARGUMENT](1)


Yo can see now, that monary token ! has more precedence.

comment:2 Changed 21 years ago by danirus

* Bug 178 has been marked as a duplicate of this bug. *

comment:3 Changed 18 years ago by Víctor de Buen Remiro

bug_file_loc: http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000179
Note: See TracTickets for help on using tickets.