update verigraph
[parser.git] / verigraph / src / it / polito / verigraph / mcnet / netobjs / DumbNode.java
1 /*******************************************************************************
2  * Copyright (c) 2017 Politecnico di Torino and others.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Apache License, Version 2.0
6  * which accompanies this distribution, and is available at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *******************************************************************************/
9 package it.polito.verigraph.mcnet.netobjs;
10
11 import com.microsoft.z3.Context;
12 import com.microsoft.z3.DatatypeExpr;
13 import com.microsoft.z3.Solver;
14 import it.polito.verigraph.mcnet.components.NetworkObject;
15
16 /**
17  * This is just a wrapper around z3 instances. The idea is that by using this we perhaps need to have
18  * fewer (or no) ifs to deal with the case where we don't instantiate an object for a node
19  *
20  */
21 public class DumbNode extends NetworkObject {
22     public DumbNode(Context ctx, Object[]... args){
23         super(ctx,args);
24     }
25
26     @Override
27     protected void addConstraints(Solver solver) {
28         return;
29     }
30
31     @Override
32     protected void init(Context ctx, Object[]... args) {
33         isEndHost=true;
34         this.z3Node = (DatatypeExpr)args[0][0];
35     }
36     @Override
37     public DatatypeExpr getZ3Node() {
38         return z3Node;
39     }
40 }