solveTest.frink

Download or view solveTest.frink in plain text format


// This is a test for some nasty cases of pattern-matching that
// require that backtracking goes right.

symbolicMode[true]

// Solve for two terms containing c
solve[_a _c + _b _c === _d, _c] :: freeOf[_d, _c] <->  solve[_c === _d / (_a + _b), _c]

println[join["\n",transformExpressionDebug[noEval[solve[g x + x y z === 10, x]]]]]
println[]

println[join["\n",transformExpressionDebug[noEval[solve[x y + g y === 10, y]]]]]
println[]

println[join["\n",transformExpressionDebug[noEval[solve[g x + x y === 10, x]]]]]
println[]

println[join["\n",transformExpressionDebug[noEval[solve[v x + v y === 10, v]]]]]
println[]

println[join["\n",transformExpressionDebug[noEval[solve[g x + g y z === 10, g]]]]]
println[]

println[join["\n",transformExpressionDebug[noEval[solve[g x y + x y z === 10, x]]]]]
println[]

println[join["\n",transformExpressionDebug[noEval[solve[g x y + x y z === 10, y]]]]]
println[]


Download or view solveTest.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 19346 days, 22 hours, 39 minutes ago.