@@ -808,12 +808,12 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
808808 sort < ElemSort extends AnySort < Name > > ( sort : ElemSort ) : SMTSetSort < Name , ElemSort > {
809809 return Array . sort ( sort , Bool . sort ( ) ) ;
810810 } ,
811- const < ElemSort extends AnySort < Name > > ( name : string , sort : ElemSort ) : SMTSet < Name , ElemSort > {
811+ const < ElemSort extends AnySort < Name > > ( name : string , sort : ElemSort ) : SMTSet < Name , ElemSort > {
812812 return new SetImpl < ElemSort > (
813813 check ( Z3 . mk_const ( contextPtr , _toSymbol ( name ) , Array . sort ( sort , Bool . sort ( ) ) . ptr ) ) ,
814814 ) ;
815815 } ,
816- consts < ElemSort extends AnySort < Name > > ( names : string | string [ ] , sort : ElemSort ) : SMTSet < Name , ElemSort > [ ] {
816+ consts < ElemSort extends AnySort < Name > > ( names : string | string [ ] , sort : ElemSort ) : SMTSet < Name , ElemSort > [ ] {
817817 if ( typeof names === 'string' ) {
818818 names = names . split ( ' ' ) ;
819819 }
@@ -822,14 +822,17 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
822822 empty < ElemSort extends AnySort < Name > > ( sort : ElemSort ) : SMTSet < Name , ElemSort > {
823823 return EmptySet ( sort ) ;
824824 } ,
825- val < ElemSort extends AnySort < Name > > ( values : CoercibleToMap < SortToExprMap < ElemSort , Name > , Name > [ ] , sort : ElemSort ) : SMTSet < Name , ElemSort > {
825+ val < ElemSort extends AnySort < Name > > (
826+ values : CoercibleToMap < SortToExprMap < ElemSort , Name > , Name > [ ] ,
827+ sort : ElemSort ,
828+ ) : SMTSet < Name , ElemSort > {
826829 var result = EmptySet ( sort ) ;
827830 for ( const value of values ) {
828831 result = SetAdd ( result , value ) ;
829832 }
830833 return result ;
831- }
832- }
834+ } ,
835+ } ;
833836
834837 const Datatype = Object . assign (
835838 ( name : string ) : DatatypeImpl => {
@@ -838,8 +841,8 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
838841 {
839842 createDatatypes ( ...datatypes : DatatypeImpl [ ] ) : DatatypeSortImpl [ ] {
840843 return createDatatypes ( ...datatypes ) ;
841- }
842- }
844+ } ,
845+ } ,
843846 ) ;
844847
845848 ////////////////
@@ -1322,41 +1325,69 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
13221325 }
13231326
13241327 function SetUnion < ElemSort extends AnySort < Name > > ( ...args : SMTSet < Name , ElemSort > [ ] ) : SMTSet < Name , ElemSort > {
1325- return new SetImpl < ElemSort > ( check ( Z3 . mk_set_union ( contextPtr , args . map ( arg => arg . ast ) ) ) ) ;
1328+ return new SetImpl < ElemSort > (
1329+ check (
1330+ Z3 . mk_set_union (
1331+ contextPtr ,
1332+ args . map ( arg => arg . ast ) ,
1333+ ) ,
1334+ ) ,
1335+ ) ;
13261336 }
1327-
1337+
13281338 function SetIntersect < ElemSort extends AnySort < Name > > ( ...args : SMTSet < Name , ElemSort > [ ] ) : SMTSet < Name , ElemSort > {
1329- return new SetImpl < ElemSort > ( check ( Z3 . mk_set_intersect ( contextPtr , args . map ( arg => arg . ast ) ) ) ) ;
1339+ return new SetImpl < ElemSort > (
1340+ check (
1341+ Z3 . mk_set_intersect (
1342+ contextPtr ,
1343+ args . map ( arg => arg . ast ) ,
1344+ ) ,
1345+ ) ,
1346+ ) ;
13301347 }
1331-
1332- function SetDifference < ElemSort extends AnySort < Name > > ( a : SMTSet < Name , ElemSort > , b : SMTSet < Name , ElemSort > ) : SMTSet < Name , ElemSort > {
1348+
1349+ function SetDifference < ElemSort extends AnySort < Name > > (
1350+ a : SMTSet < Name , ElemSort > ,
1351+ b : SMTSet < Name , ElemSort > ,
1352+ ) : SMTSet < Name , ElemSort > {
13331353 return new SetImpl < ElemSort > ( check ( Z3 . mk_set_difference ( contextPtr , a . ast , b . ast ) ) ) ;
13341354 }
1335-
13361355
1337- function SetAdd < ElemSort extends AnySort < Name > > ( set : SMTSet < Name , ElemSort > , elem : CoercibleToMap < SortToExprMap < ElemSort , Name > , Name > ) : SMTSet < Name , ElemSort > {
1356+ function SetAdd < ElemSort extends AnySort < Name > > (
1357+ set : SMTSet < Name , ElemSort > ,
1358+ elem : CoercibleToMap < SortToExprMap < ElemSort , Name > , Name > ,
1359+ ) : SMTSet < Name , ElemSort > {
13381360 const arg = set . elemSort ( ) . cast ( elem as any ) ;
13391361 return new SetImpl < ElemSort > ( check ( Z3 . mk_set_add ( contextPtr , set . ast , arg . ast ) ) ) ;
13401362 }
1341- function SetDel < ElemSort extends AnySort < Name > > ( set : SMTSet < Name , ElemSort > , elem : CoercibleToMap < SortToExprMap < ElemSort , Name > , Name > ) : SMTSet < Name , ElemSort > {
1363+ function SetDel < ElemSort extends AnySort < Name > > (
1364+ set : SMTSet < Name , ElemSort > ,
1365+ elem : CoercibleToMap < SortToExprMap < ElemSort , Name > , Name > ,
1366+ ) : SMTSet < Name , ElemSort > {
13421367 const arg = set . elemSort ( ) . cast ( elem as any ) ;
13431368 return new SetImpl < ElemSort > ( check ( Z3 . mk_set_del ( contextPtr , set . ast , arg . ast ) ) ) ;
13441369 }
13451370 function SetComplement < ElemSort extends AnySort < Name > > ( set : SMTSet < Name , ElemSort > ) : SMTSet < Name , ElemSort > {
13461371 return new SetImpl < ElemSort > ( check ( Z3 . mk_set_complement ( contextPtr , set . ast ) ) ) ;
13471372 }
1348-
1373+
13491374 function EmptySet < ElemSort extends AnySort < Name > > ( sort : ElemSort ) : SMTSet < Name , ElemSort > {
13501375 return new SetImpl < ElemSort > ( check ( Z3 . mk_empty_set ( contextPtr , sort . ptr ) ) ) ;
13511376 }
13521377 function FullSet < ElemSort extends AnySort < Name > > ( sort : ElemSort ) : SMTSet < Name , ElemSort > {
13531378 return new SetImpl < ElemSort > ( check ( Z3 . mk_full_set ( contextPtr , sort . ptr ) ) ) ;
13541379 }
1355- function isMember < ElemSort extends AnySort < Name > > ( elem : CoercibleToMap < SortToExprMap < ElemSort , Name > , Name > , set : SMTSet < Name , ElemSort > ) : Bool < Name > {
1380+ function isMember < ElemSort extends AnySort < Name > > (
1381+ elem : CoercibleToMap < SortToExprMap < ElemSort , Name > , Name > ,
1382+ set : SMTSet < Name , ElemSort > ,
1383+ ) : Bool < Name > {
13561384 const arg = set . elemSort ( ) . cast ( elem as any ) ;
13571385 return new BoolImpl ( check ( Z3 . mk_set_member ( contextPtr , arg . ast , set . ast ) ) ) ;
13581386 }
1359- function isSubset < ElemSort extends AnySort < Name > > ( a : SMTSet < Name , ElemSort > , b : SMTSet < Name , ElemSort > ) : Bool < Name > {
1387+ function isSubset < ElemSort extends AnySort < Name > > (
1388+ a : SMTSet < Name , ElemSort > ,
1389+ b : SMTSet < Name , ElemSort > ,
1390+ ) : Bool < Name > {
13601391 return new BoolImpl ( check ( Z3 . mk_set_subset ( contextPtr , a . ast , b . ast ) ) ) ;
13611392 }
13621393
@@ -2675,7 +2706,10 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
26752706 }
26762707 }
26772708
2678- class SetImpl < ElemSort extends Sort < Name > > extends ExprImpl < Z3_ast , ArraySortImpl < [ ElemSort ] , BoolSort < Name > > > implements SMTSet < Name , ElemSort > {
2709+ class SetImpl < ElemSort extends Sort < Name > >
2710+ extends ExprImpl < Z3_ast , ArraySortImpl < [ ElemSort ] , BoolSort < Name > > >
2711+ implements SMTSet < Name , ElemSort >
2712+ {
26792713 declare readonly __typename : 'Array' ;
26802714
26812715 elemSort ( ) : ElemSort {
@@ -2803,7 +2837,7 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
28032837
28042838 for ( const [ fieldName , fieldSort ] of fields ) {
28052839 fieldNames . push ( fieldName ) ;
2806-
2840+
28072841 if ( fieldSort instanceof DatatypeImpl ) {
28082842 // Reference to another datatype being defined
28092843 const refIndex = datatypes . indexOf ( fieldSort ) ;
@@ -2826,7 +2860,7 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
28262860 Z3 . mk_string_symbol ( contextPtr , `is_${ constructorName } ` ) ,
28272861 fieldNames . map ( name => Z3 . mk_string_symbol ( contextPtr , name ) ) ,
28282862 fieldSorts ,
2829- fieldRefs
2863+ fieldRefs ,
28302864 ) ;
28312865 constructors . push ( constructor ) ;
28322866 scopedConstructors . push ( constructor ) ;
@@ -2844,33 +2878,33 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
28442878 const results : DatatypeSortImpl [ ] = [ ] ;
28452879 for ( let i = 0 ; i < resultSorts . length ; i ++ ) {
28462880 const sortImpl = new DatatypeSortImpl ( resultSorts [ i ] ) ;
2847-
2881+
28482882 // Attach constructor, recognizer, and accessor functions dynamically
28492883 const numConstructors = sortImpl . numConstructors ( ) ;
28502884 for ( let j = 0 ; j < numConstructors ; j ++ ) {
28512885 const constructor = sortImpl . constructorDecl ( j ) ;
28522886 const recognizer = sortImpl . recognizer ( j ) ;
28532887 const constructorName = constructor . name ( ) . toString ( ) ;
2854-
2888+
28552889 // Attach constructor function
28562890 if ( constructor . arity ( ) === 0 ) {
28572891 // Nullary constructor (constant)
28582892 ( sortImpl as any ) [ constructorName ] = constructor . call ( ) ;
28592893 } else {
28602894 ( sortImpl as any ) [ constructorName ] = constructor ;
28612895 }
2862-
2896+
28632897 // Attach recognizer function
28642898 ( sortImpl as any ) [ `is_${ constructorName } ` ] = recognizer ;
2865-
2899+
28662900 // Attach accessor functions
28672901 for ( let k = 0 ; k < constructor . arity ( ) ; k ++ ) {
28682902 const accessor = sortImpl . accessor ( j , k ) ;
28692903 const accessorName = accessor . name ( ) . toString ( ) ;
28702904 ( sortImpl as any ) [ accessorName ] = accessor ;
28712905 }
28722906 }
2873-
2907+
28742908 results . push ( sortImpl ) ;
28752909 }
28762910
0 commit comments