-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-ctx-solver
- Loading branch information
Showing
23 changed files
with
998 additions
and
34 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
True | ||
[a = "a"] | ||
no solution | ||
[a = ""] | ||
[a = ""] | ||
[a = "a"] | ||
[a = "a"] | ||
[a = "A"] | ||
[a = "a"] | ||
[a = ""] | ||
no solution | ||
[a = ""] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[s = "ab"] | ||
[s = "a"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
False | ||
[s = (seq.unit 1)(), t = (seq.unit 2)()] | ||
[s = (seq.unit (- 1))(), t = (seq.unit (- 1))()] | ||
[s = (as seq.empty (Seq Int))()] | ||
[s = (as seq.empty (Seq Int))()] | ||
[s = (seq.++ (seq.unit 1) (seq.unit 2))()] | ||
[s = (as seq.empty (Seq Int))()] | ||
[s = (seq.++ (seq.unit 1) (seq.unit 2))()] | ||
[s = (seq.++ (seq.unit 1) (seq.unit 1))(), t = (seq.++ (seq.unit 1) (seq.unit 1))()] | ||
[s = (as seq.empty (Seq Int))(), t = (as seq.empty (Seq Int))(), u = (as seq.empty (Seq Int))()] | ||
[s = (seq.++ (seq.unit (- 2)) (seq.unit (- 1)))(), t = (seq.unit (- 1))()] | ||
[s = (seq.++ (seq.unit (- 3)) (seq.unit (- 2)) (seq.unit 4))(), t = (seq.unit 4)()] | ||
no solution |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
True | ||
[s = (seq.++ (seq.unit 1) (seq.unit 2))(), t = (as seq.empty (Seq Int))()] | ||
[a = "heAAA"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
True | ||
True | ||
[B = "", trying = ""] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[a = "aAAAA"] | ||
[a = "?"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[a = "", b = "\u{0}", c = "\u{1}"] | ||
[a = "A", b = "", c = ""] | ||
[a = "", b = "", c = ""] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[a = "", b = ""] | ||
[a = "hello", b = ""] | ||
no solution |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[b = "hello world"] | ||
[b = "hello world"] | ||
[b = "hello world"] | ||
no solution | ||
no solution | ||
[b = "rello world"] | ||
[b = ""] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[a = 0, b = -1] | ||
[a = 1, b = 0] | ||
[c = "0", d = ""] | ||
[c = "\u{0}", d = ""] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
from cvc5_pythonic_api import * | ||
|
||
if __name__ == '__main__': | ||
try: | ||
|
||
a, b = FiniteFieldElems('a b', 5) | ||
|
||
a, b = FiniteFieldElems('a b', 5) | ||
# SAT | ||
solve(a * b == 1, a == 2) | ||
|
||
# SAT | ||
solve(a * b == 1, a == 2) | ||
|
||
# UNSAT | ||
solve(a * b == 1, a == 2, b == 2) | ||
# UNSAT | ||
solve(a * b == 1, a == 2, b == 2) | ||
except RuntimeError as e: | ||
# We want the test to pass in case cocoa is not installed | ||
if "--cocoa" not in str(e): | ||
# If the error is not related to cocoa then fail | ||
raise e | ||
else: | ||
# If cocoa is not installed then mock correct result | ||
print("[a = 2, b = -2]\nno solution") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from cvc5_pythonic_api import * | ||
r1 = Re('a') | ||
r2 = Re('b') | ||
print(is_re(r1)) | ||
a = String('a') | ||
solve(InRe(a,Union(r1,r2))) | ||
solve(InRe(a,Intersect(r1,r2))) | ||
solve(InRe(a,Complement(r1))) | ||
solve(InRe(a,Star(Union(r1,r2)))) | ||
solve(InRe(a,Range('a','b'))) | ||
solve(InRe(a,Diff(Star(r1),Star(r2)))) | ||
solve(InRe(a,AllChar())) | ||
solve(InRe(a,Plus(r1))) | ||
solve(InRe(a,Option(r1))) | ||
solve(InRe(a,Empty(ReSort()))) | ||
solve(InRe(a,Full())) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from cvc5_pythonic_api import * | ||
s = String('s') | ||
r1 = Re('a') | ||
r2 = Re('b') | ||
solve(InRe(s,Concat(r1,r2))) | ||
solve(InRe(s,Concat(r1,Star(r2)))) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from cvc5_pythonic_api import * | ||
s, t, u = Consts('s t u', SeqSort(IntSort())) | ||
print(s.is_string()) | ||
solve(Concat(s, Unit(IntVal(2))) == Concat(Unit(IntVal(1)), t)) | ||
solve(PrefixOf(s.at(0),t),Length(s)>0) | ||
solve(s[0]> 5) | ||
solve(PrefixOf(s,Concat(Unit(IntVal(1)),Unit(IntVal(2))))) | ||
solve(PrefixOf(Concat(Unit(IntVal(1)),Unit(IntVal(2))),s)) | ||
solve(SuffixOf(s,Concat(Unit(IntVal(1)),Unit(IntVal(2))))) | ||
solve(SuffixOf(Concat(Unit(IntVal(1)),Unit(IntVal(2))),s)) | ||
solve(Contains(s,t),Length(t)>1) | ||
solve(Replace(s,t,u)==Replace(s,u,t)) | ||
solve(IndexOf(s,t) == 1 ) | ||
solve(IndexOf(s,t,1) > 1 ) | ||
e = Empty(SeqSort(IntSort())) | ||
solve(PrefixOf(s,e)) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from cvc5_pythonic_api import * | ||
s,t = Consts('s t',SeqSort(IntSort())) | ||
print(is_seq(s)) | ||
solve(SeqUpdate(s,t,0) == Concat(Unit(IntVal(1)),Unit(IntVal(2)))) | ||
a = String('a') | ||
solve(SeqUpdate(a,StringVal('llo'),2) == 'hello') |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from cvc5_pythonic_api import * | ||
n = String("trying") | ||
b = String("B") | ||
print(b.sort().is_string()) | ||
print(is_string(b)) | ||
solve(n==b) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from cvc5_pythonic_api import * | ||
a = String('a') | ||
solve(Length(a) == 5,a[0]==StringVal('a')) | ||
solve(a.at(0)==StringVal('?')) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from cvc5_pythonic_api import * | ||
a, b, c = Strings('a b c') | ||
solve(a<b,b<c) | ||
solve(a>b,b<=c) | ||
solve(a >= c, a<=b) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from cvc5_pythonic_api import * | ||
a = String('a') | ||
b = String('b') | ||
const = StringVal('hello') | ||
solve(a == a+b) | ||
solve(a == Concat(a,b),a == const) | ||
solve(a == a+b, b == b+a, Length(a) > 0, Length(b) > 0 ) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from cvc5_pythonic_api import * | ||
a = StringVal('hello world') | ||
b = String('b') | ||
solve(Contains(b,a)) | ||
solve(Contains(a,b),PrefixOf(a,b)) | ||
solve(Contains(a,b),SuffixOf(a,b)) | ||
solve(PrefixOf(a,b),SubString(b,0,2)==StringVal('HE')) | ||
solve(IndexOf(b,a) == 3,b>a,IndexOf(b,a,2)==8) | ||
solve(Replace(a,'h','r')==b) | ||
e=Empty(StringSort()) | ||
solve(PrefixOf(b,e)) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from cvc5_pythonic_api import * | ||
a, b = Ints('a b') | ||
solve(IntToStr(a)>IntToStr(b)) | ||
solve(StrFromCode(a) > StrFromCode(b)) | ||
c,d = Strings('c d') | ||
solve(StrToInt(c)>StrToInt(d)) | ||
solve(StrToCode(c) > StrToCode(d)) |