Skip to content

Crash when mapping unsat core to terms #61

@balasub

Description

@balasub

The model below can be used to reproduce a NullReferenceException that happens with the following sequence of actions:

  1. Load model
  2. solve pm 1 Graph.conforms
  3. ex 0 0 0
domain Graph
{
  Node ::= new (id: Integer).
  Edge ::= new (src: Integer, dst: Integer).

  edgeHasSrc ::= (src: Integer).
  edgeHasDst ::= (dst: Integer).

  path ::= (Integer, Integer).
  cycle ::= (Integer).

  badSrc ::= (src: Integer).
  badDst ::= (dst: Integer).

  edgeHasSrc(a) :- Edge(a, b), Node(a).
  edgeHasDst(b) :- Edge(a, b), Node(b).

  badSrc(a) :- Edge(a, b), no edgeHasSrc(a).
  badDst(b) :- Edge(a, b), no edgeHasDst(b).

  path(a, b) :- Edge(a, b).
  path(a, c) :- path(a, b), path(b, c).
  cycle(a) :- path(a, a).

  conforms no badSrc(_).
  conforms no badDst(_).

  enoughNodes :- count({ n | n is Node(_)}) > 4. 
  conforms enoughNodes.

  enoughEdges :- count({ e | e is Edge(_, _)}) = 3. 
  conforms enoughEdges.
  
  enoughCycles :- count({ c | c is cycle(_)}) = 4. 
  conforms enoughCycles.
}

partial model pm of Graph
[solver_RecursionBound = 5]
{
  Node(t).
  Node(u).
  Node(v).
  Node(w).
  Node(x).
  Edge(l, m).
  Edge(n, o).
  Edge(p, q).
  Edge(r, s).
  Edge(a, b).
  Edge(c, d).
}

Stack trace below.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions