Conversation
chc::Term::Int stands for an SMT-LIB Int, whose numerals are unbounded, but it held an i64. Rust integer constants, SwitchInt targets, formula literals and enum discriminants arrive as u128/i128 and were narrowed with try_into().unwrap(), panicking beyond the i64 range, and Term::pow2 had to build 2^63 and above as a product of literals. Term::Int, rty::EnumVariantDef::discr and chc::DatatypeCtor::discriminant now hold a num_bigint::BigInt, and Term::int accepts anything convertible into one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MvvhC4sHsobSMHAn9CgLBq
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chc::Term::Intstands for an SMT-LIBInt, and SMT-LIB numerals have no size limit. Both Z3 and PCSat accept literals such as2^128.Term::Intitself, however, held ani64.Changes
Term::Int,rty::EnumVariantDef::discrandchc::DatatypeCtor::discriminantnow hold anum_bigint::BigInt, andTerm::intaccepts anyimpl Into<BigInt>.u128/i128values from rustc and narrowed them toi64now pass the values through unchanged:const_value_ty)SwitchInttargetsannot_fn); this removes theexpect("integer literal out of i64 range in formula")discr_value)Term::pow2is now a single literal,BigInt::from(1) << exp. It no longer builds2^63and above as a product of literals.No new tests, as agreed.
Testing
cargo testfails on the same set of tests asmain, and on nothing else. The 65 failures are all PCSat tests: the localcoar:mainimage can't handle(Seq Int).cargo fmt --checkandcargo clippy --all-targetsare clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01MvvhC4sHsobSMHAn9CgLBq
Generated by Claude Code