cairo_lang_sierra/extensions/
core.rs

1use super::ap_tracking::ApTrackingLibfunc;
2use super::array::{ArrayLibfunc, ArrayType};
3use super::bitwise::BitwiseType;
4use super::blake::{Blake2sState, BlakeLibfunc};
5use super::boolean::BoolLibfunc;
6use super::bounded_int::{BoundedIntLibfunc, BoundedIntType};
7use super::branch_align::BranchAlignLibfunc;
8use super::bytes31::{Bytes31Libfunc, Bytes31Type};
9use super::casts::CastLibfunc;
10use super::circuit::{CircuitLibFunc, CircuitType};
11use super::const_type::{ConstLibfunc, ConstType};
12use super::coupon::{CouponLibfunc, CouponType};
13use super::debug::DebugLibfunc;
14use super::drop::DropLibfunc;
15use super::duplicate::DupLibfunc;
16use super::ec::{EcLibfunc, EcOpType, EcPointType, EcStateType};
17use super::enm::{EnumLibfunc, EnumType};
18use super::felt252_dict::{
19    Felt252DictEntryLibfunc, Felt252DictEntryType, Felt252DictLibfunc, Felt252DictType,
20};
21use super::function_call::CouponCallLibfunc;
22use super::gas::BuiltinCostsType;
23use super::int::signed::{
24    Sint8Libfunc, Sint8Type, Sint16Libfunc, Sint16Type, Sint32Libfunc, Sint32Type, Sint64Libfunc,
25    Sint64Type,
26};
27use super::int::signed128::{Sint128Libfunc, Sint128Type};
28use super::int::unsigned::{
29    Uint8Libfunc, Uint8Type, Uint16Libfunc, Uint16Type, Uint32Libfunc, Uint32Type, Uint64Libfunc,
30    Uint64Type,
31};
32use super::int::unsigned128::{U128MulGuaranteeType, Uint128Libfunc, Uint128Type};
33use super::int::unsigned256::Uint256Libfunc;
34use super::int::unsigned512::Uint512Libfunc;
35use super::modules::boxing::{BoxLibfunc, BoxType};
36use super::modules::felt252::{Felt252Libfunc, Felt252Type};
37use super::modules::function_call::FunctionCallLibfunc;
38use super::modules::gas::{GasBuiltinType, GasLibfunc};
39use super::modules::mem::MemLibfunc;
40use super::modules::non_zero::{NonZeroType, UnwrapNonZeroLibfunc};
41use super::modules::unconditional_jump::UnconditionalJumpLibfunc;
42use super::nullable::{NullableLibfunc, NullableType};
43use super::pedersen::{PedersenLibfunc, PedersenType};
44use super::poseidon::{PoseidonLibfunc, PoseidonType};
45use super::qm31::{QM31Libfunc, QM31Type};
46use super::range::{IntRangeLibfunc, IntRangeType};
47use super::range_check::{RangeCheck96Type, RangeCheckType};
48use super::segment_arena::SegmentArenaType;
49use super::snapshot::{SnapshotTakeLibfunc, SnapshotType};
50use super::span::SpanType;
51use super::squashed_felt252_dict::{SquashedFelt252DictLibfunc, SquashedFelt252DictType};
52use super::starknet::{StarknetLibfunc, StarknetType};
53use super::structure::{StructLibfunc, StructType};
54use super::trace::TraceLibfunc;
55use super::uninitialized::UninitializedType;
56use crate::{define_libfunc_hierarchy, define_type_hierarchy};
57
58define_type_hierarchy! {
59    pub enum CoreType {
60        Array(ArrayType),
61        Coupon(CouponType),
62        Bitwise(BitwiseType),
63        Blake(Blake2sState),
64        Box(BoxType),
65        Circuit(CircuitType),
66        Const(ConstType),
67        EcOp(EcOpType),
68        EcPoint(EcPointType),
69        EcState(EcStateType),
70        Felt252(Felt252Type),
71        GasBuiltin(GasBuiltinType),
72        IntRange(IntRangeType),
73        BuiltinCosts(BuiltinCostsType),
74        Uint8(Uint8Type),
75        Uint16(Uint16Type),
76        Uint32(Uint32Type),
77        Uint64(Uint64Type),
78        Uint128(Uint128Type),
79        Uint128MulGuarantee(U128MulGuaranteeType),
80        Sint8(Sint8Type),
81        Sint16(Sint16Type),
82        Sint32(Sint32Type),
83        Sint64(Sint64Type),
84        Sint128(Sint128Type),
85        NonZero(NonZeroType),
86        Nullable(NullableType),
87        RangeCheck(RangeCheckType),
88        RangeCheck96(RangeCheck96Type),
89        Uninitialized(UninitializedType),
90        Enum(EnumType),
91        Struct(StructType),
92        Felt252Dict(Felt252DictType),
93        Felt252DictEntry(Felt252DictEntryType),
94        SquashedFelt252Dict(SquashedFelt252DictType),
95        Pedersen(PedersenType),
96        Poseidon(PoseidonType),
97        Span(SpanType),
98        Starknet(StarknetType),
99        SegmentArena(SegmentArenaType),
100        Snapshot(SnapshotType),
101        Bytes31(Bytes31Type),
102        BoundedInt(BoundedIntType),
103        QM31(QM31Type),
104    }, CoreTypeConcrete
105}
106
107define_libfunc_hierarchy! {
108    pub enum CoreLibfunc {
109        ApTracking(ApTrackingLibfunc),
110        Array(ArrayLibfunc),
111        BranchAlign(BranchAlignLibfunc),
112        Blake(BlakeLibfunc),
113        Bool(BoolLibfunc),
114        Box(BoxLibfunc),
115        Cast(CastLibfunc),
116        Circuit(CircuitLibFunc),
117        Coupon(CouponLibfunc),
118        CouponCall(CouponCallLibfunc),
119        Drop(DropLibfunc),
120        Dup(DupLibfunc),
121        Ec(EcLibfunc),
122        Felt252(Felt252Libfunc),
123        Const(ConstLibfunc),
124        FunctionCall(FunctionCallLibfunc),
125        Gas(GasLibfunc),
126        IntRange(IntRangeLibfunc),
127        Uint8(Uint8Libfunc),
128        Uint16(Uint16Libfunc),
129        Uint32(Uint32Libfunc),
130        Uint64(Uint64Libfunc),
131        Uint128(Uint128Libfunc),
132        Uint256(Uint256Libfunc),
133        Uint512(Uint512Libfunc),
134        Sint8(Sint8Libfunc),
135        Sint16(Sint16Libfunc),
136        Sint32(Sint32Libfunc),
137        Sint64(Sint64Libfunc),
138        Sint128(Sint128Libfunc),
139        Mem(MemLibfunc),
140        Nullable(NullableLibfunc),
141        UnwrapNonZero(UnwrapNonZeroLibfunc),
142        UnconditionalJump(UnconditionalJumpLibfunc),
143        Enum(EnumLibfunc),
144        Struct(StructLibfunc),
145        Felt252Dict(Felt252DictLibfunc),
146        Felt252DictEntry(Felt252DictEntryLibfunc),
147        Felt252SquashedDict(SquashedFelt252DictLibfunc),
148        Pedersen(PedersenLibfunc),
149        Poseidon(PoseidonLibfunc),
150        Starknet(StarknetLibfunc),
151        Debug(DebugLibfunc),
152        SnapshotTake(SnapshotTakeLibfunc),
153        Bytes31(Bytes31Libfunc),
154        BoundedInt(BoundedIntLibfunc),
155        Trace(TraceLibfunc),
156        QM31(QM31Libfunc),
157    }, CoreConcreteLibfunc
158}