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

Pab/devel - conditional exports #90

Merged
merged 35 commits into from
Nov 7, 2013
Merged

Pab/devel - conditional exports #90

merged 35 commits into from
Nov 7, 2013

Conversation

pbroadbery
Copy link
Member

Lots of stuff here, largely fallout from noticing that A(T: with): with { x: % } == add { if A has B then x: % == ... }
was accepted when it shouldn't be.

Along the way also fixed:

  • algebra/aldor/foamlib conditional mixups
    • normalize$FractionBy X, where X isn't a GCD domain now throws an error; not sure what the correct implementation is
  • prime?(z)$F matches prime?(z) for the purposes of conditional expressions
  • the form 'with { x: % }' now works properly across file boundaries.
  • "and" in conditional exports was very broken

This does not yet completely fix #87, but gets close.

This was for older versions of axiom; I don't think it makes a massive amount
of sense to retain support for these, especially as the hashcode calculation
has changed.   Simplifies the code slightly too.
negations.  Add test case
Plus a formatter for DNFs for easier debugging.
…est.

Use in ablogic.. This way, conditions like prime?(p) will be matched with
prime?(p)$F

Add confirming assertion in sefo.c, and some tests.
This way, a change in Makefile.am (usually a new test) will filter into
Tests.am.  And so the test will run next build.
…rrect.

Basically, it is looking for S has with { coerce: I -> S }.  This should
be I -> %, as it is the form actually exported.
…into

tiGetTopLevelTForm.  tiSefo is less heavyweight when determining the type
of an expression.
When we compile an expression like 'A has with f: %', a reference to % on
the 'with' expression wasn't being copied over across files.  So, now we
save it off in the semantics part of the abstract syntax, and ensure it
reappears when the tform for the expression is being computed.
Things like 'foo has with { f: A -> B }' should work just fine.

Turns out we were getting this really wrong.  So, test it, and we'll know
if it's all good.
When matching 'add' bodies against context, look at implicit symes before
conditions.  Otherwise implicit symes that have conditions will not be properly
matched.
Code that flattens AB_And in a condition (eg. A has B and A as X) was flat
out wrong, discarding most if not all of the actual condition.  Fix it.
To be used when gathering conditions from syntax
non-GcdDomain arguments.  Not entirely sure what the right thing to do
is here.  All ideas welcomed.
depend only on CommutativeRing, not GcdDoman.  So, tweak.
…at as

well as the symbol being defined, it is defined in contexts matching the
condition on the export.
So: A category like 'with {if A then { b: % }}
should not be matched by 'add { if X then { b: % }}', unless A implies X.
Replace 'A' with Ring and 'X' with Field to get the idea.
Add more complex error printer for partially implemented exports.
@pippijn pippijn merged commit 087ff88 into master Nov 7, 2013
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

Successfully merging this pull request may close these issues.

Conditional checking in defaults and add bodies
2 participants