'true' not recognized in cp-expression

Issue #951 new
Pierre Carbonnelle created an issue

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)

  1. Pierre Carbonnelle 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.

  2. Pierre Carbonnelle 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.

  3. Log in to comment