@@ -65,6 +65,7 @@ case object Panic extends CmdsMod
6565 2. UninterpretedType
6666 3. FunctionCall
6767 4. evaluateBoolExpr
68+ 5. Json input support
6869*/
6970
7071sealed abstract class ConcreteValue {
@@ -125,9 +126,10 @@ object ConcreteSimulator {
125126 var undetCount : Int = 0 ;
126127 var cntInt : Int = 0 ;
127128 var terminateInt : Int = 0 ;
128-
129+ var proofResults : ListBuffer [ CheckResult ] = ListBuffer [ CheckResult ]()
129130 // util
130131 val random = new Random ()
132+
131133 case class ConcreteContext () {
132134 var varMap : scala.collection.mutable.Map [Identifier , ConcreteValue ] = collection.mutable.Map ();
133135 var varTypeMap : scala.collection.mutable.Map [Identifier , Type ] = collection.mutable.Map ();
@@ -143,13 +145,11 @@ object ConcreteSimulator {
143145 else if (inputMap.contains(variable)) inputMap(variable)
144146 else {
145147 ConcreteUndef ()
146- }
147- }
148+ }}
148149 def write (variable : Identifier , value : ConcreteValue ) {
149150 if (varMap.contains(variable)) varMap(variable) = value
150151 else if (inputMap.contains(variable)) inputMap(variable) = value
151- else throw new Error (f " Variable ${variable.toString} not found in context " )
152- }
152+ else throw new Error (f " Variable ${variable.toString} not found in context " )}
153153 def updateVar (lhs : Lhs , value : ConcreteValue ) {
154154 defaultLog.debug(" Update " + lhs.toString+ " With Value " + value.toString)
155155 lhs match {
@@ -247,9 +247,7 @@ object ConcreteSimulator {
247247 varMap.- (variable_name)
248248 }}
249249
250- def extendVarJson (frame: Int , vars : List [(Identifier , Type )]): Unit = {
251- ;}
252-
250+ def extendVarJson (frame: Int , vars : List [(Identifier , Type )]): Unit = {;}
253251 def assignUndefVar (vars : List [(Identifier , Type )],isInput : Boolean ): Unit = {
254252 if (isInput){
255253 var retContext = inputMap;
@@ -439,9 +437,7 @@ object ConcreteSimulator {
439437 case _ => {
440438 throw new Error (" Hit unimplemented code part" )
441439 }
442- }
443-
444- }
440+ } }
445441
446442 // function gathring value as we want
447443 def generateValue (cValue: ConcreteValue ,uclidType: Type ,isInput: Boolean ): ConcreteValue = {
@@ -588,8 +584,7 @@ object ConcreteSimulator {
588584 case _ => ConcreteUndef ()
589585 }
590586 }
591- }
592- }
587+ }}
593588 // private Functions
594589 def updateRecordValue (fields : List [Identifier ], value : ConcreteValue ,
595590 recordValue : ConcreteValue ) : ConcreteRecord = {
@@ -643,11 +638,9 @@ object ConcreteSimulator {
643638 }
644639 for (variable <- vars){
645640 println(variable._1+ " : " + ConcreteSimulator .evaluate_expr(this ,variable._1).toString)
646- }}
647- }
641+ }}}
642+
648643
649- var proofResults : ListBuffer [CheckResult ] = ListBuffer [CheckResult ]()
650-
651644 def execute (module : Module , config : UclidMain .Config ) : List [CheckResult ] = {
652645 terminate = false ;
653646 proofResults.clear();
@@ -853,7 +846,8 @@ object ConcreteSimulator {
853846 }
854847 }
855848 case ConcreteUndef () => {
856- true
849+ terminate = true
850+ return false
857851 }
858852 case _ => throw new NotImplementedError (" Should not touch this line" )
859853 }
0 commit comments