github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library@v0.2.0/Actions/Actions.go (about)

     1  // Package Actions
     2  // Dafny module Actions compiled into Go
     3  
     4  package Actions
     5  
     6  import (
     7  	os "os"
     8  
     9  	m_Base64 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Base64"
    10  	m_Base64Lemmas "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Base64Lemmas"
    11  	m_BoundedInts "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/BoundedInts"
    12  	m_DivInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/DivInternals"
    13  	m_DivInternalsNonlinear "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/DivInternalsNonlinear"
    14  	m_DivMod "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/DivMod"
    15  	m_FileIO "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/FileIO"
    16  	m_FloatCompare "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/FloatCompare"
    17  	m_Functions "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Functions"
    18  	m_GeneralInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/GeneralInternals"
    19  	m_GetOpt "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/GetOpt"
    20  	m_HexStrings "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/HexStrings"
    21  	m_Logarithm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Logarithm"
    22  	m__Math "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Math_"
    23  	m_ModInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/ModInternals"
    24  	m_ModInternalsNonlinear "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/ModInternalsNonlinear"
    25  	m_Mul "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Mul"
    26  	m_MulInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/MulInternals"
    27  	m_MulInternalsNonlinear "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/MulInternalsNonlinear"
    28  	m_Power "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Power"
    29  	m_Relations "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Relations"
    30  	m_Seq "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Seq"
    31  	m_Seq_MergeSort "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Seq_MergeSort"
    32  	m_Sorting "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Sorting"
    33  	m_StandardLibrary "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary"
    34  	m_StandardLibraryInterop "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibraryInterop"
    35  	m_StandardLibrary_Sequence "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_Sequence"
    36  	m_StandardLibrary_String "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_String"
    37  	m_StandardLibrary_UInt "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_UInt"
    38  	m_Streams "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Streams"
    39  	m_UnicodeStrings "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/UnicodeStrings"
    40  	m__Unicode "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Unicode_"
    41  	m_Utf16EncodingForm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Utf16EncodingForm"
    42  	m_Utf8EncodingForm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Utf8EncodingForm"
    43  	m_Wrappers "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Wrappers"
    44  	m__System "github.com/dafny-lang/DafnyRuntimeGo/v4/System_"
    45  	_dafny "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny"
    46  )
    47  
    48  var _ = os.Args
    49  var _ _dafny.Dummy__
    50  var _ m__System.Dummy__
    51  var _ m_Wrappers.Dummy__
    52  var _ m_Relations.Dummy__
    53  var _ m_Seq_MergeSort.Dummy__
    54  var _ m__Math.Dummy__
    55  var _ m_Seq.Dummy__
    56  var _ m_BoundedInts.Dummy__
    57  var _ m__Unicode.Dummy__
    58  var _ m_Functions.Dummy__
    59  var _ m_Utf8EncodingForm.Dummy__
    60  var _ m_Utf16EncodingForm.Dummy__
    61  var _ m_UnicodeStrings.Dummy__
    62  var _ m_FileIO.Dummy__
    63  var _ m_GeneralInternals.Dummy__
    64  var _ m_MulInternalsNonlinear.Dummy__
    65  var _ m_MulInternals.Dummy__
    66  var _ m_Mul.Dummy__
    67  var _ m_ModInternalsNonlinear.Dummy__
    68  var _ m_DivInternalsNonlinear.Dummy__
    69  var _ m_ModInternals.Dummy__
    70  var _ m_DivInternals.Dummy__
    71  var _ m_DivMod.Dummy__
    72  var _ m_Power.Dummy__
    73  var _ m_Logarithm.Dummy__
    74  var _ m_StandardLibraryInterop.Dummy__
    75  var _ m_StandardLibrary_UInt.Dummy__
    76  var _ m_StandardLibrary_Sequence.Dummy__
    77  var _ m_StandardLibrary_String.Dummy__
    78  var _ m_StandardLibrary.Dummy__
    79  var _ m_Streams.Dummy__
    80  var _ m_Sorting.Dummy__
    81  var _ m_HexStrings.Dummy__
    82  var _ m_GetOpt.Dummy__
    83  var _ m_FloatCompare.Dummy__
    84  var _ m_Base64.Dummy__
    85  var _ m_Base64Lemmas.Dummy__
    86  
    87  type Dummy__ struct{}
    88  
    89  // Definition of class Default__
    90  type Default__ struct {
    91  	dummy byte
    92  }
    93  
    94  func New_Default___() *Default__ {
    95  	_this := Default__{}
    96  
    97  	return &_this
    98  }
    99  
   100  type CompanionStruct_Default___ struct {
   101  }
   102  
   103  var Companion_Default___ = CompanionStruct_Default___{}
   104  
   105  func (_this *Default__) Equals(other *Default__) bool {
   106  	return _this == other
   107  }
   108  
   109  func (_this *Default__) EqualsGeneric(x interface{}) bool {
   110  	other, ok := x.(*Default__)
   111  	return ok && _this.Equals(other)
   112  }
   113  
   114  func (*Default__) String() string {
   115  	return "Actions.Default__"
   116  }
   117  func (_this *Default__) ParentTraits_() []*_dafny.TraitID {
   118  	return [](*_dafny.TraitID){}
   119  }
   120  
   121  var _ _dafny.TraitOffspring = &Default__{}
   122  
   123  func (_static *CompanionStruct_Default___) DeterministicMap(action DeterministicAction, s _dafny.Sequence) _dafny.Sequence {
   124  	var res _dafny.Sequence = _dafny.EmptySeq
   125  	_ = res
   126  	var _0_rs _dafny.Sequence
   127  	_ = _0_rs
   128  	_0_rs = _dafny.SeqOf()
   129  	var _hi0 _dafny.Int = _dafny.IntOfUint32((s).Cardinality())
   130  	_ = _hi0
   131  	for _1_i := _dafny.Zero; _1_i.Cmp(_hi0) < 0; _1_i = _1_i.Plus(_dafny.One) {
   132  		var _2_r interface{}
   133  		_ = _2_r
   134  		var _out0 interface{}
   135  		_ = _out0
   136  		_out0 = (action).Invoke((s).Select((_1_i).Uint32()).(interface{}))
   137  		_2_r = _out0
   138  		_0_rs = _dafny.Companion_Sequence_.Concatenate(_0_rs, _dafny.SeqOf(_2_r))
   139  	}
   140  	res = _0_rs
   141  	return res
   142  	return res
   143  }
   144  func (_static *CompanionStruct_Default___) DeterministicMapWithResult(action DeterministicActionWithResult, s _dafny.Sequence) m_Wrappers.Result {
   145  	var res m_Wrappers.Result = m_Wrappers.Companion_Result_.Default(_dafny.EmptySeq)
   146  	_ = res
   147  	var _0_rs _dafny.Sequence
   148  	_ = _0_rs
   149  	_0_rs = _dafny.SeqOf()
   150  	var _hi0 _dafny.Int = _dafny.IntOfUint32((s).Cardinality())
   151  	_ = _hi0
   152  	for _1_i := _dafny.Zero; _1_i.Cmp(_hi0) < 0; _1_i = _1_i.Plus(_dafny.One) {
   153  		var _2_valueOrError0 m_Wrappers.Result = m_Wrappers.Result{}
   154  		_ = _2_valueOrError0
   155  		var _out0 interface{}
   156  		_ = _out0
   157  		_out0 = (action).Invoke((s).Select((_1_i).Uint32()).(interface{}))
   158  		_2_valueOrError0 = _out0.(m_Wrappers.Result)
   159  		if (_2_valueOrError0).IsFailure() {
   160  			res = (_2_valueOrError0).PropagateFailure()
   161  			return res
   162  		}
   163  		var _3_r interface{}
   164  		_ = _3_r
   165  		_3_r = (_2_valueOrError0).Extract()
   166  		_0_rs = _dafny.Companion_Sequence_.Concatenate(_0_rs, _dafny.SeqOf(_3_r))
   167  	}
   168  	res = m_Wrappers.Companion_Result_.Create_Success_(_0_rs)
   169  	return res
   170  	return res
   171  }
   172  func (_static *CompanionStruct_Default___) DeterministicFlatMap(action DeterministicAction, s _dafny.Sequence) _dafny.Sequence {
   173  	var res _dafny.Sequence = _dafny.EmptySeq
   174  	_ = res
   175  	var _0_rs _dafny.Sequence
   176  	_ = _0_rs
   177  	_0_rs = _dafny.SeqOf()
   178  	var _hi0 _dafny.Int = _dafny.IntOfUint32((s).Cardinality())
   179  	_ = _hi0
   180  	for _1_i := _dafny.Zero; _1_i.Cmp(_hi0) < 0; _1_i = _1_i.Plus(_dafny.One) {
   181  		var _2_r _dafny.Sequence
   182  		_ = _2_r
   183  		var _out0 interface{}
   184  		_ = _out0
   185  		_out0 = (action).Invoke((s).Select((_1_i).Uint32()).(interface{}))
   186  		_2_r = _out0.(_dafny.Sequence)
   187  		_0_rs = _dafny.Companion_Sequence_.Concatenate(_0_rs, _2_r)
   188  	}
   189  	res = _0_rs
   190  	return res
   191  	return res
   192  }
   193  func (_static *CompanionStruct_Default___) DeterministicFlatMapWithResult(action DeterministicActionWithResult, s _dafny.Sequence) m_Wrappers.Result {
   194  	var res m_Wrappers.Result = m_Wrappers.Companion_Result_.Default(_dafny.EmptySeq)
   195  	_ = res
   196  	var _0_rs _dafny.Sequence
   197  	_ = _0_rs
   198  	_0_rs = _dafny.SeqOf()
   199  	var _hi0 _dafny.Int = _dafny.IntOfUint32((s).Cardinality())
   200  	_ = _hi0
   201  	for _1_i := _dafny.Zero; _1_i.Cmp(_hi0) < 0; _1_i = _1_i.Plus(_dafny.One) {
   202  		var _2_valueOrError0 m_Wrappers.Result = m_Wrappers.Companion_Result_.Default(_dafny.EmptySeq)
   203  		_ = _2_valueOrError0
   204  		var _out0 interface{}
   205  		_ = _out0
   206  		_out0 = (action).Invoke((s).Select((_1_i).Uint32()).(interface{}))
   207  		_2_valueOrError0 = _out0.(m_Wrappers.Result)
   208  		if (_2_valueOrError0).IsFailure() {
   209  			res = (_2_valueOrError0).PropagateFailure()
   210  			return res
   211  		}
   212  		var _3_r _dafny.Sequence
   213  		_ = _3_r
   214  		_3_r = (_2_valueOrError0).Extract().(_dafny.Sequence)
   215  		_0_rs = _dafny.Companion_Sequence_.Concatenate(_0_rs, _3_r)
   216  	}
   217  	var _rhs0 m_Wrappers.Result = m_Wrappers.Companion_Result_.Create_Success_(_0_rs)
   218  	_ = _rhs0
   219  	res = _rhs0
   220  	return res
   221  	return res
   222  }
   223  func (_static *CompanionStruct_Default___) Filter(action DeterministicAction, s _dafny.Sequence) _dafny.Sequence {
   224  	var res _dafny.Sequence = _dafny.EmptySeq
   225  	_ = res
   226  	var _0_rs _dafny.Sequence
   227  	_ = _0_rs
   228  	_0_rs = _dafny.SeqOf()
   229  	var _hi0 _dafny.Int = _dafny.IntOfUint32((s).Cardinality())
   230  	_ = _hi0
   231  	for _1_i := _dafny.Zero; _1_i.Cmp(_hi0) < 0; _1_i = _1_i.Plus(_dafny.One) {
   232  		var _2_r bool
   233  		_ = _2_r
   234  		var _out0 interface{}
   235  		_ = _out0
   236  		_out0 = (action).Invoke((s).Select((_1_i).Uint32()).(interface{}))
   237  		_2_r = _out0.(bool)
   238  		if _2_r {
   239  			_0_rs = _dafny.Companion_Sequence_.Concatenate(_0_rs, _dafny.SeqOf((s).Select((_1_i).Uint32()).(interface{})))
   240  		}
   241  	}
   242  	res = _0_rs
   243  	return res
   244  	return res
   245  }
   246  func (_static *CompanionStruct_Default___) FilterWithResult(action DeterministicActionWithResult, s _dafny.Sequence) m_Wrappers.Result {
   247  	var res m_Wrappers.Result = m_Wrappers.Companion_Result_.Default(_dafny.EmptySeq)
   248  	_ = res
   249  	var _0_rs _dafny.Sequence
   250  	_ = _0_rs
   251  	_0_rs = _dafny.SeqOf()
   252  	var _hi0 _dafny.Int = _dafny.IntOfUint32((s).Cardinality())
   253  	_ = _hi0
   254  	for _1_i := _dafny.Zero; _1_i.Cmp(_hi0) < 0; _1_i = _1_i.Plus(_dafny.One) {
   255  		var _2_valueOrError0 m_Wrappers.Result = m_Wrappers.Companion_Result_.Default(false)
   256  		_ = _2_valueOrError0
   257  		var _out0 interface{}
   258  		_ = _out0
   259  		_out0 = (action).Invoke((s).Select((_1_i).Uint32()).(interface{}))
   260  		_2_valueOrError0 = _out0.(m_Wrappers.Result)
   261  		if (_2_valueOrError0).IsFailure() {
   262  			res = (_2_valueOrError0).PropagateFailure()
   263  			return res
   264  		}
   265  		var _3_r bool
   266  		_ = _3_r
   267  		_3_r = (_2_valueOrError0).Extract().(bool)
   268  		if _3_r {
   269  			_0_rs = _dafny.Companion_Sequence_.Concatenate(_0_rs, _dafny.SeqOf((s).Select((_1_i).Uint32()).(interface{})))
   270  		}
   271  	}
   272  	res = m_Wrappers.Companion_Result_.Create_Success_(_0_rs)
   273  	return res
   274  	return res
   275  }
   276  func (_static *CompanionStruct_Default___) ReduceToSuccess(action ActionWithResult, s _dafny.Sequence) m_Wrappers.Result {
   277  	var res m_Wrappers.Result = m_Wrappers.Result{}
   278  	_ = res
   279  	var _0_attemptedResults _dafny.Sequence
   280  	_ = _0_attemptedResults
   281  	_0_attemptedResults = _dafny.SeqOf()
   282  	var _hi0 _dafny.Int = _dafny.IntOfUint32((s).Cardinality())
   283  	_ = _hi0
   284  	for _1_i := _dafny.Zero; _1_i.Cmp(_hi0) < 0; _1_i = _1_i.Plus(_dafny.One) {
   285  		var _2_attempt m_Wrappers.Result
   286  		_ = _2_attempt
   287  		var _out0 interface{}
   288  		_ = _out0
   289  		_out0 = (action).Invoke((s).Select((_1_i).Uint32()).(interface{}))
   290  		_2_attempt = _out0.(m_Wrappers.Result)
   291  		_0_attemptedResults = _dafny.Companion_Sequence_.Concatenate(_0_attemptedResults, _dafny.SeqOf(_2_attempt))
   292  		if (_2_attempt).Is_Success() {
   293  			var _rhs0 m_Wrappers.Result = m_Wrappers.Companion_Result_.Create_Success_((_2_attempt).Dtor_value())
   294  			_ = _rhs0
   295  			res = _rhs0
   296  			return res
   297  		}
   298  	}
   299  	res = m_Wrappers.Companion_Result_.Create_Failure_(m_Seq.Companion_Default___.Map(func(coer29 func(m_Wrappers.Result) interface{}) func(interface{}) interface{} {
   300  		return func(arg33 interface{}) interface{} {
   301  			return coer29(arg33.(m_Wrappers.Result))
   302  		}
   303  	}(func(coer30 func(m_Wrappers.Result) interface{}) func(m_Wrappers.Result) interface{} {
   304  		return func(arg34 m_Wrappers.Result) interface{} {
   305  			return coer30(arg34)
   306  		}
   307  	}(Companion_Default___.PluckErrors)), _0_attemptedResults))
   308  	return res
   309  }
   310  func (_static *CompanionStruct_Default___) PluckErrors(r m_Wrappers.Result) interface{} {
   311  	return (r).Dtor_error()
   312  }
   313  
   314  // End of class Default__
   315  
   316  // Definition of datatype ActionInvoke
   317  type ActionInvoke struct {
   318  	Data_ActionInvoke_
   319  }
   320  
   321  func (_this ActionInvoke) Get_() Data_ActionInvoke_ {
   322  	return _this.Data_ActionInvoke_
   323  }
   324  
   325  type Data_ActionInvoke_ interface {
   326  	isActionInvoke()
   327  }
   328  
   329  type CompanionStruct_ActionInvoke_ struct {
   330  }
   331  
   332  var Companion_ActionInvoke_ = CompanionStruct_ActionInvoke_{}
   333  
   334  type ActionInvoke_ActionInvoke struct {
   335  	Input  interface{}
   336  	Output interface{}
   337  }
   338  
   339  func (ActionInvoke_ActionInvoke) isActionInvoke() {}
   340  
   341  func (CompanionStruct_ActionInvoke_) Create_ActionInvoke_(Input interface{}, Output interface{}) ActionInvoke {
   342  	return ActionInvoke{ActionInvoke_ActionInvoke{Input, Output}}
   343  }
   344  
   345  func (_this ActionInvoke) Is_ActionInvoke() bool {
   346  	_, ok := _this.Get_().(ActionInvoke_ActionInvoke)
   347  	return ok
   348  }
   349  
   350  func (CompanionStruct_ActionInvoke_) Default(_default_A interface{}, _default_R interface{}) ActionInvoke {
   351  	return Companion_ActionInvoke_.Create_ActionInvoke_(_default_A, _default_R)
   352  }
   353  
   354  func (_this ActionInvoke) Dtor_input() interface{} {
   355  	return _this.Get_().(ActionInvoke_ActionInvoke).Input
   356  }
   357  
   358  func (_this ActionInvoke) Dtor_output() interface{} {
   359  	return _this.Get_().(ActionInvoke_ActionInvoke).Output
   360  }
   361  
   362  func (_this ActionInvoke) String() string {
   363  	switch data := _this.Get_().(type) {
   364  	case nil:
   365  		return "null"
   366  	case ActionInvoke_ActionInvoke:
   367  		{
   368  			return "Actions.ActionInvoke.ActionInvoke" + "(" + _dafny.String(data.Input) + ", " + _dafny.String(data.Output) + ")"
   369  		}
   370  	default:
   371  		{
   372  			return "<unexpected>"
   373  		}
   374  	}
   375  }
   376  
   377  func (_this ActionInvoke) Equals(other ActionInvoke) bool {
   378  	switch data1 := _this.Get_().(type) {
   379  	case ActionInvoke_ActionInvoke:
   380  		{
   381  			data2, ok := other.Get_().(ActionInvoke_ActionInvoke)
   382  			return ok && _dafny.AreEqual(data1.Input, data2.Input) && _dafny.AreEqual(data1.Output, data2.Output)
   383  		}
   384  	default:
   385  		{
   386  			return false // unexpected
   387  		}
   388  	}
   389  }
   390  
   391  func (_this ActionInvoke) EqualsGeneric(other interface{}) bool {
   392  	typed, ok := other.(ActionInvoke)
   393  	return ok && _this.Equals(typed)
   394  }
   395  
   396  func Type_ActionInvoke_(Type_A_ _dafny.TypeDescriptor, Type_R_ _dafny.TypeDescriptor) _dafny.TypeDescriptor {
   397  	return type_ActionInvoke_{Type_A_, Type_R_}
   398  }
   399  
   400  type type_ActionInvoke_ struct {
   401  	Type_A_ _dafny.TypeDescriptor
   402  	Type_R_ _dafny.TypeDescriptor
   403  }
   404  
   405  func (_this type_ActionInvoke_) Default() interface{} {
   406  	Type_A_ := _this.Type_A_
   407  	_ = Type_A_
   408  	Type_R_ := _this.Type_R_
   409  	_ = Type_R_
   410  	return Companion_ActionInvoke_.Default(Type_A_.Default(), Type_R_.Default())
   411  }
   412  
   413  func (_this type_ActionInvoke_) String() string {
   414  	return "Actions.ActionInvoke"
   415  }
   416  func (_this ActionInvoke) ParentTraits_() []*_dafny.TraitID {
   417  	return [](*_dafny.TraitID){}
   418  }
   419  
   420  var _ _dafny.TraitOffspring = ActionInvoke{}
   421  
   422  // End of datatype ActionInvoke
   423  
   424  // Definition of trait Action
   425  type Action interface {
   426  	String() string
   427  	Invoke(a interface{}) interface{}
   428  }
   429  type CompanionStruct_Action_ struct {
   430  	TraitID_ *_dafny.TraitID
   431  }
   432  
   433  var Companion_Action_ = CompanionStruct_Action_{
   434  	TraitID_: &_dafny.TraitID{},
   435  }
   436  
   437  func (CompanionStruct_Action_) CastTo_(x interface{}) Action {
   438  	var t Action
   439  	t, _ = x.(Action)
   440  	return t
   441  }
   442  
   443  // End of trait Action
   444  
   445  // Definition of trait ActionWithResult
   446  type ActionWithResult interface {
   447  	String() string
   448  	Invoke(a interface{}) interface{}
   449  }
   450  type CompanionStruct_ActionWithResult_ struct {
   451  	TraitID_ *_dafny.TraitID
   452  }
   453  
   454  var Companion_ActionWithResult_ = CompanionStruct_ActionWithResult_{
   455  	TraitID_: &_dafny.TraitID{},
   456  }
   457  
   458  func (CompanionStruct_ActionWithResult_) CastTo_(x interface{}) ActionWithResult {
   459  	var t ActionWithResult
   460  	t, _ = x.(ActionWithResult)
   461  	return t
   462  }
   463  
   464  // End of trait ActionWithResult
   465  
   466  // Definition of trait DeterministicAction
   467  type DeterministicAction interface {
   468  	String() string
   469  	Invoke(a interface{}) interface{}
   470  }
   471  type CompanionStruct_DeterministicAction_ struct {
   472  	TraitID_ *_dafny.TraitID
   473  }
   474  
   475  var Companion_DeterministicAction_ = CompanionStruct_DeterministicAction_{
   476  	TraitID_: &_dafny.TraitID{},
   477  }
   478  
   479  func (CompanionStruct_DeterministicAction_) CastTo_(x interface{}) DeterministicAction {
   480  	var t DeterministicAction
   481  	t, _ = x.(DeterministicAction)
   482  	return t
   483  }
   484  
   485  // End of trait DeterministicAction
   486  
   487  // Definition of trait DeterministicActionWithResult
   488  type DeterministicActionWithResult interface {
   489  	String() string
   490  	Invoke(a interface{}) interface{}
   491  }
   492  type CompanionStruct_DeterministicActionWithResult_ struct {
   493  	TraitID_ *_dafny.TraitID
   494  }
   495  
   496  var Companion_DeterministicActionWithResult_ = CompanionStruct_DeterministicActionWithResult_{
   497  	TraitID_: &_dafny.TraitID{},
   498  }
   499  
   500  func (CompanionStruct_DeterministicActionWithResult_) CastTo_(x interface{}) DeterministicActionWithResult {
   501  	var t DeterministicActionWithResult
   502  	t, _ = x.(DeterministicActionWithResult)
   503  	return t
   504  }
   505  
   506  // End of trait DeterministicActionWithResult