predicate module

class predicate.Predicate(formula)[source]

Bases: object

Parameters

formula (pysmt.fnode.FNode) –

at(i=0)[source]
Return type

FNode

Parameters

i (int) –

prime()[source]
Return type

FNode

unroll(start, end)[source]
Return type

FNode

Parameters
  • start (int) –

  • end (int) –

unroll_from_0(end)[source]
Return type

FNode

Parameters

end (int) –

predicate.Variable(name, typename=Bool)[source]
Return type

FNode

Parameters

name (str) –

predicate.at_time_plus(v, t=0)[source]

Builds an SMT variable representing v@k at time t, i.e., v@{k+i1}. If can be thought of as adding an offset t to the index of variable v.

Return type

FNode

Parameters
  • v (pysmt.fnode.FNode) –

  • t (int) –

predicate.get_index(s, with_type=<class 'str'>)[source]
Parameters

s (pysmt.fnode.FNode) –

predicate.get_name(s)[source]
Return type

str

Parameters

s (pysmt.fnode.FNode) –

predicate.get_predicate(P)[source]

Assumes the variables in \(P\) are of the form <var_name>’@’<number> Will return a function that acts as a predicate that can be indexed. For example, suppose we create T ≡ x@1 = x@0 + 1, then T(i) ≡ x@{i+1} = x@i + 1

Return type

Callable[[int], FNode]

Parameters

P (pysmt.fnode.FNode) –

predicate.instantiate_predicate_variables_at_plus(P, i=0)[source]

Assumes the variables in \(P\) are of the form <var_name>’@’<number> Will return a predicate with variables indexed using i. For example, suppose we create T ≡ x@1 = x@0 + 1, then x@{i+1} = x@i + 1 is returned.

In general, given if x@k is in P, then it will be mapped to x@{k+i}

Return type

FNode

Returns

Predicate new_P such that for each x@k variable in P will correspond to x@{k+i} in new_P.

Parameters
  • P (pysmt.fnode.FNode) –

  • i (int) –

predicate.main()[source]
predicate.prime(v)[source]

Builds an SMT variable representing v@k at time v@{k+1}. See at_time_plus()

Return type

FNode

Parameters

v (pysmt.fnode.FNode) –

predicate.str_model(m)[source]

Assuming that :py:`Model` m represents a trace counterexample, this function returns a string with the variables sorted by intex and highlights with an asterisk the variables that change from one state to the next.

Return type

str

Parameters

m (pysmt.solvers.solver.Model) –