Questions tagged [expression-evaluation]

Anything related to expression evaluation, i.e. the process of determining the value of an expression in running code.

Anything related to expression evaluation, i.e. the process of determining the value of an expression in running code.

189 questions
0
votes
1 answer

What does "top-level evaluation" mean?

What does "top-level evaluation" mean? This term was not defined in the text it was mentioned in. I do not want to tell the specific context, because I am interested only in generic explanations.
user1358
  • 623
  • 2
  • 8
  • 13
0
votes
3 answers

Is a C++11 assignment expression evaluated right to left?

The order of evaluation of an expression has always been a source of unspecified behaviors in C++. Has the C++11 standard finally stated what the order of evaluation should be? Do we now know the values of var1 and var2 of the following…
Dariusz
  • 21,561
  • 9
  • 74
  • 114
0
votes
4 answers

Evaluation functions and expressions in Boolean expressions

I am aware how we can evaluate an expression after converting into Polish Notations. However I would like to know how I can evaluate something like this: If a < b Then a + b Else a - b a + b happens in case condition a < b is True, otherwise, if…
Expert Novice
  • 1,943
  • 4
  • 22
  • 47
0
votes
1 answer

R - extract variable names from unevaluated expression

Assume following model is written in a text file by someone not familiar with R as follows: goal1 = dec1_g1 + dec2_g1 + dec3_g1 goal2 = min(dec1_g2, dec2_g2, dec3_g2) goal3 = dec1_g3 - dec2_g3 - dec3_g3 ... I need to be able to parse the text…
David
  • 3,075
  • 3
  • 26
  • 36
0
votes
2 answers

Is it possible to resolve mathematical function dynamically

Is it possible, to resolve mathematical functions dynamically, e.g by the use of a given API? Given there is a function a = b + c is there a way to write something comparable to: Function func = new Function("a=b+c"); Result result =…
aboger
  • 2,214
  • 6
  • 33
  • 47
0
votes
0 answers

Computing a large mixed equation in java

Say I'm given an expression like (1/2) + (3/4) + (5/8) + (2/10) + (3/2) + (10/1) How might I go about computing this expression as a float value in such a way that if the expression where to change I could still compute it? I initially thought I…
0
votes
1 answer

How to get the evaluation result from the parser expression when using antlr 3?

I'm using ANTLR 3.5. I would like to build a grammar that evaluates boolean expressions like x=true; b=false; c=true; a=x&&b||c; and get back the evaluation result via a Java call (like ExprParser.eval() of the above entry will return true.) I'll…
florins
  • 1,605
  • 1
  • 17
  • 33
0
votes
1 answer

Expression Trees: Alternatives or Alternate Evaluation Methods

I'm not even sure if this is the right place to ask a question like this. As a part of my MSc thesis, I am doing some parallel algorithm stuff. To put it simply part of the thing that I am doing is evaluating thousands of expression trees in…
0
votes
1 answer

Building and evaluating expressions using Delphi RTTI

I am faced with a task of allowing the user to define the expressions using the compiled classes with RTTI enabled. Let me put it in a simple way. TAnimal = class(TPersistent) private fWeight : Double; fHeight : Double; fName :…
Rahul W
  • 833
  • 11
  • 26
0
votes
1 answer

How to parse mathematical expressions

I'd like to understand how a Java program like GeoGebra can read a mathematical expression like exp(z^2) from a textbox and then evaluate it. For those familiar with MatLab: How do you implement function handles in Java?
arney
  • 795
  • 7
  • 20
0
votes
1 answer

Solve equation which is in string format

I have a equation in string format like "45+5*4-6" which I have to solve in Java. Is there any way to solve equation which is in string format?
johntom
  • 25
  • 6
0
votes
1 answer

Global vs local variable valuation issue in Maple

For some reason, the Maple code testproc := proc() LOCAL abc; abc[1] := 123; print(eval(parse(cat("abc[", 1, "]")))) end proc testproc(); produces abc_1 whereas (same, but with abc now a GLOBAL variable) testproc := proc() GLOBAL abc; …
0
votes
1 answer

Boolean expression parse and evaluation in C++

I need to evaluate simple Boolean functions at run time in C++. The functions are read from a file as strings. Is there any library available that I could use for this? I looked into BuDDy but sounds like it doesn't parse strings.
Ari
  • 7,251
  • 11
  • 40
  • 70
-1
votes
1 answer

Expression evaluation in interpolated strings in PHP

In JavaScript, you can do this: console.log(`Hello ${3 + 4} World.`) The out put will be Hello 7 World. I can do the same in C# with Console.WriteLine($"Hello {3 + 4} World"). In PHP I tried: echo "Hello {3 + 4} World." However the output of this…
-1
votes
1 answer

Haskell: Non-exhaustive patterns error arises on pattern that I have accounted for already

I am trying to write an evaluator which executes a simple if-block of code. The only two conditions that I'm interested in at the moment is when the condition to enter the block is true or false or if the condition is a relational expression. The…
Mr.Bloom
  • 343
  • 1
  • 11
1 2 3
12
13