Giter Site home page Giter Site logo

Comments (3)

mikand avatar mikand commented on June 11, 2024

Hi @cvick32,

indeed it should work: there is nothing special about Read or Write, they are terms for the substituter.

What is the behavior of pysmt? does it crash?
Can you provide a full example to reproduce the bug?

from pysmt.

cvick32 avatar cvick32 commented on June 11, 2024

Here's a python file that fails to substitute a term like one that I had above:

from pysmt.shortcuts import Function, Symbol, Implies, Not, Iff, Equals
from pysmt.typing import BOOL, INT, _TypeDecl, FunctionType, PySMTType


arr = _TypeDecl("Arr-Id-Bool", 0)
arr_type = PySMTType(arr, "Arr-Id-Bool")
ReadType = FunctionType(BOOL, [arr_type, INT])
WriteType = FunctionType(arr_type, [arr_type, INT, BOOL])
Read = Symbol(f"ReadArr-Id-Bool", ReadType)
Write = Symbol(f"WriteArr-Id-Bool", WriteType)

V = Symbol("V", BOOL)
L = Symbol("L", INT)
Z = Symbol("Z", INT)

Arr1 = Symbol("Arr1", arr_type)


lhs = Read(Write(Arr1, L, V), Z)
rhs = Read(Arr1, Z)

phi = Read(Write(Arr1, L, V), Z)

assert phi.substitute({lhs: rhs}) == rhs, "Assert Fails"

I would expect for phi to match lhs as they are syntactically equivalent, but the assert fails for me.

from pysmt.

cvick32 avatar cvick32 commented on June 11, 2024

Hey @mikand, just wanted to check in and make sure this script has the same behavior for you.

from pysmt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.