- edited description
'true' not recognized in cp-expression
I got this error with the following program. If I remove "true &" from the theory, the error disappears. This has an impact on the code coverage analyzer that I'm writing.
Error: The following feature is not yet implemented: Undefined term in cp-expression
vocabulary V{
type Vertex
type Weight isa int
partial Edge(Vertex,Vertex) : Weight
Cost : Weight
}
theory T:V{
Cost=sum{w[Weight],from[Vertex],to[Vertex]:true&Edge(from,to)=w:w}.
}
structure S :V{
Vertex={1..4}
Weight={1..10}
Edge={1,2,3; 3,4,5}
Cost=8
}
procedure main(){
stdoptions.nbmodels=1;
result=modelexpand(T,S)
print(#(result))
}
Comments (8)
-
reporter -
reporter - edited description
-
reporter - edited description
-
reporter - edited description
-
The problem is not because of true or false, it is because of the use of a partial function. Working example: http://dtai.cs.kuleuven.be/krr/idp-ide/?src=9f8cd28203ab0fae9dd48ac9a3b1d2b1
General advise don't use partial functions.
-
reporter Thank you for the tip. I would tend to see your suggestion as a valuable workaround.
The described behavior still seems buggy to me though : adding "true&" should not change anything, and it does limit what an automated test coverage tool could do.
-
I agree, it is definitely a bug.
-
reporter Thanks. I could transform partial functions into "graph+unicity condition" in the code coverage tool, but it would not address the root cause of the problem.
Here are some options to address the root cause :
-
drop the support of partial functions in IDP (but this is not backward-compatible);
-
silently transform partial functions into "graph + unicity condition" within IDP;
-
find out why it says "Undefined terms in cp-expression" and fix it.
-
- Log in to comment