Skip to content

match unequal symbols #635

Open
Open

Description

@veretin

Hi!

Suppose I want to do partial fraction of many denominators (below den(x?) means 1/(k.k - x) for example).

s x,y,z, mm1,mm2;
c den,inv;

g ff1 = den(mm1)*den(mm2);
g ff2 = den(mm1)^2;

repeat id den(x?)*den(y?!{,x}) = inv(x-y)*( den(x) - den(y) );

print+s;
.end

Result:

   ff1 =
       + den(mm1)*inv( - mm2 + mm1)
       - den(mm2)*inv( - mm2 + mm1)
      ;

   ff2 = 0;

ff1 is ok. But I dont want to capture terms with x==y.
Construction

id den(x?)*den(y?!{,x}) = inv(x-y)*( den(x) - den(y) );

does not make the job and ignores my check for the set.

Activity

  1. jodavies commented on Apr 22, 2025

    @jodavies
    Collaborator

    This should work for you, you need the ? in the set:

    id den(x?!{y?})*den(y?!{x?}) = inv(x-y)*( den(x) - den(y) );
    

    The restriction is best put on both patterns because you don't "know" which FORM will match first. For eg, this doesn't work:

    id den(x?!{y?})*den(y?) = inv(x-y)*( den(x) - den(y) );
    

    but this does:

    id den(x?)*den(y?!{x?}) = inv(x-y)*( den(x) - den(y) );
    
  2. veretin commented on Apr 23, 2025

    @veretin
    Author

    Indeed this works.
    Thank you!

  3. jodavies commented on Apr 23, 2025

    @jodavies
    Collaborator

    I thought I remembered this being in the manual, but I can't see it there and neither in the tutorial. Let's class this as a "documentation bug" and add something.

  4. added this to the v4.3.2 milestone on Apr 23, 2025
  5. added
    documentationSomething should be added to the documentation
    and removed
    bugSomething isn't working
    on Apr 23, 2025
  6. tueda commented on Apr 25, 2025

    @tueda
    Collaborator

    I thought I remembered this being in the manual

    Maybe this one? Is the example too complicated?
    https://github.com/vermaseren/form/blob/638f84b37bd15f9f3beac288d8e7ae97ee0db4f6/doc/manual/variable.tex#L542-L566

  7. jodavies commented on Apr 25, 2025

    @jodavies
    Collaborator

    Ah yes, you are right, this covers what is required for this issue. Maybe it could spell out more directly that wildcards may be elements of unnamed sets (with their ?), but the information is indeed there.

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

    documentationSomething should be added to the documentation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions