From: Aina Niemetz Date: Tue, 3 Jul 2018 11:49:38 +0000 (-0700) Subject: Fix datatypes example: nil constructor was missing. (#2135) X-Git-Tag: cvc5-1.0.0~4922 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=842734e39362674a71d8acb95cdf08af16300a67;p=cvc5.git Fix datatypes example: nil constructor was missing. (#2135) --- diff --git a/examples/api/datatypes.cpp b/examples/api/datatypes.cpp index d86bfad82..200f1bb2c 100644 --- a/examples/api/datatypes.cpp +++ b/examples/api/datatypes.cpp @@ -106,9 +106,11 @@ int main() { Type sort = em.mkSort("T", ExprManager::SORT_FLAG_PLACEHOLDER); Datatype paramConsListSpec("list", std::vector{sort}); DatatypeConstructor paramCons("cons"); + DatatypeConstructor paramNil("nil"); paramCons.addArg("head", sort); paramCons.addArg("tail", DatatypeSelfType()); paramConsListSpec.addConstructor(paramCons); + paramConsListSpec.addConstructor(paramNil); DatatypeType paramConsListType = em.mkDatatypeType(paramConsListSpec); Type paramConsIntListType = paramConsListType.instantiate(std::vector{em.integerType()});