Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error checking #10

Open
fingolfin opened this issue Aug 17, 2016 · 0 comments
Open

Better error checking #10

fingolfin opened this issue Aug 17, 2016 · 0 comments

Comments

@fingolfin
Copy link
Member

In a very naive attempt to try to use ferret to compute a normalizer), I entered this command (where G and H are permutation groups, and the goal was to compute N_G(H)).

gap> K:=Solve([ConInGroup(G), ConStabilize(Elements(H), OnSets)]); time;
Invalid attempt to read int
Error, Record Element: <rec> must be a record (not a boolean) in
  if record.generators = [ () ]  then
    retgrp := Group( () );
    StabChainMutable( retgrp );
else
    retgrp := Group( record.generators );
    SetStabChainMutable( retgrp, buildStabChain( record.generators, record.generators_map ) );
fi; at /Users/mhorn/Projekte/GAP/repos/pkg/ferret/lib/yapb.gi:526 called from
<function "Solve">( <arguments> )
 called from read-eval loop at *stdin*:188
you can replace <rec> via 'return <rec>;'

I believe the original source of the error is this line, resp. the lack of error checking before it:

  maxpoint := Maximum(List(constraints, x -> x.max));

The value of maxpoint ends up being a permutation.

So in retrospect, I understood that what I did was dumb. Still, I think ferret should catch this misuse, and report something sensible to the user.

Moreover, it seems that YAPB_SOLVE may return fail -- while ideally, one would catch all invalid input before invoking YAPB_SOLVE, that may not always be possible. In that case, fail could still be returned -- and hence I think it should be detected, and handled, instead of blinding treating its return value as a record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants