Skip to main content
added 39 characters in body
Source Link
Taiki
  • 5.3k
  • 26
  • 34

This might be what you want:

f[expr_myfullsimplify[expr_, assum_] := Module[
  {pat, tmp, seq},
  pat = FirstCase[Level[assum, Infinity], p[_]] /. p[x_] -> x;
  tmp = FirstCase[Level[expr, Infinity], pat];
  seq = {expr, assum} /. {pat -> #, p[_] -> #};
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

f[entry[1myfullsimplify[entry[1, 2, 3] < 0, p[entry[_, _, _]] > 0]
f[Sqrt[entry[1myfullsimplify[Sqrt[entry[1, 2, 3]^2], p[entry[_, _, _]] > 0]

You'd have to wrap your pattern with p[...] though.

This might be what you want:

f[expr_, assum_] := Module[
  {pat, tmp, seq},
  pat = FirstCase[Level[assum, Infinity], p[_]] /. p[x_] -> x;
  tmp = FirstCase[Level[expr, Infinity], pat];
  seq = {expr, assum} /. {pat -> #, p[_] -> #};
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

f[entry[1, 2, 3] < 0, p[entry[_, _, _]] > 0]
f[Sqrt[entry[1, 2, 3]^2], p[entry[_, _, _]] > 0]

You'd have to wrap your pattern with p[...] though.

This might be what you want:

myfullsimplify[expr_, assum_] := Module[
  {pat, tmp, seq},
  pat = FirstCase[Level[assum, Infinity], p[_]] /. p[x_] -> x;
  tmp = FirstCase[Level[expr, Infinity], pat];
  seq = {expr, assum} /. {pat -> #, p[_] -> #};
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

myfullsimplify[entry[1, 2, 3] < 0, p[entry[_, _, _]] > 0]
myfullsimplify[Sqrt[entry[1, 2, 3]^2], p[entry[_, _, _]] > 0]

You'd have to wrap your pattern with p[...] though.

added 136 characters in body
Source Link
Taiki
  • 5.3k
  • 26
  • 34

This might be what you want:

f[expr_, a_, assum_] := Module[
  {seqpat, tmp, seq},
  pat = FirstCase[Level[assum, Infinity], p[_]] /. p[x_] -> x;
  tmp = FirstCase[Level[expr, Infinity], a];pat];
  seq = {expr, assum[a]assum} /. a{pat -> #;#, p[_] -> #};
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

f[entry[1, 2, 3] < 0, entry[_p[entry[_, _, _], #_]] > 0 &]0]
f[Sqrt[entry[1, 2, 3]^2], entry[_p[entry[_, _, _], #_]] > 0 &]0]

You'd have to wrap your pattern with p[...] though.

This might be what you want:

f[expr_, a_, assum_] := Module[
  {seq, tmp},
  tmp = FirstCase[Level[expr, Infinity], a];
  seq = {expr, assum[a]} /. a -> #;
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

f[entry[1, 2, 3] < 0, entry[_, _, _], # > 0 &]
f[Sqrt[entry[1, 2, 3]^2], entry[_, _, _], # > 0 &]

This might be what you want:

f[expr_, assum_] := Module[
  {pat, tmp, seq},
  pat = FirstCase[Level[assum, Infinity], p[_]] /. p[x_] -> x;
  tmp = FirstCase[Level[expr, Infinity], pat];
  seq = {expr, assum} /. {pat -> #, p[_] -> #};
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

f[entry[1, 2, 3] < 0, p[entry[_, _, _]] > 0]
f[Sqrt[entry[1, 2, 3]^2], p[entry[_, _, _]] > 0]

You'd have to wrap your pattern with p[...] though.

deleted 6 characters in body
Source Link
Taiki
  • 5.3k
  • 26
  • 34

This might be what you want:

f[expr_, {a_, assum_}]assum_] := Module[
  {seq, tmp},
  tmp = FirstCase[Level[expr, Infinity], a];
  seq = {expr, assum[a]} /. a -> #;
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

f[entry[1, 2, 3] < 0, {entry[_, _, _], # > 0 &}]&]
f[Sqrt[entry[1, 2, 3]^2], {entry[_, _, _], # > 0 &}]&]

This might be what you want:

f[expr_, {a_, assum_}] := Module[
  {seq, tmp},
  tmp = FirstCase[Level[expr, Infinity], a];
  seq = {expr, assum[a]} /. a -> #;
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

f[entry[1, 2, 3] < 0, {entry[_, _, _], # > 0 &}]
f[Sqrt[entry[1, 2, 3]^2], {entry[_, _, _], # > 0 &}]

This might be what you want:

f[expr_, a_, assum_] := Module[
  {seq, tmp},
  tmp = FirstCase[Level[expr, Infinity], a];
  seq = {expr, assum[a]} /. a -> #;
  FullSimplify @@ seq /. # -> tmp
]

It's used as follows:

f[entry[1, 2, 3] < 0, entry[_, _, _], # > 0 &]
f[Sqrt[entry[1, 2, 3]^2], entry[_, _, _], # > 0 &]
added 48 characters in body
Source Link
Taiki
  • 5.3k
  • 26
  • 34
Loading
Post Undeleted by Taiki
added 32 characters in body
Source Link
Taiki
  • 5.3k
  • 26
  • 34
Loading
Post Deleted by Taiki
deleted 11 characters in body
Source Link
Taiki
  • 5.3k
  • 26
  • 34
Loading
Post Undeleted by Taiki
Post Deleted by Taiki
Source Link
Taiki
  • 5.3k
  • 26
  • 34
Loading