dimanche 29 mars 2015

Evaluating a String in Prolog

In prolog I have a string that needs to be evaluated, for example:



X = '4+2/5'


Is there a way to convert or parse this string into an expression to be evaluated?


Something like:



?- String_Eval('4+2/5', Result).
Result = 4.4.


Thanks


Aucun commentaire:

Enregistrer un commentaire