summaryrefslogtreecommitdiff
path: root/interpret
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ansys.com>2014-06-17 14:34:40 +0200
committerAlex Auvolat <alex.auvolat@ansys.com>2014-06-17 14:34:40 +0200
commitd57e3491720e912b4e2fd6c73f9d356901a42df5 (patch)
treebc0feb8577b162e3e735fa57c7b4b0d82be808ce /interpret
parent860ad2752ef0544bc6874d895875a78f91db9084 (diff)
downloadscade-analyzer-d57e3491720e912b4e2fd6c73f9d356901a42df5.tar.gz
scade-analyzer-d57e3491720e912b4e2fd6c73f9d356901a42df5.zip
Write transformation of program into logical formula.
Diffstat (limited to 'interpret')
-rw-r--r--interpret/ast_util.ml2
-rw-r--r--interpret/interface.ml6
-rw-r--r--interpret/interpret.ml2
3 files changed, 9 insertions, 1 deletions
diff --git a/interpret/ast_util.ml b/interpret/ast_util.ml
index e7428bd..80411d8 100644
--- a/interpret/ast_util.ml
+++ b/interpret/ast_util.ml
@@ -70,4 +70,4 @@ let combinatorial_cycle v = error ("Combinatorial cycle with variable: " ^ v)
let no_variable e = error ("No such variable: " ^ e)
let type_error e = error ("Type error: " ^ e)
let not_implemented e = error ("Not implemented: " ^ e)
-
+let invalid_arity e = error ("Invalid arity (" ^ e ^ ")")
diff --git a/interpret/interface.ml b/interpret/interface.ml
index 7b84396..621bfa2 100644
--- a/interpret/interface.ml
+++ b/interpret/interface.ml
@@ -1,4 +1,5 @@
open Ast
+open Util
module type INTERPRET = sig
@@ -24,6 +25,11 @@ module type INTERPRET = sig
type io = (id * value) list
(*
+ Get the constants only
+ *)
+ val consts : prog -> id -> value VarMap.t
+
+ (*
Construct initial state for a program.
The id is the root node of the program evaluation.
*)
diff --git a/interpret/interpret.ml b/interpret/interpret.ml
index 063dad0..24903f1 100644
--- a/interpret/interpret.ml
+++ b/interpret/interpret.ml
@@ -451,5 +451,7 @@ module I : INTERPRET = struct
do_weak_transitions env st.root_scope;
extract_st env, out
+ let consts p root =
+ (init_state p root).save
end