Exception in thread "main" java.lang.UnsupportedOperationException: Editing term list is not supported for external atoms!
at at.ac.tuwien.kr.alpha.common.atoms.ExternalAtom.withTerms(ExternalAtom.java:135)
at at.ac.tuwien.kr.alpha.grounder.transformation.IntervalTermToIntervalAtom.rewriteLiteral(IntervalTermToIntervalAtom.java:106)
at at.ac.tuwien.kr.alpha.grounder.transformation.IntervalTermToIntervalAtom.rewriteIntervalSpecifications(IntervalTermToIntervalAtom.java:66)
at at.ac.tuwien.kr.alpha.grounder.transformation.IntervalTermToIntervalAtom.apply(IntervalTermToIntervalAtom.java:143)
at at.ac.tuwien.kr.alpha.grounder.transformation.NormalizeProgramTransformation.apply(NormalizeProgramTransformation.java:36)
at at.ac.tuwien.kr.alpha.api.Alpha.normalizeProgram(Alpha.java:124)
at at.ac.tuwien.kr.alpha.api.Alpha.solve(Alpha.java:159)
at at.ac.tuwien.kr.alpha.api.Alpha.solve(Alpha.java:151)
Cause seems to be that IntervalTermToIntervalAtom (correctly) tries to rewrite the interval in &array_idx_value[PARTS, 0..MAX_IDX](INPUT) but fails to do so since ExternalAtoms throw an exception in withTerms. I cannot think of a good reason for that, so the fix should be to adapt ExternalAtoms withTerms to use the default implementation from BasicAtom.
Following code throws an exception in interval rewriting:
Error is:
Cause seems to be that
IntervalTermToIntervalAtom
(correctly) tries to rewrite the interval in&array_idx_value[PARTS, 0..MAX_IDX](INPUT)
but fails to do so sinceExternalAtom
s throw an exception inwithTerms
. I cannot think of a good reason for that, so the fix should be to adaptExternalAtom
swithTerms
to use the default implementation fromBasicAtom
.