Skip to content

Same aggregate cannot be used twice #340

@rtaupe

Description

@rtaupe

The following program:

head1(A,N) :- body1(A), n(N), N <= #count { B : lit(A,B) }.
head2(A,N) :- body2(A), n(N), N <= #count { B : lit(A,B) }.

causes:

Exception in thread "main" java.lang.RuntimeException: AggregateInfo for AggregateLiteral already existing.! Should not happen.
        at at.ac.tuwien.kr.alpha.commons.util.Util.oops(Util.java:101)
        at at.ac.tuwien.kr.alpha.core.programs.transformation.aggregates.AggregateRewritingContext.registerAggregateLiteral(AggregateRewritingContext.java:93)
        at at.ac.tuwien.kr.alpha.core.programs.transformation.aggregates.AggregateRewritingContext.registerRule(AggregateRewritingContext.java:70)
        at at.ac.tuwien.kr.alpha.core.programs.transformation.aggregates.AggregateRewriting.apply(AggregateRewriting.java:82)
        at at.ac.tuwien.kr.alpha.core.programs.transformation.NormalizeProgramTransformation.apply(NormalizeProgramTransformation.java:31)
        at at.ac.tuwien.kr.alpha.api.impl.AlphaImpl.normalizeProgram(AlphaImpl.java:139)
        at at.ac.tuwien.kr.alpha.api.impl.AlphaImpl.prepareSolverFor(AlphaImpl.java:286)
        at at.ac.tuwien.kr.alpha.Main.main(Main.java:104)

Related feature: #141

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions