I would recommend starting in the wolfram documentation for functions. I'm not completely sure what you are trying to do with your inputs, but I believe you want to make a function that evaluates some other function or functions. You could write this as
func1[expr_, x_, y_, z_] := expr[x, y, z];
then create whatever expressions you need to evaluate
equation1[x_, y_, z_] := x + y + z;
equation2[x_, y_, z_] := x^2 + y^2 + z^2;
then pass them both into func1
func1[#, 1, 2, 3] & /@ {equation1, equation2}
For a logical function it is similar. Lets assume you have defined variables somewhere in your book
x=1;
y=2;
z=3;
then
equation3[a_, b_, c_] := x == a || y == b || z == c;
will check if the inputs a, b, or c are equal to x, y, or z, respectively. So
func1[eq3, 1, 23, 45]
will give you True, since a
(1) is equal to x. Finally, to output some array, just make the equation an array:
equation4[a_, b_, c_] := {TrueQ[x == a], TrueQ[y == b], TrueQ[z == c]}
then
func1[equation4, 1, 2, 3]
returns
{True, False, False}
func1
is justReplaceAll
, maybe withHold
orDefer
. TryReplaceAll[Hold[x||y||z],{x->False, y->False, z->False}]
orReplaceAll[Defer[x||y||z],{x->False, y->False, z->False}]
. If you want it in function form, just setHoldFirst
orHoldAll
to the function. $\endgroup$f[x || y || z, x, y, z]
necessarily returnFalse || False || False
? Ifx
,y
andz
wereFalse
, it would automatically evaluate to justFalse
(hence @b3m2a1's comment). Ifx
,y
andz
did not have truth values it would just return unevaluatedx || y || z
. $\endgroup$