1

Translate this result form:

d == 4 && a1 == -17 && s10 == 10

How to transform the above result form into this form?

{d -> 4, a -> -17, s1 -> 10}
csn899
  • 3,953
  • 6
  • 13
  • Use the Method option with Solve: "With Method -> Reduce, Solve uses Reduce to find the complete solution set" – Bob Hanlon Mar 30 '24 at 00:11
  • (-1) So you never try to understand answers you've obtained, right?: https://mathematica.stackexchange.com/a/288091/1871 – xzczd Mar 30 '24 at 03:09

3 Answers3

3
eq = d == 4 && a1 == -17 && s10 == 10;

ToRules @ eq

{d -> 4, a1 -> -17, s10 -> 10}

Rule @@@ List @@ eq

{d -> 4, a1 -> -17, s10 -> 10}

eq /. {Equal :> Rule, And :> List}

{d -> 4, a1 -> -17, s10 -> 10}

eldo
  • 67,911
  • 5
  • 60
  • 168
3
List @@ (d == 4 && a1 == -17 && s10 == 10 /. Equal -> Rule)

(* {d -> 4, a1 -> -17, s10 -> 10} *)
user1066
  • 17,923
  • 3
  • 31
  • 49
2
eq = d == 4 && a1 == -17 && s10 == 10;

Using Cases:

Cases[eq, a_ == b_ :> a -> b]

{d -> 4, a1 -> -17, s10 -> 10}

E. Chan-López
  • 23,117
  • 3
  • 21
  • 44