{"id":13749102,"url":"https://github.com/novafacing/yices2-rs","last_synced_at":"2025-05-15T21:36:16.981Z","repository":{"id":188957865,"uuid":"679785668","full_name":"novafacing/yices2-rs","owner":"novafacing","description":"Rust bindings to the Yices2 SMT solver","archived":false,"fork":false,"pushed_at":"2023-09-01T08:52:14.000Z","size":15875,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-22T21:32:25.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/novafacing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-17T16:00:55.000Z","updated_at":"2024-08-03T07:02:58.596Z","dependencies_parsed_at":"2024-08-03T07:13:03.935Z","dependency_job_id":null,"html_url":"https://github.com/novafacing/yices2-rs","commit_stats":null,"previous_names":["novafacing/yices2-rs"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novafacing%2Fyices2-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novafacing%2Fyices2-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novafacing%2Fyices2-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novafacing%2Fyices2-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/novafacing","download_url":"https://codeload.github.com/novafacing/yices2-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224859695,"owners_count":17381676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T07:00:55.308Z","updated_at":"2024-11-15T23:31:59.464Z","avatar_url":"https://github.com/novafacing.png","language":"Rust","funding_links":[],"categories":["Projects"],"sub_categories":["Libraries"],"readme":"# Yices2\n\nHigh level bindings to the Yices2 SMT solver.\n\n## Examples\n\nSome examples to demonstrate usage of this library.\n\n### Linear Real Arithmetic\n\n```rust,no_run\nuse yices2::prelude::*;\n\nfn main() -\u003e Result\u003c(), Error\u003e {\n  let config = Config::with_defaults_for_logics([Logic::QF_LRA])?;\n  let ctx = Context::with_config(\u0026config)?;\n  let x = Uninterpreted::with_name(RealType::new()?, \"x\")?;\n  let y = Uninterpreted::with_name(RealType::new()?, \"y\")?;\n  let t1 = Add::new(x, y)?;\n  let t2: Term = ArithmeticGreaterThanAtom::new(t1, ArithmeticConstant::zero()?)?.into();\n  let t3: Term = Or::new([\n      ArithmeticLessThanAtom::new(x, ArithmeticConstant::zero()?)?,\n      ArithmeticLessThanAtom::new(y, ArithmeticConstant::zero()?)?,\n  ])?.into();\n  ctx.assert([t2, t3])?;\n  let status = ctx.check()?;\n  assert_eq!(status, Status::STATUS_SAT);\n  let xv = ctx.model()?.get_double(x)?;\n  let yv = ctx.model()?.get_double(y)?;\n  assert_eq!(xv, 2.0);\n  assert_eq!(yv, -1.0);\n\n  Ok(())\n}\n```\n\n### BitVectors\n\n```rust,no_run\nuse yices2::prelude::*;\n\nfn main() -\u003e Result\u003c(), Error\u003e {\n  let config = Config::with_defaults_for_logics([Logic::QF_BV])?;\n  let ctx = Context::with_config(\u0026config)?;\n  let bv = BitVectorType::new(32)?;\n  let bvc = BitVectorConstant::from_hex_with_name(\"00000000\", \"c\")?;\n  let x = Uninterpreted::with_name(bv, \"x\")?;\n  let y = Uninterpreted::with_name(bv, \"y\")?;\n  let a1: Term = BitVectorSignedGreaterThanAtom::new(x, bvc)?.into();\n  let a2: Term = BitVectorSignedGreaterThanAtom::new(y, bvc)?.into();\n  let a3: Term = BitVectorSignedLessThanAtom::new(\n      BitVectorAdd::new(x, y)?,\n      x,\n  )?.into();\n  ctx.assert([a1, a2, a3])?;\n\n  assert_eq!(ctx.check()?, Status::STATUS_SAT);\n\n  Ok(())\n}\n```\n\n## Usage\n\nYou can add this crate to your project by running:\n\n```sh\ncargo add yices2\n```\n\nOr by adding this line to your `Cargo.toml` (note the patch pseudo-prerelease flag. In\norder to maintain version number compatibility with Yices2, changes to the `sys` crate\nwill be made available under linearly increasing patch versions):\n\n```toml\nyices2 = { version = \"2.6.4-patch.1\" }\n```\n\n## Features\n\nBy default, `yices2` enables the `ctor` feature, which calls `yices_init` at program\ninitialization and `yices_exit` at program exit. If you'd like to disable this behavior,\nyou can use the `default-features = false` flag in your `Cargo.toml`.\n\n```toml\nyices2 = { version = \"2.6.4-patch.1\", default-features = false }\n```\n\n## Notes\n\nThis library is not thread safe, because the underlying `Yices2` library is not thread\nsafe. Do not use this library in multithreaded code. To use in multi-threaded code,\ncreate a separate process and submit requests to the solver running in that process or\ndisable the `ctor` feature and manage state yourself.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovafacing%2Fyices2-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovafacing%2Fyices2-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovafacing%2Fyices2-rs/lists"}