
On 2006-05-22, Akim Demaille <akim@lrde.epita.fr> wrote:
"SIGOURE" == SIGOURE Benoit <sigoure.benoit@lrde.epita.fr> writes:
AddZero: - Plus(e, Int("0")) -> e + |[ e + 0 ]| -> |[ e ]|
Cool !
EvalPlus: - Plus(Int(i), Int(j)) -> Int(<addS>(i, j)) - EvalPlus: - Plus(Double(i), Int(j)) -> Double(<addR>(i, j)) - EvalPlus: - Plus(Int(i), Double(j)) -> Double(<addR>(i, j)) - EvalPlus: - Plus(Double(i), Double(j)) -> Double(<addR>(i, j)) + |[ d1 + d2 ]| -> |[ r ]| where <addR>(d1, d2) => r
Très cool.
Index: src/str/reals.str --- src/str/reals.str (revision 0) +++ src/str/reals.str (revision 0) @@ -0,0 +1,27 @@ +module reals + +strategies + + // for some reason the following rules are only defined for integers + // in the stratego-lib. Here is their equivalant for reals.
equivalent. Emacs dispose de correction orthographique des chaînes et des commentaires, je suppose de vim aussi.
Pas a ma connaissance. Mais j'ai jamais vraiment cherche du cote des possibilites de correction orthographique dans ViM.
+ addR = (string-to-real, string-to-real); addr; real-to-string + subtR = (string-to-real, string-to-real); subtr; real-to-string + mulR = (string-to-real, string-to-real); mulr; real-to-string + divR = (string-to-real, string-to-real); divr; real-to-string + gtR = where((string-to-real, string-to-real); gtr) + geqR = where((string-to-real, string-to-real); ?(x,x) <+ gtr) + ltR = where((string-to-real, string-to-real); not(?(x,x) <+ gtr)) + leqR = where((string-to-real, string-to-real); not(gtr))
Pourquoi des where dans la seconde partie ?
Je ne suis pas sur, c'etait code comme ca pour les integers dans stratego-lib. Je presume que ces strategies doivent juste reeussir ou failer, sans modifier le term courrant. Ca n'aurait pas vraiment de sens, elles sont juste la pour tester quelque chose, pas pour calculer quelque chose. Enfin je pense.
+ /** + ** tests whether two reals are equal + ** => tests if there difference is less than 10^-7 + ** operates on the input term (a, b) + ** eg: <real-eq> ("0.42", "0.43") -> fail + */
Ce sont des commentaires xDoc ça ?
Oui et non. Etant donne que ca commence par /** ca serait surement interprete comme des commentaires xDoc. Je pense que la final release sera entierement commente avec des des commentaires a la xDoc. Histoire de. -- SIGOURE Benoit aka Tsuna _____ /EPITA\ Promo 2008.CSI Rock & tRoll