Skip to content

Wrong order for matching in Rule #1978

Description

@rocky

Description

We experience this problem in Rubi:

NeQ[u_,v_] := Not[Quiet[PossibleZeroQ[u-v]] || Refine[u==v]===True]
NeQ[args___] := Null /; CheckArguments[NeQ[args], 2]

The second rule is matching before the first rule. I believe the first rule should match first.

How to Reproduce and Output Given

$ mathics3


In[1]:= NeQ[u_,v_] := u != v

In[2]:= NeQ[args___] := Null /; CheckArguments[NeQ[args], 2]

In[3]:= NeQ[1, 2]

(* Is Null; Should be True *)

Workarounds

Recode to avoid such things

Additional context

Seen while checking why Int[x, x] fails in Rubi.

See also Mathics3/Mathics3-Package-Rubi#12

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions